You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode v2 native: acp_status tool returns legacy flat report instead of the status panel #911
Native mode (self-spawned proxy, dist/agent/opencode-native.js): in the opencode v2 TUI, let the model call acp_status (or just ask it for context status). The tool output is the legacy flat report:
while the /acp slash command renders the rich panel (host label, usage, blocks, nudge) — tool and command disagree.
Root cause
The v2 plugin forwards acp_status via forwardTool → the proxy's /__bili/plugin/tool executes the kernel's acp_status, whose text output is the legacy flat buildStatusReport. The rich panel (buildStatusPanel) is only served by the read-only status endpoint /__bili/plugin/status (status.panel), which the /acp command consumes.
Panel-first rendering was originally shipped for the in-process local kernel (#909), which is now closed/superseded by the native-proxy alignment — the fix must be re-landed on the v2 mainline.
Impact
Model-visible status is the legacy format in ALL opencode v2 modes that forward tools to the proxy (native self-spawn, launcher, attach). Confusing next to the /acp panel; loses the richer per-section data (host identity, sent vs pruned, nudge reasoning).
Suggested fix
In src/agent/opencode-v2.ts tool execute: for acp_status (read-only), read fetchStatus(base, sessionID) first and return status.panel when non-empty; fall back to forwardTool (older proxy / unknown conversation). No proxy-side change; bili pi untouched.
[bot] 🏷 Verified — this fix already exists and is ready to merge: #912 (head 96368b2, base 2026-09-15_opencode-native-plugin, clean / no conflicts).
What the PR does (matches your suggested fix exactly): in src/agent/opencode-v2.ts, when the v2 plugin executes acp_status (read-only), it now reads fetchStatus(base, sessionID) first and returns status.panel when non-empty — the same source the /acp command consumes. It falls back to forwardTool when no panel comes back (older proxy / unknown conversation). No proxy-side change; bili pi untouched. Re-lands the panel-first UX from the closed #909 on the native-proxy mainline.
Verification I ran independently (checked out the head, clean install):
Code follows the existing /acp panel pattern; fetchStatus soft-fails to undefined on a status 404 so the fallback path is safe, and any throw is still caught by the surrounding try/catch.
Test covers both paths: panel served → tool returns the panel with no forwarded tool call; status 404 → forwards and returns the kernel result, asserting a tool call was recorded.
npm run typecheck ✅ · npm run build ✅ (emits dist/agent/opencode-native.js) · full suite 1662 tests, 0 fail (2 skipped) · CI e2e green · mergeable.
One cosmetic nit (non-blocking): the new line uses status?.["panel"] while the nearby /acp handler uses status.panel — functionally identical, left as-is to keep the diff minimal.
Activity
ranxianglei commentedon Sep 17, 2026
[bot] 🏷 Verified — this fix already exists and is ready to merge: #912 (head
96368b2, base2026-09-15_opencode-native-plugin, clean / no conflicts).What the PR does (matches your suggested fix exactly): in
src/agent/opencode-v2.ts, when the v2 plugin executesacp_status(read-only), it now readsfetchStatus(base, sessionID)first and returnsstatus.panelwhen non-empty — the same source the/acpcommand consumes. It falls back toforwardToolwhen no panel comes back (older proxy / unknown conversation). No proxy-side change; bili pi untouched. Re-lands the panel-first UX from the closed #909 on the native-proxy mainline.Verification I ran independently (checked out the head, clean install):
/acppanel pattern;fetchStatussoft-fails toundefinedon a status 404 so the fallback path is safe, and any throw is still caught by the surrounding try/catch.npm run typecheck✅ ·npm run build✅ (emitsdist/agent/opencode-native.js) · full suite 1662 tests, 0 fail (2 skipped) · CI e2e green · mergeable.One cosmetic nit (non-blocking): the new line uses
status?.["panel"]while the nearby/acphandler usesstatus.panel— functionally identical, left as-is to keep the diff minimal.中文摘要:已在 PR #912 让 opencode v2 的 acp_status 优先读取代理 status 端点的富面板(与 /acp 同源)、无面板时回退到转发内核工具,并独立复验 typecheck/build/全量测试(1662 通过 0 失败)均绿,可以合并。
fix(agent): opencode v2 acp_status renders the status panel (panel-fi…