Skip to content

fix(tui): keep process notifications out of agent turns - #58349

Open
iwillwill-ALLWILL wants to merge 1 commit into
NousResearch:mainfrom
iwillwill-ALLWILL:fix/tui-process-notifications-status-only
Open

fix(tui): keep process notifications out of agent turns#58349
iwillwill-ALLWILL wants to merge 1 commit into
NousResearch:mainfrom
iwillwill-ALLWILL:fix/tui-process-notifications-status-only

Conversation

@iwillwill-ALLWILL

@iwillwill-ALLWILL iwillwill-ALLWILL commented Jul 4, 2026

Copy link
Copy Markdown

Summary

  • Keep process completion and watch notifications as UI/terminal status instead of synthetic agent user turns.
  • Allow async delegation completions to auto-chain only when their opaque dispatch_turn_id still owns the current real user turn.
  • Carry immutable turn identity through classic CLI, queued TUI prompts, inline TUI turns, compute-host isolation, goal follow-ups, and single/batch delegation producers.
  • Preserve current owner-scoped routing, compression lineage, durable delivery claims, shutdown draining, and failure requeue behavior.

Reimplementation

This replaces the previous patch with a clean implementation on current main (b1fc65308). It addresses the sweeper feedback on both modern TUI delivery paths and adds the equivalent stale-delegation guard to classic CLI.

The implementation is fail-closed: missing, restored, or stale turn tokens may still surface as status, but cannot create a new agent turn.

Verification

  • 504 passed across the affected CLI, goal, delegation, TUI gateway, queued-prompt, and compute-host suites.
  • ruff check .
  • python3 scripts/check-windows-footguns.py --all
  • git diff --check
  • staged secret/credential scan: no matches

Regression coverage

Includes coverage for:

  • process/watch status-only delivery in live, shutdown, and post-turn paths;
  • fresh vs stale delegation ownership;
  • queued-user races and immutable turn capture;
  • compute-host frame propagation and fail-closed empty tokens;
  • claim failures, transport write failures, ack failures, and safe requeue/defer behavior;
  • classic CLI goal/slash-command ownership;
  • single and batch delegation producers.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) tool/terminal Terminal execution and process management sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 4, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to the notify_on_complete/process-notification family: #35317 (queued input pollution), #41875 (CLI direct-display), #35667 (owner-scoped TUI routing), and the #15248 root issue. This PR takes a distinct angle — keeping background process completion/watch notifications as UI-only status (not synthetic user turns) while preserving async delegation completions as chainable follow-up turns. Not a duplicate; cross-linking so a maintainer can pick the canonical direction across this cluster.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for isolating the process-notification/agent-turn boundary; the underlying behavior remains present on current main.

Problems

  • Current main has diverged materially from this branch. TUI now applies owner and durable-delivery safeguards before dispatch in tui_gateway/server.py:8738-8815, with a separate post-turn injection path at tui_gateway/server.py:9418-9436. The change needs a manual port into both paths.
  • The proposed CLI helper still queues every async_delegation event. That does not satisfy the PR's stated stale-delegation guarantee for classic CLI; current CLI likewise queues all drained notifications at cli.py:9190-9198.

Suggested changes

  • Port the process-status split while retaining the current ownership and delivery-claim logic in both TUI paths.
  • Either narrow the stale-delegation claim to TUI/Desktop or implement an equivalent CLI turn-ownership guard.

Automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 15, 2026
@iwillwill-ALLWILL
iwillwill-ALLWILL force-pushed the fix/tui-process-notifications-status-only branch from 9dfb3f5 to b55c5c0 Compare July 18, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state tool/terminal Terminal execution and process management type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants