Skip to content

fix(webui): settle Plan UI after terminal tasks - #1552

Open
lihongguang-0014 wants to merge 9 commits into
mainfrom
fix/plan-terminal-cleanup
Open

fix(webui): settle Plan UI after terminal tasks#1552
lihongguang-0014 wants to merge 9 commits into
mainfrom
fix/plan-terminal-cleanup

Conversation

@lihongguang-0014

@lihongguang-0014 lihongguang-0014 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Settle Plan activity, composer state, and clarify cards from authoritative task terminal outcomes for cancellation, failure, timeout, abandonment, and interruption.
  • Keep each clarify request actionable until its own acknowledgement or terminal settlement, including concurrent requests, deferred hydration, direct-mode turn ownership, and Gateway generation changes.
  • Fence terminal presentation state against delayed active events, late positive pending-input hydration, stale pending snapshots, and retired stream generations.

Root cause

The WebUI treated transport stop signals, Plan activity, and clarify responses as partially independent state machines. Clarify submission was also rendered as replied before server acknowledgement, while pending-input hydration lacked enough per-request sequence and stream-generation provenance. That allowed terminal tasks to leave interactive cards or a locked composer behind, and allowed delayed events or reconnect hydration to resurrect terminal UI state.

Scope and non-goals

This is a WebUI-only state-settlement change. It does not alter backend task lifecycle, broker behavior, wire schemas, persistence, or database structure. It does not add durable reply correlation for historical legacy Meta clarifies that have no request ID; that pre-existing reload behavior remains outside this fix.

Compatibility and platforms

The change preserves the existing RPC/event contract and accepts current task/turn identifier variants. It covers structured request-ID clarifies and live legacy Meta clarifies in both session and direct modes. It applies to the shared WebUI used by browser and desktop surfaces; no backend migration is required.

Validation

  • Focused latest-base Plan/clarify/session-lifecycle regression suite: 8 test files and 194 tests passed.
  • Full WebUI suite: 425 test files and 5,284 tests passed with npx vitest run.
  • Production WebUI build passed with architecture guards, Vue type checking, bundle generation, and artifact guards.
  • git diff --check passed.
  • Latest-head GitHub CI passed, including Linux lint/type/targeted tests, frontend unit/package validation, production-dist WebUI recovery, desktop recovery on Ubuntu/macOS/Windows, and Windows Contract determinism (run 33615941542).

Manual live desktop/gateway validation was not performed; terminal races and ownership boundaries are covered by deterministic contract and component tests.

Release note

Yes — user-visible bug fix for Plan-mode terminal cleanup and clarify-card settlement.

Fixes #1329
Fixes #1497

Commit Lineage

  • Existing candidate: fix: settle Plan cancellation UI state #1498, source commit 9c252b9ca1a18be491af939eecc404950ffc1a71.
  • The two earlier commits in that PR, 3713b900 and its exact revert 5452055d, have zero net contribution and were not replayed.
  • Candidate replay: 3aa23149268ba474353a8e576f8124afdcd3045d, cherry-picked with -x onto base 5599683468a28e86849373e3ff28eb265cb04284; the original author is preserved.
  • Same-scope refinements: 82e3cc7bcf2d9e5ae83e34732cc2dc112ea1dacc, review corrections ba1f3c5144133237e2c59f97068172f3a46e4155 and c4ca69fd3a31fc55c5ef1c1c80cb0bf6c1369c76, hydration-watermark correction 94fd1ed69ea01dfa8288b1bb0749560ae57f8a86, and terminal-recovery race correction 9e57c0ec2e32329d256a4f24af6d10b06f75c3ea.
  • Latest target integration: merge commit e074f8bdf088070cf63090ded162cd68e536f918 incorporates main at f4e65ef26cb2bb190dd9e6910027f571effa4922, including the session-lifecycle boundary refactor, without conflicts.
  • Lineage was reviewed with git range-diff 5452055d0e147c03d423d08eccbc92097537c9b5..9c252b9ca1a18be491af939eecc404950ffc1a71 5599683468a28e86849373e3ff28eb265cb04284..3aa23149268ba474353a8e576f8124afdcd3045d.

arielli-sketch and others added 9 commits September 1, 2026 23:42
Settle clarify requests and Plan presentation from authoritative task outcomes while preserving exact request ownership. Reconcile hydration and stream generations without allowing stale events to resurrect terminal UI state.
Keep task-terminal Plan presentation provisional until the authoritative resumable or cancelled PlanRun snapshot arrives. Route reconnect and history terminal owners through the same clarify settlement path, including successful and direct-mode turns.
Keep Plan mutations disabled while terminal task presentation waits for an authoritative owner-free PlanRun snapshot. Release the fence only when accepted run, plan, session, or epoch state supersedes the provisional projection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants