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
Slash commands (/ctx-*) fail in OpenCode web mode due to sentinel error pattern #1
The /ctx-* slash commands (ctx-status, ctx-recomp, ctx-aug, ctx-dream, ctx-flush) fail when OpenCode is running in web mode (opencode web --port <port>). The commands execute their logic and send a toast via /tui/show-toast, but the sentinel error they throw to prevent LLM forwarding causes the web server to report a failure to the browser UI.
Environment
OpenCode: web mode (opencode web --port 3456 --hostname 127.0.0.1)
Run OpenCode in web mode: opencode web --port 3456
Open a session in the browser
Run any /ctx-* command (e.g. /ctx-status, /ctx-aug, /ctx-recomp)
Command appears to fail in the UI
Expected Behavior
Commands should execute and display their output in the web UI, same as in TUI mode.
Actual Behavior
The web server catches the sentinel error (e.g. __CONTEXT_MANAGEMENT_CTX-AUG_HANDLED__) and returns a failed status. The toast sent to /tui/show-toast doesn't render in the web client.
From OpenCode logs:
INFO service=session.prompt command=ctx-aug parts=[] sessionID=ses_xxx command
ERROR service=server error=__CONTEXT_MANAGEMENT_CTX-AUG_HANDLED__ failed
INFO service=session.prompt command=ctx-recomp parts=[] sessionID=ses_xxx command
ERROR service=server error=__CONTEXT_MANAGEMENT_CTX-RECOMP_HANDLED__ failed
The toast request fires but targets the TUI endpoint:
INFO service=server method=POST path=/tui/show-toast request
Notes
The agent tools (ctx_reduce, ctx_expand, ctx_note, ctx_memory, ctx_search) work perfectly in web mode - only the slash commands are affected.
The sentinel error pattern works in TUI mode because the TUI swallows the error and renders the toast inline.
Web mode doesn't have a toast renderer, so the command output is lost and only the error surfaces.
Thanks for reporting! Unfortunately opencode doesn't provide an api to show dialogs or toast for plugins other than in TUI, so in Desktop we were resorting to sending an ignored/hidden message as user, which doesn't invoke LLM provider but shows a small error message. (which is acceptable). Now we use the same for web.
Activity
ualtinok commentedon Apr 6, 2026
Thanks for reporting! Unfortunately opencode doesn't provide an api to show dialogs or toast for plugins other than in TUI, so in Desktop we were resorting to sending an ignored/hidden message as user, which doesn't invoke LLM provider but shows a small error message. (which is acceptable). Now we use the same for web.
feat: models.dev context limits, emergency historian, drop_tool_struc…
fix: close council audit findings on budget derivation
fix(transform): convert dropStaleReduceCalls to sentinel replacement
feat(pi-plugin): rolling nudges + note nudges + auto-search hint (Ste…
fix(pi-plugin): close council audit findings (#1, #3, #4, #5, #7) + P…
perf: eliminate redundant tokenization across RPC and system-prompt h…
fix(plugin): self-heal legacy synthetic-todo rows with empty stateJson
test(e2e): add synthetic-todowrite coverage for capture, inject, repl…
fix(pi): round-2 audit — compaction boundary, reasoning replay channe…
fix(pi): round-4 audit — first-pass reset parity, post-splice ref-mis…
fix: 2-bug council findings — memory config bypass, session identity,…
fix: round-3 council findings (seq=0 m0 gap, dreamer archived underco…
fix: full-codebase audit findings (data-integrity, fail-closed, secur…
40 remaining items
feat(nudge): enable Channel 2 ceiling nudge for subagents
fix: release-audit batch — node:sqlite CI coverage, embedding-runtime…
fix(cache): remove truncateErroredTools — watermark-gated first-trunc…
feat(primers): Pi raw provider factory for refresh-primers orientatio…
Fix re-audit Councils A+B findings (FK scope, identity divergence, le…
Fix round-3 audit blockers: Pi grounding gate (cortexkit#2), config-l…
fix: address round 2 audit findings — 10 fixes
perf: add embedding cache with FTS pre-filtering and scoped session r…
fix: cap execute_threshold at 80% and invalidate compartment cache on…
fix(plugin): 8 audit fixes — JSON safety, dream scheduling, smart not…
fix: web mode commands — stop treating undefined OPENCODE_CLIENT as TUI
mc-module: compartment coverage resolution (contiguity guard + folded…
feat(compaction-off): S2 conflict detector + native-config writers (#266
fix(parity): hunt #1 — wrap Rust empty m1 (TS placeholder parity), ta…
mason: m1 renders host memory ids on host-backed harnesses, as m0 does