v1.0.107
The biggest single release since v1.0.100 — comprehensive 14-adapter parity audit with line-by-line clone verification, 22 verified P0 gaps closed, and 9 fabricated claims caught and retracted before they could ship.
Why this release exists
Mickey @mikij retested v1.0.106 and surfaced the next gap: "routing block is not injected and everything rely on AGENTS.md which btw is sadly unreliable. I find instruction in AGENTS.md file often omitted by models. My focus was to inject such thing no matter what into prompt on session start and guarantee context-mode will be used by model."
That report — combined with a maintainer mandate to verify all 14 adapters in one shot rather than fix bug-by-bug — triggered a comprehensive audit:
- Phase 7: 1 main agent built a CC canonical feature catalog (77 items across 7 categories), then 13 parallel adapter agents read fresh
--depth=1clones line-by-line - Phase 8: 9 parallel staff-engineer agents implemented TDD red→green per slice
- 2 architect grills caught remaining issues (including a critical platform-detect.mjs PLATFORM_ENV_VARS misalignment)
- Code-driven verification (no agent narrative claims) caught 9 fabrications before ship
Mickey-class routing block — the headline fix
grep "ROUTING_BLOCK\|createRoutingBlock" src/opencode-plugin.ts returned 0 hits in v1.0.106. Confirmed real gap — Mickey was right.
Fixed in 3 plugin-paradigm adapters with the same pattern (evidence-based, not invented):
- OpenCode (
src/opencode-plugin.ts):experimental.chat.system.transformnow splicescreateRoutingBlock(createToolNamer("opencode"))at index 1 with a visible marker<!-- context-mode v1.0.107: routing block injected (sessionID=...) -->. SeparateroutingInjected: Set<string>(NOT the same asresumeInjected) so routing fires even without prior snapshot.splice(1, 0, ...)preserves OpenCode'ssystem[0]cache-fold header peragentisd/refs/opencode/packages/opencode/src/session/llm.ts:117-128. - OpenClaw (
src/openclaw-plugin.ts): replaced staticreadFileSync(configs/openclaw/AGENTS.md)with dynamiccreateRoutingBlock(createToolNamer("openclaw")). Same visible marker pattern. - Pi (
src/pi-extension.ts):before_agent_starthandler prepends routing block via dynamic-importgetRoutingBlock(pluginRoot). Same visible marker.
Verification path: OPENCODE_DEBUG=1 opencode → grep "<!-- context-mode v1.0.107: routing block" ~/.cache/opencode/log/*.log. The marker proves the injection landed at the system-prompt level (not user-message level like AGENTS.md).
Per-adapter P0 fixes
OpenCode (4 P0 — Mickey-class)
- OC-1 ROUTING_BLOCK injection (above)
- OC-2
chat.messagehook wired (was missing — SDK has it atagentisd/refs/opencode/packages/plugin/src/index.ts:233); captures user prompts + extractUserEvents + inline<system-reminder>filter - OC-3
buildAutoInjection(P1/P2/P3/P4 priority bands, 500-token cap) inexperimental.session.compacting(was rawbuildResumeSnapshot) - OC-4
captureAgentsMd()intool.execute.after— captures AGENTS.md / CLAUDE.md / CONTEXT.md asrule_contentevents. FILES order verified againstagentisd/refs/opencode/packages/opencode/src/session/instruction.ts
OpenClaw (6 critical)
- OClaw-1 NEW
src/openclaw/mcp-tools.ts— registers 11 ctx_* MCP tools viaapi.registerTool(mirrors swarmvault standard MCP atrefs/plugin-examples/openclaw/swarmvault/packages/engine/src/mcp.ts:46-51). The routing block was telling agents to use tools that DIDN'T EXIST in OpenClaw sessions. This is the single most severe gap closed. - OClaw-2 dynamic
createRoutingBlock(above) - OClaw-3
isSystemReminderMessage4-prefix filter inbefore_model_resolve(Mickey-class false-positive guard) - OClaw-4
session_endhandler finalizes resume snapshot (perrefs/platforms/openclaw/docs/plugins/hooks.md:110) - OClaw-5
subagent_spawninghandler injects routing block viainputOverride.prompt - OClaw-6 F6 retraction confirmed: closure flag at lines 239,483,564,568 is fine per-register() singleton scope (NOT a bug)
Pi (1 P0 + 3 P1)
- Pi-1 routing block injection (above)
- Pi-2
before_provider_responsehandler (was unregistered — captures{model, provider, latencyMs, tokens}) - Pi-3
active_memoryalways-built (removedcompact_count===0early-return) - Pi-4
buildAutoInjection500-token cap
Qwen Code (4 silent bugs — wire identical at PAYLOAD level only)
- Qwen-1 NEW
hooks/core/platform-detect.mjs— env-var detection mirrorsPLATFORM_ENV_VARSinsrc/adapters/detect.ts(single source of truth). Replaces hardcodedcreateToolNamer("claude-code")inhooks/sessionstart.mjs:22→ Qwen agents now see correct tool names instead of CC-prefix namespace - Qwen-2
configureAllHooks2 → 5 hooks (was dropping PostToolUse, PreCompact, UserPromptSubmit) - Qwen-3
hooks/core/routing.mjsTOOL_ALIASES extended with Qwen native (write_file, edit, glob, todo_write, ask_user_question, list_directory, save_memory, skill, exit_plan_mode) + OpenClaw native (exec/read/grep/search) + Codex native (shell, local_shell, etc) — curl/wget/build redirects now work on all platforms - Qwen-4
src/session/extract.tsTOOL_NAME_NORMALIZEshim normalizes platform-native tool names → CC equivalents atextractEventsentry → no more silently-dropped events on Qwen
Kiro (3 P0)
- Kiro-1 NEW
hooks/kiro/userpromptsubmit.mjs— was declared in HOOK_TYPES but no script existed - Kiro-2 NEW
hooks/kiro/agentspawn.mjs— Kiro's SessionStart-equivalent. Capability flipped totrue, parser added, routing block injected viaadditionalContext
VSCode Copilot (1 P0 + 1 path bug)
- A1
hooks.ts:98path bug — was resolving to Claude-Code generichooks/pretooluse.mjsinstead ofhooks/vscode-copilot/.... Plus created missinghooks/vscode-copilot/sessionstart.mjs(mirror of jetbrains-copilot pattern, captures.github/copilot-instructions.mdasrule_contentevents) - Z13 HOOK_TYPES STOP/SUBAGENT_START/SUBAGENT_STOP orphan removed (declared but never had scripts).
copilot-basemade these optional
Cursor (3 P0)
- C-1
sessionStartcapability flag flippedtrue(script + dispatcher already existed, capability saidfalse) - C-2 NEW
hooks/cursor/afteragentresponse.mjs(74 lines, mirrors stop.mjs); was registered in HOOK_TYPES with no script (dangling) - C-3 Task-tool deferral comment (closed-source unknown, no probe data)
Gemini CLI (1 P1)
- G-1 NEW
hooks/gemini-cli/beforeagent.mjs— Gemini's UserPromptSubmit analog perrefs/platforms/gemini-cli/packages/core/src/hooks/types.ts:580-602+hookRunner.ts:215-228(additionalContext appended to prompt)
Antigravity (1 P0)
- A-1
configs/antigravity/GEMINI.mdprependedtrigger: always_onfrontmatter — confirmed viarefs/plugin-examples/antigravity/antigravity-kit/.agent/rules/GEMINI.md:1
Zed (1 LOW)
- Z-1
configs/zed/AGENTS.mdadded "NEVER use ctx_execute/shell to create files" clause (was missing per CCrouting-block.mjs:46-50)
Kilo (1 LOW)
- K-1
src/adapters/opencode/index.tspaths() includes.kilocode/kilo.jsonand.kilocode/kilo.jsonc(Kilo runtime accepts these perrefs/platforms/kilo/packages/.../config.ts:50,408)
Codex / JetBrains Copilot (0 P0)
Both confirmed at parity. Codex 33/33 catalog items verified — F1 fabrication confirmed (claim "hooks not registered" was wrong; all 5 already registered at src/adapters/codex/index.ts:244-276). JetBrains closed-source ceiling — mcp-jetbrains is pure stdio↔HTTP proxy with no IDE injection surface (F5 retraction).
9 fabrications retracted (honest discipline)
| # | Original claim | Verified truth |
|---|---|---|
| F1 | V1: "Codex hooks not registered, 10-line fix needed" | Already at src/adapters/codex/index.ts:244-276, all 5 registered
|
| F2 | V1+V2: "GEMINI_PROJECT_DIR invented by us" | REVERSED — gemini-cli/packages/core/src/hooks/hookRunner.ts:355 SETS it (plus 4 more env vars)
|
| F3 | V2: "Add KIRO_API_REGION to detection" | Only in kiro-gateway test fixtures, NOT IDE source — detect.ts:76 comment was correct
|
| F4 | V1: "VSCode system priority injection exists"
| Only User/Assistant in chat API; systemMessage field is UI warning-only
|
| F5 | V1: "mcp-jetbrains exposes IDE injection" | Pure stdio↔HTTP proxy |
| F6 | V1: "OpenClaw closure-flag bad per community" | Sample size 0 — actually fine per-register() singleton |
| F7 | V1: "swarmvault is OpenClaw-specific MCP" | Standard @modelcontextprotocol/sdk only
|
| F8 | V1: "pi/awesome-agent-skills shows routing patterns" | Empty repo (4 scaffold files only) |
| F9 | V1: "Zed has zero chat-influence APIs" | REVERSED — slash_command + context_server_command traits CONFIRMED at extension.wit:151-160, wasm_host.rs:306-340/351-386
|
Plus during commit review: 10-file Kiro generic SDD scaffold (cc-sdd mirror) was caught as project-template content (NOT adapter wiring) and reverted.
Validation discipline
3-tier verification per gap:
- Code-driven
grepagainst fresh--depth=1clones inrefs/platforms/ - Re-grep against community plugin examples in
refs/plugin-examples/ - WebSearch +
gh code searchfor closed-source platforms (Cursor, JetBrains AI Assistant, Antigravity, Kiro IDE)
Rejected approach: agent narrative claims (V1+V2 audits had 9 fabrications detected via this discipline). Phase 7 used 1 main + 13 parallel adapter agents reading line-by-line; Phase 8 used 9 parallel staff-engineer agents writing TDD red→green per slice.
Test counts (cumulative post-Phase-8)
- 32/32 OpenCode (8 new + 8 updated cache-fold tests)
- 95/95 OpenClaw (12 new)
- 36/36 Pi (7 new)
- 17 new Qwen + 165 regression
- 49/49 Kiro
- 32/32 Cursor (2 new)
- 67/67 VSCode + Gemini (4 new)
- 297/297 across 8 adapter test suites in main worktree
- Full repo suite: 2268 pass / 9 fail (pre-existing baseline: opencode-adapter tsx subprocess infra issue,
.cwworktreenode_modules/tsxmissing — verified pre-existing via stash) - TypeScript: clean
Out of scope (deferred — not v1.0.108 either, real follow-ups)
- Companion VSIX extension for VSCode (CC12 /
vscode.lm.registerMcpServerDefinitionProvider) — STABLE API, ready when prioritized - Zed wasm32 extension (CC10 /
slash_command+context_server_command) — viable per code evidence, requires Rust+wasm32 build pipeline - JetBrains companion plugin via
postStartupActivity— closed-source IDE testing required - Qwen 7 enhancement events (Stop / SubagentStart / SubagentStop / StopFailure / SessionEnd / PostToolUseFailure / PostCompact) — Qwen has 12 hooks vs CC's 5; we ship CC parity, the extras are pure upside
- Cursor
Task-tool integration — closed-source unknown, needs probe data
Contributors
- Mickey @mikij — for retesting v1.0.106 and explicitly demanding "guarantee context-mode will be used by model". Without that pressure, we'd have shipped working-but-invisible routing for OpenCode/OpenClaw/Pi, and OpenClaw would still be telling agents to call ctx_* tools that didn't exist
- #407 contributor — handle batch env prefix by shell (merged into v1.0.107)
- Phase 7 + Phase 8 sub-agent army — 1 catalog + 13 line-by-line + 9 staff engineers + 2 architects executed the verification + implementation in parallel
Upgrade
npm update -g context-modeOr use the in-product ctx_upgrade MCP tool. The version-check refresh shipped in v1.0.106 means long-running MCP sessions catch this release within an hour automatically.
What ships in this commit
39 files changed, +2613/-351 lines:
- 6 new hook scripts (Cursor afteragentresponse, Gemini beforeagent, Kiro userpromptsubmit, Kiro agentspawn, VSCode sessionstart, OpenClaw mcp-tools)
- 1 new shared module (hooks/core/platform-detect.mjs)
- 13 modified adapter source files
- 11 modified test files (all in EXISTING locations per CONTRIBUTING.md L275)
- 4 rebuilt bundles (server.bundle.mjs, cli.bundle.mjs, hooks/session-extract.bundle.mjs, hooks/session-db.bundle.mjs)
- 2 modified configs (Antigravity GEMINI.md frontmatter, Zed AGENTS.md clause)
Zero PRDs, zero clones, zero dev artifacts shipped. Code only.