fix(sessions): display ACP-runtime model sentinel for ACP-keyed sessions#79543
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Current main is source-reproducible: Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this focused sessions display fix, then optionally refactor the inline overlay into a shared ACP helper once the adjacent runtime-metadata work settles. Do we have a high-confidence way to reproduce the issue? Yes. Current main is source-reproducible: Is this the best way to solve the issue? Yes. The call-site overlay is narrow, keeps the resolver pure, and the What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b8ea6097d9ac. |
Live behavior repro (deployed container)Container: Every ACP session reports the agent-config model, not the ACP runtime sentinel
After this PR, the same query returns |
d9fd12f to
e256800
Compare
|
Merge prep complete for e256800. What changed during merge prep:
Local verification: CI=true pnpm install
pnpm test src/commands/sessions.acp-model-display.test.ts src/commands/sessions.model-resolution.test.ts src/commands/sessions.default-agent-store.test.ts src/commands/sessions.test.ts
node scripts/run-oxlint.mjs src/commands/sessions.ts src/commands/sessions.acp-model-display.test.ts
pnpm check:test-types
git diff --check upstream/main...HEADResults:
GitHub verification on exact head:
Known proof gap: Re-review progress:
|
e256800 to
3e8f4b6
Compare
|
Merge prep refreshed for 3e8f4b6 after upstream/main moved again. What changed during this refresh:
Local verification: pnpm test src/commands/sessions.acp-model-display.test.ts src/commands/sessions.model-resolution.test.ts src/commands/sessions.default-agent-store.test.ts src/commands/sessions.test.ts
node scripts/run-oxlint.mjs src/commands/sessions.ts src/commands/sessions.acp-model-display.test.ts
git diff --check upstream/main...HEAD
pnpm check:test-typesResults:
Current GitHub state:
Known proof gap: |
|
After-fix Crabbox evidence for the ACP sessions display fix. Source bundle captured by Crabbox: Capture manifest: Focused sessions tests passed: After-fix seeded ACP control-plane session store proof: Touched-file oxlint: Known unrelated gap from the same Crabbox run: I also saved the standalone local evidence file at: |
3e8f4b6 to
82365cf
Compare
…shape alone; add bridge-session regression case and CHANGELOG
82365cf to
8d33ecc
Compare
|
Merge prep refreshed for head What changed during prep:
After-fix behavior proof:
AFTER_FIX_ACP_ROW={"key":"agent:copilot:acp:<redacted>","model":"copilot-acp","modelProvider":"acpx"}
CONTROL_DIRECT_ROW={"key":"agent:copilot:main","model":"gpt-5.5","modelProvider":"github-copilot"}Local verification on this tree: pnpm test src/commands/sessions.acp-model-display.test.ts src/commands/sessions.model-resolution.test.ts src/commands/sessions.default-agent-store.test.ts src/commands/sessions.test.ts
node scripts/run-oxlint.mjs src/commands/sessions.ts src/commands/sessions.acp-model-display.test.ts
git diff --check upstream/main...HEAD
pnpm check:test-types
pnpm test src/gateway/server.sessions-send.test.tsResults:
Exact-head GitHub checks:
Known merge-prep gaps: none blocking. |
|
Landed in 207fb99. Landing proof:
Duplicate/associated-thread search after landing found no open issues or PRs to close for the ACP sessions model display keywords. |
…w#79543) Display the ACP runtime sentinel for ACP control-plane session rows in openclaw sessions output, while preserving configured model/provider display for direct sessions. Verified with focused sessions tests, touched-file oxlint, check:test-types, Crabbox after-fix proof, and exact-head GitHub CI.
…w#79543) Display the ACP runtime sentinel for ACP control-plane session rows in openclaw sessions output, while preserving configured model/provider display for direct sessions. Verified with focused sessions tests, touched-file oxlint, check:test-types, Crabbox after-fix proof, and exact-head GitHub CI.
…w#79543) Display the ACP runtime sentinel for ACP control-plane session rows in openclaw sessions output, while preserving configured model/provider display for direct sessions. Verified with focused sessions tests, touched-file oxlint, check:test-types, Crabbox after-fix proof, and exact-head GitHub CI.
Summary
Display
model: "<agentId>-acp",provider: "acpx"(the ACP-runtime sentinel) for ACP-keyed sessions in theopenclaw sessionslisting, instead of the agent's configured model which was misleading. Closes catalog #20.Bug detail
Every ACP copilot session in
openclaw sessionslisting reportedmodel: "gpt-5.3-codex",modelProvider: "microsoft-foundry"— but those are the copilot agent's configured model (used for non-ACP / openclaw-agent-driven flows). When the agent runs as an ACP child, copilot CLI selects the actual model internally. The listing was reporting a model that wasn't actually used for those sessions, causing operator confusion.How to reproduce
Live repro before fix:
```bash
docker compose exec codeclaw-openclaw openclaw sessions --all-agents --json
| jq '.sessions[] | select(.key | contains("acp:")) | {key, model, modelProvider}'
Before: all ACP sessions show "model": "gpt-5.3-codex", "modelProvider": "microsoft-foundry"
After: all ACP sessions show "model": "copilot-acp", "modelProvider": "acpx"
```
Unit-level:
```bash
git checkout 5f12c52 # red-test cherry-pick
pnpm test src/commands/sessions.acp-model-display.test.ts
Before fix: 2 RED (model is the agent default; should be copilot-acp)
After fix commit e744c1a + cleanup 87b4eb7: all 3 GREEN
```
Root cause
resolveSessionDisplayModelRef(src/commands/sessions-display-model.ts:123-148) had zero ACP-awareness. It returned the agent-default model regardless of session-key shape — and the resolver is intentionally pure (per its existing design contract; we don't want to teach it about ACP).Fix approach
Sentinel overlay at the call sites — keeps the resolver pure. Mirrors the established #18 fix pattern:
applyAcpModelOverlayIfNeededhelper insrc/commands/sessions.tsthat, whenisAcpSessionKey(row.key)is true, replaces the resolver's output with{ provider: "acpx", model: "<agentId>-acp" }. The agentId is extracted viaparseAgentSessionKey, so multi-agent ACP works (copilot-acp,codex-acp, etc.).allRowsconstruction path, the JSON--jsonemit path, and the table-display per-row path.resolveSessionDisplayModelRefand so don't need the overlay. They use a different resolver (resolveSessionDisplayModelIdentityRef) which is a separate surface tracked elsewhere.The helper currently lives inline in
sessions.tsbecause the related PR for catalog #18 introduces a sharedsrc/agents/acp-runtime-overlay.tsthat would be the natural home. A// TODOcomment in the helper marks the planned migration once both PRs land.Tests
src/commands/sessions.acp-model-display.test.ts— 3 cases (2 RED → GREEN, 1 GREEN control stays GREEN).sessions.model-resolution.test.ts,sessions.default-agent-store.test.ts,sessions.test.ts,sessions.acp-model-display.test.ts— 25/25 pass after the bridge-session regression case.Real behavior proof
openclaw sessions --all-agents --jsonshould display the ACP runtime sentinel instead of the agent's configured Copilot model/provider.blue-crayfish/cbx_c22caa546489, with the after-fix capture saved in.crabbox/captures/cbx_c22caa546489-20260513T201301Z.tar.gzand posted by a maintainer at fix(sessions): display ACP-runtime model sentinel for ACP-keyed sessions #79543 (comment).openclaw sessions --all-agents --jsonrows for an ACP control-plane session and a direct control session; also ranpnpm test src/commands/sessions.acp-model-display.test.ts src/commands/sessions.model-resolution.test.ts src/commands/sessions.default-agent-store.test.ts src/commands/sessions.test.tsand touched-file oxlint.model: "copilot-acp"andmodelProvider: "acpx", while the direct control row still reportsmodel: "gpt-5.5"andmodelProvider: "github-copilot".Catalog reference
Catalog finding: #20. Investigation lives in branch
edpiva/acp-native-session-investigation(not yet upstream) atdocs/plans/2026-05-08-acp-findings-catalog.md.Verification commands
```bash
pnpm test src/commands/sessions.acp-model-display.test.ts # 3/3 GREEN
pnpm test src/commands/sessions.model-resolution.test.ts
src/commands/sessions.default-agent-store.test.ts
src/commands/sessions.test.ts
src/commands/sessions.acp-model-display.test.ts # 24/24 GREEN
node scripts/run-oxlint.mjs src/commands/sessions.ts # 0 errors
```
Notes for reviewers
model: "<agentId>-acp"(e.g.,copilot-acp,codex-acp) per the catalog spec. Open to changing the format if you'd prefer something different (e.g.,acpx:<agentId>).applyAcpModelOverlayIfNeededhelper is intentionally inlined insessions.tsuntil the parallel PR for catalog RPC agent configuration not working #18 lands itssrc/agents/acp-runtime-overlay.tshelper file. Then a small refactor PR can move the helper there.resolveSessionDisplayModelRefis intentionally unchanged — the overlay is at call sites, preserving the resolver's purity.Live behavior repro (deployed container)
Container:
codeclaw-openclaw:cleanrunning OpenClaw 2026.5.6 (e9d4a0a)PII note: UUIDs are random-not-PII; no PII to redact in this slice.
Every ACP session reports the agent-config model, not the ACP runtime sentinel
gpt-5.5/github-copilotis the copilot agent's configured model (used for non-ACP / openclaw-agent-driven flows). Under ACP the copilot CLI selects its own model internally; the listing was misreporting a model that did not run.After this PR, the same query returns
model: "copilot-acp",modelProvider: "acpx"for those rows — the actual ACP runtime sentinel.