feat: 可插拔协作注入(运行时载体取代静态文档写入)/ pluggable collaboration injection#235
Open
bikeread wants to merge 1 commit into
Open
feat: 可插拔协作注入(运行时载体取代静态文档写入)/ pluggable collaboration injection#235bikeread wants to merge 1 commit into
bikeread wants to merge 1 commit into
Conversation
…ation injection via runtime carriers abg init 不再默认写入项目文档;协作契约改为桥接期运行时下发: - Codex 侧:proxy 在 thread/start 合并 developerInstructions;既有线程 resume 后 经 thread/inject_items 注入 developer contract item;(threadId, contractHash) 幂等落 pair state;hash 变化重发带取代头的完整合同;旧协议显式报错不静默回退。 - Claude 侧:插件 SessionStart hook 经 bridge-server.js --print-session-context 在 daemon 健康 + TUI 已连时注入会话上下文(绕过通知冷却)。 - CLI:init 默认零写入(--inject-docs 保留旧行为);新增 deinit 摘除存量注入块。 - 配置:injection.runtime 双侧同源开关(false 时 Codex 侧旁路、Claude hook 全静默)。 EN: abg init no longer writes CLAUDE.md/AGENTS.md by default. The collaboration contract is delivered at runtime while a bridge is attached: the codex proxy merges thread/start.developerInstructions (thread/inject_items for resumed threads, idempotent per (threadId, contractHash), full-supersede on hash change, explicit compatibility error on old protocols — never a silent AGENTS.md fallback); the plugin SessionStart hook emits the Claude-side context only while the daemon is healthy and the TUI is attached. `init --inject-docs` keeps the legacy static sections; new `abg deinit` removes previously injected blocks; `injection.runtime` is the shared opt-out for both carriers. Verified on real codex-cli 0.144.1: resume hold → inject → persist → release (200ms), non-destructive merge alongside client instructions, idempotent re-resume (contract count stays 1). Gate: typecheck + 1685 tests + plugin sync. 分工 / Split: Claude(contract module, hook carrier, CLI init/deinit, docs) × Codex(proxy carriers, ledger, config wiring, protocol E2E) — cross-reviewed in-session.
Contributor
|
Thanks for the PR! Before we can merge it, please sign our lightweight Contributor License Agreement — it keeps the project able to offer a future commercial edition alongside the open-source one. Reply here with: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要 / Summary
abg init不再默认写入项目的CLAUDE.md/AGENTS.md;协作契约改为桥接期运行时下发,项目保持零静态足迹。abg initno longer writes static sections into project docs by default — the collaboration contract is delivered at runtime, only while a bridge is actually attached.Codex 侧载体 / Codex carrier
thread/start.params.developerInstructions(合并、不覆盖客户端已有值)。thread/resume成功响应被扣住,thread/inject_items(role=developer)注入成功且 pair state 原子落账后才放行;失败/超时以显式错误终结请求,resume 不悬挂。(threadId, contractHash)账本(有界 256 条、原子写、仅收 12 位 hex);hash 变化重发带取代头的完整合同。Claude 侧载体 / Claude carrier
bridge-server.js --print-session-context在 daemon 健康 + Codex TUI 已连时注入会话上下文(承重内容,绕过通知冷却);桥不在时仅保留原有运营短提示。--check模式让 shell 与 TS 共用同一份配置判定(不在 shell 重写 JSON 解析)。CLI / 配置
abg init --inject-docs保留旧静态注入;新增abg deinit摘除存量注入块(upsert→remove 往返无损,畸形 marker 拒绝操作)。injection.runtime(默认 true):双侧同源开关,false时 Codex 侧完全旁路、Claude hook 对该工作区全静默。已知硬边界 / Known hard limit
codex-cli 0.144.1 不存在"模型可见但可撤销、不入历史"的指令通道:桥接过的线程在其自身 rollout 中保留合同,脱桥 resume 会重放。缓解:合同开头失效条款("仅在当前会话有真实桥消息时生效,绝不因本合同等待 Claude")。实测
developer_instructions配置键在 remote TUI 拓扑不透传、additionalContext同样入 rollout——均已排除。验证 / Verification
bun run check全绿:typecheck + 1685 tests / 0 fail(97 files)+ plugin bundle 同步 + 版本对齐。codex-cli 0.144.1协议级 E2E:resume 扣住→注入→落账→放行(200ms);合并不覆盖客户端 sentinel;同 hash 再 resume 79ms 且 rollout 合同计数保持 1。docs/test-plans/pluggable-injection.md。协作 / Collaboration
由 AgentBridge 自身桥接的 Claude × Codex 结对完成:Claude(契约模块、hook 载体、CLI init/deinit、文档)× Codex(proxy 载体、幂等账本、配置布线、协议 E2E),会话内完成双向交叉 review(6 项 findings 全部闭环)。
Built by a Claude × Codex pair bridged by AgentBridge itself; cross-reviewed in-session.