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.1.0.tar.gz (158.7 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.1.0-py3-none-any.whl (71.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agent_scheduler-0.1.0.tar.gz
  • Upload date:
  • Size: 158.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 1fcc33e348c6392036de54937f7e9df2cef3216d678ca97dd6976fe67692a68e
MD5 3a8b9a5864e1ab30a63387fd851ee26a
BLAKE2b-256 ae109f711d149eb57109e849042ca00103e628c069d20b4bf984ff423e061301

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_scheduler-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: agent_scheduler-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 71.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b77d611474d1d189827f32cffb797f18bbf2322f14c2710232320c821dae181
MD5 56c58ac6d5a4d0e03f3573d0bd995f8e
BLAKE2b-256 0b86233fe474248f8986ba72e2b41a02381c92137bb3efb8a8bab8bb1ec75642

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_scheduler-0.1.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

0.2.0

2 files

This release

0.1.0 This release

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