Skip to content

refactor(acp): use SDK protocol contracts - #107264

Merged
steipete merged 1 commit into
mainfrom
codex/acp-sdk-types
Jul 14, 2026
Merged

refactor(acp): use SDK protocol contracts#107264
steipete merged 1 commit into
mainfrom
codex/acp-sdk-types

Conversation

@steipete

@steipete steipete commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The ACP bridge duplicated contracts already guaranteed by @agentclientprotocol/sdk@1.1.0: it inferred the SDK stream message type, rechecked discriminated protocol unions, cast discriminated content blocks, manually listed schema keys, and retained client capability/info state with no production reader.

Why This Change Was Made

Use the SDK's public AnyMessage, SessionUpdate, ContentBlock, and schema definitions directly. Delete dead client metadata state, getters, normalization, and their test. Keep the runtime JSON-object guard because ndJsonStream parses but does not validate arbitrary JSON before this compatibility transform.

User Impact

No behavior change. ACP initialization, protocol-version normalization, session updates, prompt text/images, and schema validation retain their existing behavior. The implementation shrinks by 95 lines.

Evidence

  • Five focused ACP suites: 99 tests passed locally on the final rebased head
  • git diff --check origin/main...HEAD
  • Fresh exact-commit autoreview: clean, no accepted/actionable findings
  • Supplemental full changed gate for the same patch before the final unrelated main rebase: https://github.com/openclaw/openclaw/actions/runs/29315688883

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 14, 2026
@steipete
steipete force-pushed the codex/acp-sdk-types branch from eece42a to 019658f Compare July 14, 2026 07:53
@steipete

steipete commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for final rebased head 90ed8b27deec86984c5def34e3b40f2505dfc1f2:

  • node scripts/run-vitest.mjs src/acp/client.test.ts src/acp/event-mapper.test.ts src/acp/translator.lifecycle.test.ts src/acp/protocol-schema.test.ts src/acp/server.startup.test.ts: 99 passed locally
  • git diff --check origin/main...HEAD: passed
  • Fresh exact-commit autoreview: clean, no accepted/actionable findings
  • Supplemental: the same patch passed the complete changed gate on the immediately prior rebased head in Blacksmith Testbox: https://github.com/openclaw/openclaw/actions/runs/29315688883

Known gap: hosted CI not awaited, per maintainer instruction. The final head has focused local proof under the current validation policy; its patch is unchanged from the full-gate run.

@steipete
steipete force-pushed the codex/acp-sdk-types branch from 019658f to 90ed8b2 Compare July 14, 2026 07:55
@steipete
steipete merged commit 4ed76a7 into main Jul 14, 2026
51 of 52 checks passed
@steipete
steipete deleted the codex/acp-sdk-types branch July 14, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant