supervisor: Claude Code resident runtime + per-identity Zulip bot routing #3

Merged
founder merged 1 commit from claude-runtime into main 2026-08-22 03:52:52 +00:00
Owner

Adds a second resident runtime to the supervisor: roles whose org agent.runtime resolves to claude are served by Claude Code in headless stream-json mode (one long-lived claude process per identity thread bound to a stable --session-id, resumed after crashes; --append-system-prompt for the identity instructions; --effort from the role's reasoning effort; the forge control-plane MCP hub via --mcp-config with the bearer token expanded from the task environment; acceptEdits + explicit tool allow list). Steers written mid-turn are injected into the running turn (verified on 2.1.148: one result per turn), so steer/turn bookkeeping is unchanged. Turns that end because the process died or the upstream was overloaded are requeued.

Also: /webhook/zulip reads bot_email, so identity accounts converted to outgoing-webhook bots pin steers to their identity (@**Web** ... → web); the shared Agent Dispatcher bot keeps alias routing.

Tests: go test ./... -race green (fake claude script exercises turns, mid-turn steer, failure + process-exit recovery/resume, MCP config, effort mapping; org runtime resolution; Zulip bot routing).

Consumer: key.store PR bumping dispatch_src + org/organization.toml (tech_lead_web → claude-high tier) + nix wiring (agentDispatcher.claude, OpenBao anthropic/api-key).

🤖 Generated with Claude Code

Adds a second resident runtime to the supervisor: roles whose org `agent.runtime` resolves to `claude` are served by Claude Code in headless stream-json mode (one long-lived `claude` process per identity thread bound to a stable `--session-id`, resumed after crashes; `--append-system-prompt` for the identity instructions; `--effort` from the role's reasoning effort; the forge control-plane MCP hub via `--mcp-config` with the bearer token expanded from the task environment; `acceptEdits` + explicit tool allow list). Steers written mid-turn are injected into the running turn (verified on 2.1.148: one `result` per turn), so steer/turn bookkeeping is unchanged. Turns that end because the process died or the upstream was overloaded are requeued. Also: `/webhook/zulip` reads `bot_email`, so identity accounts converted to outgoing-webhook bots pin steers to their identity (`@**Web** ...` → web); the shared Agent Dispatcher bot keeps alias routing. Tests: `go test ./... -race` green (fake `claude` script exercises turns, mid-turn steer, failure + process-exit recovery/resume, MCP config, effort mapping; org runtime resolution; Zulip bot routing). Consumer: key.store PR bumping `dispatch_src` + org/organization.toml (`tech_lead_web` → `claude-high` tier) + nix wiring (`agentDispatcher.claude`, OpenBao `anthropic/api-key`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Roles whose org agent.runtime resolves to "claude" are served by Claude Code
in headless stream-json mode instead of the Codex app-server: one long-lived
claude process per identity thread bound to a stable --session-id (resumed after
crashes), --append-system-prompt for the identity instructions, --effort from
the role's reasoning effort, the forge control-plane MCP hub via --mcp-config
with the bearer token expanded from the task environment, acceptEdits + an
explicit tool allow list (bypassPermissions is refused as root). Steers written
mid-turn are injected into the running turn (verified on 2.1.148: one result per
turn), so the supervisor's steer/turn bookkeeping is unchanged; --claude-steering
=false makes it wait instead. Turns that end because the process died or the
upstream was overloaded are requeued rather than failed.

Runtime selection lives in org/organization.toml (agent.runtime on a role,
runtime on a tier, agent_runtime.default_runtime); tier/default models only
apply when their runtime matches so a claude role never inherits a gpt model.

Zulip: /webhook/zulip now reads bot_email, so identity accounts converted to
outgoing-webhook bots pin steers to their identity (@**Web** ... routes to web
even when the text mentions other roles); the shared Agent Dispatcher bot keeps
alias routing.

Also: the monorepo organization.toml test skips when the file is absent instead
of failing.
founder deleted branch claude-runtime 2026-08-22 03:52:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
key-store/dispatch!3
No description provided.