GeezerVison is showing github.com — openclaw ACP adapter: use the standing server's v2 session API — v1 /session + prompt_async contract cannot create working sessions (#3997) · Issue #4614 · developing-today/code
openclaw ACP adapter: use the standing server's v2 session API — v1 /session + prompt_async contract cannot create working sessions (#3997) #4614DescriptionFinding (from PR review)
The OpenClaw ACP-to-HTTP adapter (bin/opencode-acp-adapter.mjs) implements the older v1 session contract against a target that is the OpenCode 2.x standing server pinned in flake.nix. Codex (P1, PR #3997):
The existing client for that same standing server, pm-stack/dispatch/src/opencode.ts, creates sessions with POST /api/session, supplies location.directory in the body, unwraps the {data: …} response, and submits prompts through /api/session/:id/prompt. Here, session creation instead uses /session?directory=… and expects a bare id; subsequent prompts likewise use the incompatible prompt_async route. Consequently, switching OpenClaw to this adapter does not provide a working session flow against its intended server. Implement and test against the pinned server's contract rather than the v1-shaped stub.
Evidence
Acceptance criteria
- The adapter creates sessions and submits prompts using the pinned standing server's v2 contract (
POST /api/session with location.directory in the body, {data: …} unwrapping, /api/session/:id/prompt), matching pm-stack/dispatch/src/opencode.ts.
- A test exercises session creation + prompt submission against the v2-shaped contract (not only a v1-shaped stub).
- Or the finding is resolved by a documented decision on this issue.
Activitydezren39 commented on Nov 2, 2026 dezren39 commented on Nov 2, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 2, 2026 agent-note:v1
event: handed_off
state: handed off
task: 6516 (repo-health-code-pilot; worker repo-worker-code)
session: ses_e5e61a57c1fffel1uNNU9Zqu6O
route: opencode-route/workhorse
action: Bound OpenCode worker launched for this already-claimed task; it must not claim another task. dezren39 commented on Nov 2, 2026 agent-note:v1
event: started
state: in_progress
task: 6516 (repo-health-code-pilot; worker repo-worker-code)
session: ses_e5e61a57c1fffel1uNNU9Zqu6O
action: Revalidated issue #4614, merged source PR #3997, unresolved Codex P1, and current main. Current main still uses the v1 /session and prompt_async routes while the same-server v2 client uses /api/session, location.directory in body, {data:…} unwrapping, and /api/session/:id/prompt. No hard-stop labels or competing open PR found. Proceeding with laptop-only fix and contract test. dezren39 commented on Nov 2, 2026 agent-note:v1
event: parked
state: parked
task: 6516 (repo-health-code-pilot; worker repo-worker-code)
session: ses_e5e61a57c1fffel1uNNU9Zqu6O
action: Revalidated the live P1 against main and the pinned OpenCode v2 protocol. The adapter and its stub test remain on v1 routes; v2 requires /api/session with location.directory, /api/session/:id/prompt, /api/event, v2 permission reply, and /api/session/:id/interrupt. No code or branch was created because task policy requires laptop worktree edits/tests, but the laptop SSH helper cannot start without HTTPS_PROXY in the runtime environment. Parked 20 minutes; resume when the approved laptop SSH path is available. dezren39 commented on Nov 3, 2026 agent-note:v1 — design-architect pass 41 (2026-11-02)
This issue is Phase 1 of design #DESIGN (a prompt's state dies with the prompt — one server contract and one lifecycle for the OpenClaw ACP adapter), adopted as a sub-issue of that design. Do not re-file, re-scope or split it: implement it as the phase, with the decisions recorded on #DESIGN.
Phase structure: Phase 1 = this issue (v2 server contract); Phase 2 = #4616 + #4618 (scoped prompt state, one terminal cleanup — independent of this phase in code); Phase 3 = #4617 (reconnect reconciliation — gated in substance on this phase's v2 session read and on Phase 2's terminal function); Phase 4 = #4707 (closing inventory, gated on Phases 1–3).
Recorded for this phase beyond its own acceptance: disposition the remaining v1-shaped routes against the pinned server (abort, permission reply, event stream), and pin the v2 prompt submission semantics (blocking vs fire-and-event) — Phase 3 is written against whatever this phase establishes, so state it on this issue when known. This issue is currently parked with a holder; the design records the phase structure and does not reassign it. dezren39 commented on Nov 3, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|