Skip to content

fix(ui): settle live turn after persisted completion - #3791

Merged
hqhq1025 merged 1 commit into
apache:mainfrom
hqhq1025:codex/fix-stale-live-turn-terminal
Aug 25, 2026
Merged

fix(ui): settle live turn after persisted completion#3791
hqhq1025 merged 1 commit into
apache:mainfrom
hqhq1025:codex/fix-stale-live-turn-terminal

Conversation

@hqhq1025

Copy link
Copy Markdown
Contributor

Summary

  • treat a persisted non-running turn_state as authoritative terminal evidence when the renderer missed the live terminal event
  • terminalize retained thinking/text/tool projections and clear stale provider retry state so the composer, timer, and stop control leave their running state
  • add a regression test for a completed durable transcript paired with a stale non-terminal live projection
  • finish the three queue-test call sites left behind by the typed Runtime Host request migration so the current main revision compiles

Root cause

The Runtime Host had completed the run and persisted both the assistant response and terminal turn_state, but reconcileTerminalLiveTurn() only used the persisted terminal marker to settle steering messages. A live projection containing text was retained unchanged, so a missed terminal event could leave the renderer permanently active even though the answer was already visible.

Verification

  • npm --workspace @maka/ui test — 228/228 passed
  • npx biome check packages/ui/src/live-turn-projection.ts packages/ui/src/__tests__/live-turn-projection.test.ts packages/runtime-host/src/__tests__/execution-host-queue.test.ts — passed
  • npm --workspace @maka/ui run typecheck — passed
  • npm --workspace @maka/runtime-host run typecheck — passed
  • npm --workspace @maka/desktop run typecheck — passed
  • git diff --check origin/main...HEAD — passed
  • Electron smoke test — a completed answer no longer retained the processing indicator or Stop control, and the composer returned to its idle state

The full Runtime Host suite was attempted, but current-main integration fixtures fail during Host startup with no such table: message_admissions and then do not exit cleanly. The Runtime Host build and typecheck pass; the failure occurs before the changed queue assertions execute.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex investigated the runtime/renderer state mismatch, implemented the reconciliation fallback, added regression coverage, and performed local verification.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@hqhq1025
hqhq1025 requested review from Astro-Han August 25, 2026 12:03

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this head and found no blocking issues.

reconcileTerminalLiveTurn() now correctly uses the persisted non-running turn_state for the same turnId as terminal evidence, clearing stale retry and marking in-flight tools as interrupted. No parallel authority or inferred state misuse.

No P0-P3. Checks on 6bce1b5ddb are test: in_progress — code GO, awaiting green.

简体中文该头未发现阻断。

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE — 6bce1b5, no P0-P3, terminal live-turn reconciliation correctly scoped.

@hqhq1025
hqhq1025 force-pushed the codex/fix-stale-live-turn-terminal branch from 6bce1b5 to 34d49b0 Compare August 25, 2026 13:15
@hqhq1025

Copy link
Copy Markdown
Contributor Author

Rebased onto current main after #3796 merged. The superseded Runtime Host test-migration commit has been removed from this branch, so the PR now contains only the live-turn reconciliation fix.

Local verification on 34d49b0b3:

  • npm --workspace @maka/core run build
  • npm --workspace @maka/ui test (228 passed)
  • git diff --check origin/main...HEAD

Please re-review the refreshed head.

@hqhq1025
hqhq1025 requested review from Astro-Han August 25, 2026 13:16
@hqhq1025
hqhq1025 merged commit b1e39a9 into apache:main Aug 25, 2026
1 check 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.

2 participants