fix(wiki-compose): unblock auto-start after backend load races and failures#987
Draft
cursor[bot] wants to merge 2 commits into
Draft
fix(wiki-compose): unblock auto-start after backend load races and failures#987cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Wiki Compose now resolves the execution backend from AI settings (same as Settings → AI) and starts automatically. The redundant backend selector and manual Start Compose step are removed. Co-authored-by: Akimasa Sugai <otomatty@users.noreply.github.com>
…ilures Always mark compose backend as resolved on the latest settings load so a concurrent AI_SETTINGS_CHANGED event cannot leave the page stuck idle. Reset the auto-start guard when session.start() rejects so transient API errors remain recoverable without a full page reload.
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.
Context
Deep review of PR #986 (
fix(wiki-compose): remove execution backend picker from compose flow) found two high-severity correctness issues in the new auto-start flow.Bugs fixed
1. Compose never auto-starts after concurrent settings reload
Impact: Fresh compose stays idle forever with no session and no manual Start button (removed in #986).
Root cause:
useInitialComposeBackendonly setisResolvedon the initialapplyFromSettings(true)call. IfAI_SETTINGS_CHANGEDfired while that load was in flight, the newer load usedmarkResolved: false. When the newer load won the generation race,isResolvednever flipped totrue, so auto-start never ran.Fix: Mark resolved on every successful latest-generation settings load.
2. Transient
session.start()failure is unrecoverableImpact: After a failed create/run (network blip, 5xx), the user sees an error but cannot retry without reloading the page.
Root cause:
autoStartRequestedRefstayedtrueafter a rejectedsession.start(), and the manual Start button was removed.Fix: Reset the ref in the auto-start effect's
.catch()so a later effect pass can retry when still idle.Validation
src/hooks/useInitialComposeBackend.test.ts(includes regression for settings-changed vs initial load race)bunx vitest run src/hooks/useInitialComposeBackend.test.ts— pass