Skip to content

Configure Claude subagent models and caching per managed agent - #209

Merged
madskronborg merged 4 commits into
masterfrom
mk/claude-subagent-policy
Oct 26, 2026
Merged

madskronborg merged 4 commits into
masterfrom
mk/claude-subagent-policy

Conversation

@madskronborg

@madskronborg madskronborg commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Managed Claude agents currently inherit native subagent settings, so choosing cheaper workers or longer cache retention also affects ordinary Claude sessions. Add an optional Collie policy scoped to each managed Run agent, with workflow, role, scope, and call overrides.

The policy controls model selection and enforcement, cache retention, delegation availability, nesting, and concurrency. It preserves existing behavior when unset, records choices for recovery, rejects incompatible live-agent reuse, and checks Claude compatibility before opening a pane. Other Harnesses and chat sessions keep their existing behavior.

The branch includes the latest master fix for the criteria hand-back fixtures. It also fixes test races: the memory-budget test registers its hold before agents become idle, the fake forge atomically replaces its shared model, and chat fixtures retain refresh notifications until their reader starts and wait for model reads before advancing the clock. The source CLI contract test has an explicit timeout for starting both forge fakes.

Validation:

  • 400 tests passed across the agent, memory-wait, and forge files; two existing live-harness checks were skipped.
  • 66 SDK/settings/model contract tests passed.
  • All ten criteria hand-back and release-thread scenarios passed in three fresh runs; the memory-budget case passed five repetitions.
  • All 31 chat-turn tests passed. The two chat refresh/model-read cases passed 100 repetitions each after reproducing both races locally.
  • A deterministic reader-during-write regression fails against the old fake forge writer and passes with the fix. Temporarily disabling memory-budget protection makes the revised memory test fail.
  • Typecheck, lint, formatting, and diff checks passed.
  • All CI checks passed on 63a44f4: the full suite finished with 4,396 passes, 11 skips, and zero failures; build, smoke, contract, desktop, macOS, and security checks passed.

Live provider caching, billing, and model-quality effects were not tested. No installed binary or runtime settings were changed. One-hour cache retention remains opt-in because longer cache writes can cost more for short workers.

Closes #193.

Keep model routing, cache retention and delegation limits in each agent's launch settings, with role overrides and durable recovery. Refs #193.
@madskronborg madskronborg self-assigned this Oct 26, 2026
Mads Kronborg added 3 commits October 26, 2026 08:39
Register the memory hold before agents become idle and publish complete fake forge models with atomic replacement. Cover a reader during a paused write and allow the source CLI contract test time to start both forges.
Use queues for the single-reader settings fixtures and wait for fake model reads before advancing their clock. This prevents lost startup notifications and assertions racing a scheduled read.
@madskronborg
madskronborg merged commit 815fe51 into master Oct 26, 2026
5 checks passed
madskronborg pushed a commit that referenced this pull request Oct 26, 2026
…and let the peer rig's listener bind its own port

The schedule test took a Run fired before the stop, whose execution went with the engine; the oversight test ran a real verification under a clock moving a minute per millisecond, which timed it out; the board test compared two clients that could straddle the host seeing the finish. Each now waits for the state it asserts. The Flock chat race was fixed on master (#209) and is only reproduced here.

The peer rig picked a port by binding port 0 and closing it, so another process could take it before the host listened. COLLIE_PEER_PORT=0 now makes the listener bind what is free and keep that port for every later opening, so the rig names no port at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Configure Claude subagent models, cache retention, and delegation per managed agent

1 participant