Skip to main content

Subscription Agent Scheduler (subsched)

subsched is a deterministic, subscription-aware coding agent scheduler that turns GitHub Issues into a durable task queue and routes tasks to coding agents (Claude Code, OpenAI Codex) with zero metered API fallback.


Key Features

  • 🔒 Subscription-Only Execution: Strictly operates within flat-rate subscription quotas (Claude Pro/Team, ChatGPT Plus/Team). Prevents accidental pay-as-you-go API key charges with fail-closed safety.
  • 🌳 Worktree Isolation: Creates isolated Git worktrees (subsched/issue-<number>) for each task to prevent workspace collision.
  • Multi-Agent Capacity & Failover: Monitors rate limits across providers in real time, automatically failing over between agents (Claude ↔ Codex) or pausing until reset time.
  • 🛡️ Automated TDD & Quality Gates: Enforces test-driven development, running repository verification (ruff, mypy, pytest with $\ge 80%$ coverage, pip-audit) before pull requests.
  • 🔀 Merge Conflict Protection: Automatically attempts git rebase main and cleanly aborts (git rebase --abort) on conflict, safely escalating to NEEDS_HUMAN.
  • 📊 Observability & Metrics: Tracks autonomous completion rates, task success metrics, structured JSON Lines event logs, and markdown run reports.

Requirements

  • Python >=3.12
  • uv
  • Git >=2.40
  • GitHub CLI (gh)
  • Coding agent CLI tools: claude and/or codex

Quickstart

1. Installation

Option A: Run immediately without installation (uvx)

uvx agent-scheduler doctor
uvx agent-scheduler run --repo owner/project --issues 101 --dry-run

Option B: Global CLI install (uv tool)

# Install from source
uv tool install -e .

# Or install from PyPI (once published)
uv tool install agent-scheduler

Option C: Development setup

git clone https://github.com/takurot/agent-scheduler.git
cd agent-scheduler
uv sync --extra dev
uv run subsched doctor

Usage

Environment Diagnostic

Verify local executables and GitHub token scope:

subsched doctor

Running Tasks

Dry-run Mode (Safe Queue Preview)

Discovers issues and populates the durable queue without calling agent subprocesses or creating PRs:

subsched run --repo owner/project --issues 101,102 --dry-run

Live Agent Execution (--allow-native)

Executes coding agents in subscription mode, runs tests, and creates Pull Requests:

# Run specific issues
subsched run --repo owner/project --issues 101,102 --allow-native

# Run by label
subsched run --repo owner/project --label ai-ready --allow-native

# Run with natural language instruction
subsched run "Execute all open issues" --repo owner/project --allow-native

# Run using configuration file
subsched run --config subsched.yaml --allow-native

Monitoring & Operations

# Check queue and cooldown status
subsched status

# View Productivity, Reliability, and Capacity metrics
subsched metrics
subsched metrics --json
subsched metrics --report run_report.md

# Emergency pause and resume
subsched pause
subsched resume

# Cancel a specific task while preserving worktree state
subsched cancel 101

Configuration (subsched.yaml)

You can place a subsched.yaml in your project root to customize repositories, concurrency, and verification commands:

github:
  repo: owner/project
  mode: all-open # or label: "ai-ready"

execution:
  concurrency: 1

# Custom test and lint commands for your language
verification:
  commands:
    - pytest
    - ruff check .
    # For Node.js / TypeScript:
    # - npm test
    # - npm run lint

CLI Reference

Command Description
subsched doctor Check prerequisite binaries and inspect GitHub token scope
subsched run Discover issues, initialize queue, and dispatch tasks
subsched status Display queue breakdown, cooldowns, and scheduler state
subsched metrics Output Productivity, Reliability, and Capacity metrics
subsched pause Pause task execution cleanly after current step
subsched resume Resume scheduler execution from paused state
subsched cancel <id> Cancel a task and preserve its worktree files

Documentation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_scheduler-0.2.0.tar.gz (167.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_scheduler-0.2.0-py3-none-any.whl (74.1 kB view details)

Uploaded Python 3

File details

Details for the file agent_scheduler-0.2.0.tar.gz.

File metadata

  • Download URL: agent_scheduler-0.2.0.tar.gz
  • Upload date:
  • Size: 167.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agent_scheduler-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a08153c6ae743841aed2a6bd4b4270b3be6ff7127f3440b3d31deecaa3f26ea8
MD5 ce25fbe333e2c07dc059be3e4aedba83
BLAKE2b-256 3300867660cdf5126975becd0ed6df2aeefe1c781d948aa19044301208d4778d

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_scheduler-0.2.0.tar.gz:

Publisher: release.yml on takurot/agent-scheduler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_scheduler-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: agent_scheduler-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 74.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agent_scheduler-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b6a9fe65b6f582132b797ed34987c68668614f6efc132eb97e29296064d31cb
MD5 2389202e168eab5bec2705c573e9f7b0
BLAKE2b-256 c4f83670750a136ffdc3514f7f4b48b00b9b01781ad2ed7983881e347a6fed9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_scheduler-0.2.0-py3-none-any.whl:

Publisher: release.yml on takurot/agent-scheduler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page