TLDR
Unified 7-stage modular pipeline replaces the monolithic upstream handler with extract → routing → headers → thinking → forward → transform → response stages. Subagent session affinity via CC hooks and AC markers routes each subagent to a pinned backend across its lifetime. Teammate pipeline with /teammate/{agent_id} URL-path routing and synchronous tmux shim registration enables per-agent backend selection for Agent Teams. Session token handshake via ANTHROPIC_CUSTOM_HEADERS secures proxy traffic. Per-session log file isolation prevents multi-instance log corruption. Ctrl+R restarts Claude Code while preserving the session via --resume. Dev builds are stamped with git hash and expose --version.
Breaking Changes
Config: [agent_teams] renamed to [agents] — if you have [agent_teams] in your config, rename it to [agents]. The teammate_backend field is unchanged. New optional field subagent_backend added for subagent routing.
# Before (0.4.0)
[agent_teams]
teammate_backend = "glm"
# After (0.5.0)
[agents]
teammate_backend = "glm"
subagent_backend = "glm" # optional, newFeatures
- Unified 7-stage pipeline — modular extract/routing/headers/thinking/forward/transform/response stages behind clean interfaces (
0142708) - Subagent session affinity — CC hooks register subagents in a shared registry, AC markers (
⟨AC:{id}⟩) route requests to pinned backends (dadbddc,8f019e5) - Teammate pipeline —
/teammate/{agent_id}/*URL-path routing withTeammateMarkerextension, always-strip path semantics (52ff649) - Tmux shim teammate injection — detects
--agent-id, registers via/api/teammate-start, rewritesANTHROPIC_BASE_URLper-teammate (52ff649) - Session token auth — handshake via
ANTHROPIC_CUSTOM_HEADERS, hook endpoints exempt from auth (d01cf79,e1b8c9b) - Subagent backend UI — backend selection popup and runtime toggle for subagent routing (
44a4478,64e36bf) - Per-session log isolation — per-instance log file names, old log cleanup on startup (
ee5fd00,988dd53) - Dev build versioning — git hash stamp,
--versionflag (a9a94ac)
Bug Fixes
- Skip AC marker parsing when subagent registry is empty (
3d80718) - Detect teammate spawns by
--agent-idflag instead of binary path (ab02d03) - Inject shim PATH into initial spawn env (
a0f7c10) - Disable session token check for teammate pipeline (
3878f47) - Update spawn env with actual proxy port after
try_bind()(9fc2b0d) - Resolve 3 critical pipeline bugs found in review (
20cea7c) - Use append mode instead of truncate for log files (
f63adb7) - Ctrl+R now resumes current session via
--resume(668a8ec) --continuenow uses--resumefor existing sessions (cb0b4bf)- Replace fragile sed with bash regex in tmux shim (
127b121) - Patch dependency vulnerabilities and optimize release profile (
1735bc5) - Always set
CLAUDE_CODE_SUBAGENT_MODELenv var (18dd02b) - Update stale shim tests to match current injection logic (
7ac8682)
Refactor
- Remove legacy pipeline and
unified-pipelinefeature flag (aa32d37) - Rename
SubagentBackend/SubagentRegistry→AgentBackendState/AgentRegistryfor unified agent routing (52ff649) - Harden AC marker parsing against false positives (
82e4409) - Use
agent_idinstead ofsession_idfor subagent routing (d4f4088) - Remove
CLAUDE_CODE_SUBAGENT_MODELin favor of AC marker routing (7901db3) - Rename
AgentTeamsConfig→AgentsConfig(a61e1b9) - Add SAFETY comments, reduce cloning, deduplicate formatting (
dfe3b47)
Testing
- Pipeline integration tests — 7-stage pipeline end-to-end (
pipeline_integration.rs) - Pipeline stage unit tests — per-stage isolation (
pipeline_stages.rs) - Subagent session affinity tests (
subagent_session_affinity.rs) - Session token auth tests (
session_token_auth.rs) - Spawn env corner case tests (
spawn_env_corner_cases.rs) - Ctrl+R restart tests (
restart_claude.rs) - Shim detection and injection tests (
shim.rs)