Skip to content

fix(wiki-compose): hydrate UI from PATCH resume output#960

Merged
cursor[bot] merged 1 commit into
developfrom
cursor/critical-correctness-bugs-de22
May 24, 2026
Merged

fix(wiki-compose): hydrate UI from PATCH resume output#960
cursor[bot] merged 1 commit into
developfrom
cursor/critical-correctness-bugs-de22

Conversation

@cursor

@cursor cursor Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

Wiki Compose P2 (#950 / PR #959) could complete the orchestrator on the server while the split-screen UI showed an empty draft. After approving the outline, PATCH /resume runs draft_sections + completed synchronously and returns output.completion, but useWikiComposeSession only updated status and skipped POST /run when status was completed, so completedMarkdown and section bodies never reached the editor.

The same pattern affected Brief/Research submits: the hook discarded PATCH /resume output and called POST /run with fresh graph input on an interrupted checkpoint, which LangGraph does not support (resume requires Command({ resume })).

Root cause

  • Non-streaming resume returns graph state in JSON (__interrupt__ or completion), not over SSE.
  • Client assumed a follow-up POST /run would always hydrate the next phase; E2E mocks masked this by always serving draft tokens from /run.

Fix

  • reduceResumeOutput() applies interrupt payloads and final completion from resume output.
  • Submit handlers only call streamRun when resume output did not hydrate UI state.
  • start() only calls POST /run for pending/failed sessions (not interrupted reloads).
  • WikiComposePage replaces the URL with /compose/:sessionId after session create so refresh reopens the same row.
  • Tests lock outline completion and research interrupt hydration.

Validation

  • npx vitest run src/hooks/useWikiComposeSession.test.ts (5 tests, pass)

Triggered by automation review of PR #959.

Open in Web View Automation 

Outline approval runs draft synchronously on PATCH /resume and returns
completion in JSON, but the hook ignored output and skipped SSE when status
was completed, leaving the editor empty. Apply __interrupt__ and completion
from resume output, avoid invalid POST /run on interrupted checkpoints, and
persist sessionId in the compose URL after create.
@cursor cursor Bot force-pushed the cursor/critical-correctness-bugs-de22 branch from 50c6849 to 0d7fc5b Compare May 24, 2026 22:40
@cursor cursor Bot marked this pull request as ready for review May 24, 2026 22:42
@cursor cursor Bot requested a review from otomatty as a code owner May 24, 2026 22:42
@cursor cursor Bot merged commit bda5585 into develop May 24, 2026
29 checks passed
@cursor cursor Bot deleted the cursor/critical-correctness-bugs-de22 branch May 24, 2026 22:50
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.

1 participant