fix(wiki-compose): hydrate UI from PATCH resume output#960
Merged
Conversation
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.
50c6849 to
0d7fc5b
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 /resumerunsdraft_sections+completedsynchronously and returnsoutput.completion, butuseWikiComposeSessiononly updatedstatusand skippedPOST /runwhen status wascompleted, socompletedMarkdownand section bodies never reached the editor.The same pattern affected Brief/Research submits: the hook discarded
PATCH /resumeoutputand calledPOST /runwith fresh graphinputon an interrupted checkpoint, which LangGraph does not support (resume requiresCommand({ resume })).Root cause
__interrupt__orcompletion), not over SSE.POST /runwould always hydrate the next phase; E2E mocks masked this by always serving draft tokens from/run.Fix
reduceResumeOutput()applies interrupt payloads and finalcompletionfrom resumeoutput.streamRunwhen resume output did not hydrate UI state.start()only callsPOST /runforpending/failedsessions (not interrupted reloads).WikiComposePagereplaces the URL with/compose/:sessionIdafter session create so refresh reopens the same row.Validation
npx vitest run src/hooks/useWikiComposeSession.test.ts(5 tests, pass)Triggered by automation review of PR #959.