feat(acp): export typed ACP registry + CI drift check vs openhands-sdk#173
Conversation
|
@OpenHands fix CI errors |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
Two CI failures on PR #173: 1. CI/security (npm audit): brace-expansion 5.0.2-5.0.5 (GHSA-jxxr-4gwj-5jf2) and ws 8.0.0-8.20.0 (GHSA-58qx-3vcg-4xpx) advisories landed between the last main run and this branch. ws clears via npm audit fix; the vulnerable brace-expansion@5.0.5 comes from eslint -> minimatch@10, so nest a 'brace-expansion: ^5.0.6' override under the existing eslint.minimatch entry. Audit is clean (0 vulnerabilities). 2. Integration Tests/integration-test (TS compile error): the deterministic ACP test was passing { kind: 'Agent', llm: {...} } to manager.acp.createConversation, which only typechecked under the old pass-through ACPAgentConfig. Update it to a real ACPAgentConfig with kind: 'ACPAgent', acp_server: 'claude-code', and acp_command sourced from ACP_PROVIDERS['claude-code'].default_command. Still pure CRUD (create / count / get / batch-get), so no ACP subprocess is spawned. Local: npm run lint, build, test (216/216), format:check, audit all green. Co-authored-by: openhands <openhands@all-hands.dev>
|
Pushed 5daddb7 fixing both CI failures:
Local sanity: This comment was created by an AI agent (OpenHands) on behalf of the user. |
SummaryRequest: Fix CI errors on PR #173 (feat-acp-registry). Done: ✅ All 7 CI checks now pass on commit 5daddb7. Checklist
ConcisenessOnly three files changed: |
6485a88 to
75b43ca
Compare
…-sdk Mirror `openhands.sdk.settings.acp_providers.ACP_PROVIDERS` from software-agent-sdk so downstream TS consumers (notably agent-canvas) can stop hand-keeping their own copies, and add a CI check that fails the build if the mirror drifts from the Python source of truth. Design: - `src/models/acp-providers.json` is the single source of truth on the TS side — pure data, hand-edited to match the Python registry. - `src/models/acp.ts` is a thin types-and-helpers layer that imports the JSON. Exports `ACPProviderKey`, `ACPProviderInfo`, `ACP_PROVIDERS`, `getAcpProvider`, and `ACP_SETTINGS_KEYS`. - `scripts/check-acp-drift.py` reads the JSON directly and diffs against the live `ACP_PROVIDERS` from a pinned `openhands-sdk` install. Exits non-zero with a unified diff on mismatch. - CI job `validate-acp-providers` runs the Python script (no Node, no tsx). Not gated by continue-on-error — drift blocks merging. - `scripts/copy-json-assets.mjs` copies `.json` from `src/` to `dist/` after `tsc` so the JSON import resolves at runtime in the published package. Purely additive — no version bump needed, no breaking type changes. The `ACPAgentConfig` placeholder in `src/models/conversation.ts` is left untouched; tightening can come later as a separate, deliberate PR. Closes part of agent-canvas#587. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
75b43ca to
fcfe4f7
Compare
Summary
Expose the ACP provider registry from
@openhands/typescript-clientso consumers (notablyagent-canvas) can stop maintaining their own hand-kept TypeScript mirrors ofopenhands.sdk.settings.acp_providers.ACP_PROVIDERS, and add a CI check that fails the build if the TS-side registry drifts from the Python source of truth.Closes
agent-canvas#587(drift risk) and unblocks a follow-up agent-canvas PR that deletessrc/constants/acp-providers.tsand pins this client.Design
src/models/acp-providers.json— the registry data, single source of truth on this side. Hand-edited to matchopenhands.sdk.settings.acp_providers.ACP_PROVIDERSfield-for-field.src/models/acp.ts— thin types-and-helpers layer that imports the JSON and exports:ACPProviderKeyliteral type ('claude-code' | 'codex' | 'gemini-cli'; no'custom'— that's a UI-side discriminator with no registry entry)ACPProviderInfointerface mirroring the Python dataclassACP_PROVIDERS: Readonly<Record<ACPProviderKey, ACPProviderInfo>>getAcpProvider(key)lookupACP_SETTINGS_KEYSallow-list (for clients filtering ACP-only fields out of non-ACP payloads)scripts/check-acp-drift.py— single Python script. Importsopenhands.sdk.settings.acp_providers.ACP_PROVIDERSfrom a pinned install, readssrc/models/acp-providers.json, normalises both to JSON, diffs. Exits non-zero with a unified diff on mismatch.validate-acp-providers— Python 3.12 +pip install -r scripts/requirements-acp-check.txt+python scripts/check-acp-drift.py. No Node, notsx. Not gated bycontinue-on-error— drift blocks merging.scripts/copy-json-assets.mjs— small build helper that copies.jsonfromsrc/todist/aftertsc, so the JSON import resolves at runtime in the published package.Scope decisions
0.1.1. The prior version of this PR tightened theACPAgentConfiginterface into a strict shape, which was a type-level breaking change and required a minor bump on 0.x — that change is dropped here. We can revisit type tightening as a separate, deliberate PR when there's a real consumer asking for it.What changed vs. main
287 added / 7 deleted across 9 files. (For context, an earlier version of this PR carried ~1,292 added lines across 12 files plus a 0.2.0 version bump; that scope was trimmed per review.)
Verified locally
npm run build— succeeds, including the JSON-copy step.dist/models/acp-providers.jsonships alongside the compiled.js.npm test— 199 / 199 passing.npm run lint— clean (warnings pre-existing in this branch).npm run format:check— clean.python scripts/check-acp-drift.pyagainst the liveopenhands-sdk— reportsOK: src/models/acp-providers.json matches openhands-sdk (3 providers).and exits 0.codexentry fromacp-providers.jsonand re-ran — exits 1 with a unified diff pointing at the missing block. Restored.Test plan
test,build,security,Integration Tests,validate-acp-providersall pass on this PR.python scripts/check-acp-drift.pylocally afterpip install -r scripts/requirements-acp-check.txtand observeOK: ….dist/models/acp-providers.jsonis present afternpm run build.Next steps
@openhands/typescript-clientsrc/constants/acp-providers.tswith re-exports from the SDKReferences
openhands.sdk.settings.acp_providersin software-agent-sdk — the canonical Python source🤖 Generated with Claude Code