Skip to content

Fix reliable dashboard terminal submit - #952

Merged
bradbrok merged 1 commit into
mainfrom
agent/dashboard-terminal-submit
Jul 31, 2026
Merged

Fix reliable dashboard terminal submit#952
bradbrok merged 1 commit into
mainfrom
agent/dashboard-terminal-submit

Conversation

@bradbrok

@bradbrok bradbrok commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • start every dashboard terminal input request immediately instead of promise-chaining Enter behind text
  • make requests cumulative and daemon-acknowledged by client/sequence so slower or out-of-order requests are safe and idempotent
  • send Enter with browser keepalive and retry transient failures without duplicating text
  • add frontend, route, and tmux-session regressions; run the frontend tests in CI

Root cause

The terminal serialized each text/Enter fetch through a promise chain. Closing or switching the terminal incremented sendEpoch, deliberately dropping links that had not started. With a slow text request, the queued Enter never initiated, leaving visible text unsubmitted. A pre-fix positive control produced only [{text: "rapid"}]; Enter was absent.

The replacement starts Enter synchronously and includes every unacknowledged prior event. The tmux session serializes and de-duplicates cumulative batches by terminal-client sequence, including partial receipts, while the component continues to snapshot the original pane target.

Gauntlet fix

The first review head let stale request callbacks overwrite newer state. A late old success could clear an exhausted pending Enter error, while a late old failure could display after a newer cumulative Enter had succeeded. Success now clears the UI only when no event remains pending, and failed requests are suppressed when their maximum sequence is already globally acknowledged. Both response-order races have regressions.

Scope boundary

This fixes only the dashboard terminal path: TmuxPaneModal → POST /tmux/pane/keys → send_pane_key_events. Wake-prompt delivery is a separate _deliver_turn → paste_text path using bracketed paste, fixed delays, and tmux Enter; it does not share this keepalive/sequence sender and is intentionally not claimed fixed here. A live 08:59 Mini wake loss after pre-prompt /effort ultracode remains known-uncovered composer evidence.

Validation

  • npm test: 5/5
  • npm run build: pass
  • PINKY_SHARED_MCP=0 uv run pytest -q tests/test_agent_status.py::TestTmuxPaneKeys: 11/11
  • uv run pytest -q tests/test_tmux_session.py: 363/363
  • uv run ruff check ., uv lock --check, compileall, and git diff --check: pass
  • isolated tmux pipe-pane byte tap: dashboard path emitted printable bytes plus 0d, byte-identical in shape to plain tmux send-keys -l ...; send-keys Enter; no escape/control residue or paste wrapper

Closes #951

@olegbrok
olegbrok force-pushed the agent/dashboard-terminal-submit branch from a005b02 to 9c657f6 Compare July 31, 2026 16:16

Copy link
Copy Markdown
Owner Author

Live RC E2E arbiter — terminal PASS

Exact head: 9c657f66252b9869a09dfc7a6e3d84680124b593 (b2cdffbef55137603188fbecef233c7ee58af822 stable patch-id).

Barsik independently ran the built worktree through an isolated scratch daemon/data directory and Playwright Chromium against a live tmux/CC pane; production was untouched. Result: 10/10 PASS.

  • Rapid type → Enter: 5/5 submitted; no inputError.
  • Enter → immediate page close: keepalive delivered; turn started.
  • CDP slow-network throttle (1000 ms RTT): submitted once; no doubled composer text; cumulative retry dedupe confirmed live.
  • Exhausted Enter plus delayed stale prefix acknowledgements: visible failure remained truthful and was not silently cleared.
  • Delayed stale old failure after newer cumulative Enter success: suppressed; no stale overlay; turn started.
  • Scratch daemon: zero pane-input gap lines and zero tracebacks.

Murzik's terminal exact-head gauntlet and all required CI are also PASS. Scope remains dashboard TmuxPaneModal → /tmux/pane/keys → send_pane_key_events; wake delivery is separately tracked by #953 and is not claimed fixed here.

@bradbrok
bradbrok marked this pull request as ready for review July 31, 2026 16:46
@bradbrok
bradbrok merged commit 38457b2 into main Jul 31, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard RC terminal drafts render in the agent pane but cannot be submitted pane-side — typed operator replies silently stall

2 participants