Skip to content

[bug] opencode v2 /acp status panel invisible in TUI (silently dropped when > ~1KB) #877

Closed

Description

@ranxianglei

Found while live-testing PR #850's /acp (OpenCode V2 native plugin) in a real opencode v2.0.4 TUI behind bili.

Symptom

Typing /acp produces no visible output at all in the TUI — no panel, no notice; the user perceives "empty message / nothing happens". Short synthetic texts DO appear as notice rows, which hides the bug until the real (multi-line, box-drawn) ACP panel is long enough to trip the cap. Repro: v2.0.4 TUI + one model message (so the proxy has an ACP session → full panel), run /acp → screen shows nothing new.

Root cause (official v2.0.4 source)

The panel was carried only in the synthetic message's text. The TUI renders a synthetic message as a visible Notice row only in canRenderImmediately (packages/app/src/session/timeline/message-timeline.tsx):
(message.type === "system" || message.type === "synthetic") && (message.description ?? message.text).length <= 1024
Any display text over ~1KB renders NOTHING (not even collapsed). Real ACP panels routinely exceed that.

Fix

Carry the panel in description (verbatim under 1024 chars; leading lines + [panel truncated] marker above) and set the model-facing text to an inert one-liner (V2_SYNTHETIC_TEXT) so context never repeats panel content. Verified live in v2.0.4: short panels render fully as the notice row; a >1.5KB panel renders its leading lines plus the marker.

Fixed in branch 2026-09-17_opencode-v2-acp-visible-panel (stacked on #850 and on the no-wake fix).

Activity

  1. ranxianglei commented on Sep 17, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework · qwen3.8-27b

    [bot] 🏷 Triage complete — bug confirmed at the root-cause level, fix verified and re-preflighted. PR: #880

    What I verified (independently, not just taking the report):

    1. Root cause is real. Pulled the official opencode v2.0.4 source (packages/app/src/session/timeline/message-timeline.tsx:206-214, canRenderImmediately): the Notice row renders only when
      (message?.type === "system" || message?.type === "synthetic") && (message.description ?? message.text).length <= 1024.
      The panel was carried in text only → any panel over ~1 KB renders nothing (not even collapsed). Matches your live repro exactly.
    2. Layer judgment. This is not an ACP/kernel or bili-proxy defect — the proxy built the panel correctly and called session.synthetic() correctly; the drop happens entirely in opencode v2's TUI render gate (an intentional ≤1 KB fast-path cap for synthetic/system rows). Fixing it on the plugin side by choosing which field carries the panel is therefore the right layer, and there is no upstream bug to file: description is the sanctioned override field in that same condition.
    3. API shape confirmed. In the local opencode v2 binary, the SDK's session.synthetic() posts {id, text, description, metadata, delivery, resume} to /api/session/:id/synthetic and the Synthetic message schema carries optional text/description — so passing description is first-class, not a hack.
    4. Fix reviewed (commit 304110a, 3 files, +48/−7): panel → description (verbatim under 1024; above that, leading lines + \n\n[panel truncated] = 1023 chars, under the cap); model-facing text → inert one-liner V2_SYNTHETIC_TEXT so context stops repeating panel content. Existing assertions moved to .description; new truncation test (1500×X panel → desc.length ≤ 1024, ends with marker, text = inert line).
    5. Pre-flight on the branch: npm run typecheck clean · npm test 1659 pass / 0 fail / 2 skipped · npm run build OK. (No e2e run required — agent-side plugin only, request pipeline untouched.)

    Process note: commit 304110a already landed via #878, but #878's base was the stale 2026-09-17_opencode-v2-acp-no-wake branch — not the #850 stack (where the no-wake fix already merged via #875) — so the fix never reached the real branch. PR #880 carries the same single commit onto the correct base (2026-09-15_opencode-native-plugin); diff vs base is exactly that one commit. Minor: the commit message/comments cite "#879"/"#880" where they mean #876/#877 (numbers pre-dated the issues); left as-is since the commit is already merged.

    中文摘要:独立核实了 bug 根因(opencode v2.0.4 TUI 对 synthetic 消息存在 ≤1024 字符的即时渲染上限,面板放 text 里超长即整行不显示);修复方案正确、synthetic({description}) 为官方支持字段,单测与 typecheck/test/build 全过;原 #878 合到了过期的 no-wake 分支上,新 PR #880 已把同一提交放到正确的 #850 分支上,可以合并。

  2. ranxianglei commented on Sep 17, 2026

    @ranxianglei
    OwnerAuthor

    继续

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions