Skip to content

feat(routing): add configurable subagent model hooks - #52

Merged
Phelan164 merged 1 commit into
mainfrom
feat/subagent-model-routing
Sep 15, 2026
Merged

Phelan164 merged 1 commit into
mainfrom
feat/subagent-model-routing

Conversation

@Phelan164

Copy link
Copy Markdown
Owner

Summary

Add an experimental, opt-in subagent model-routing hook example with the requested defaults:

Tier Model Reasoning
easy gpt-5.6-luna low
medium gpt-5.6-sol high
difficult gpt-6-astra high
  • Personal YAML policy, prompt-policy hook, and native spawn-argument adapter.
  • Preserve explicit model/effort choices; difficult fallback for uncertain work; medium reviewer minimum.
  • One atomic, persisted tier increase per logical task; idempotent call replay handling.
  • Operator-verified model/effort inventory. Missing combinations inject no override.
  • Private metadata-only SQLite decision log. Actual model and token usage remain unknown, not zero.
  • Setup, customization, rollback, app smoke-test checklist, README/module entry points, and CI tests.

This does not change the main session model, install hooks into the maintainer's environment, modify installed skills, or create agents automatically. It makes no additional model/API calls. Main-agent classification and explicit delegation authority remain required.

Validation

  • python3 scripts/validate_repo.py
  • Playground tests pass when the lab changed — unchanged lab; both backend tests also passed.
  • Changed skills pass quick_validate.py — not applicable; no skill changed.
  • Version-sensitive product claims link to official documentation

Additional evidence:

  • .venv-routing/bin/python -W error::ResourceWarning -m unittest discover -s scripts/tests -p 'test_*.py' — 76 passed, including 27 routing tests.
  • python3 skills/maintain-codex-wiki/scripts/wiki_lint.py . — passed.
  • Measurement-template summary command — passed.
  • Python compilation and git diff --check — passed.
  • Tests cover exact defaults, overrides, reviewer floors, missing inventory entries, unsupported adapters, malformed metadata/config, concurrency, replay safety, escalation limits, log privacy, disabled routing, and CLI failure output.
  • Fixed unclosed SQLite connections found during the broader validation pass.

Not verified: live Codex app hook activation or actual child-model switching. The locally available terminal CLI is 0.143.0; the app runtime may differ. This PR intentionally includes a smoke-test checklist and does not claim a minimum compatible version or token/cost savings.

Official contracts: Hooks, Subagents. ECC/RouteLLM inspiration is attributed in the example guide.

Safety and scope

  • Examples contain no credentials or destructive defaults
  • Community practices are labeled as such
  • The change is limited to the described scope

Risks and boundaries:

  • Hook trust/enabled state and supported tool paths are prerequisites, not guaranteed coverage.
  • Custom-agent config can override a requested model. Logs are pre-spawn decisions, not actual execution telemetry.
  • Difficulty/role labels and stable task ids are cooperative agent inputs, not adversarial enforcement. Explicit overrides and unsupported adapters bypass automatic routing.
  • A stale inventory can still produce a failed spawn; no runtime fallback/retry is implemented.
  • Escalation reservations count even if spawn later fails; this is not a total retry/token budget.
  • No sandbox or approval arguments are altered. Hook script/config failures emit redacted errors.

Rollback: disable/remove only the two installed handlers or set routing.enabled: false in the private policy. Preserve unrelated hooks and local state. Repository rollback requires reverting this PR; no production service or migration is affected.

@Phelan164
Phelan164 merged commit d173272 into main Sep 15, 2026
3 checks passed
@Phelan164
Phelan164 deleted the feat/subagent-model-routing branch September 15, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant