Skip to content

fix(wiki-compose): unblock auto-start after backend load races and failures#987

Draft
cursor[bot] wants to merge 2 commits into
developfrom
cursor/critical-correctness-bugs-c7f8
Draft

fix(wiki-compose): unblock auto-start after backend load races and failures#987
cursor[bot] wants to merge 2 commits into
developfrom
cursor/critical-correctness-bugs-c7f8

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 26, 2026

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: useInitialComposeBackend only set isResolved on the initial applyFromSettings(true) call. If AI_SETTINGS_CHANGED fired while that load was in flight, the newer load used markResolved: false. When the newer load won the generation race, isResolved never flipped to true, so auto-start never ran.

Fix: Mark resolved on every successful latest-generation settings load.

2. Transient session.start() failure is unrecoverable

Impact: After a failed create/run (network blip, 5xx), the user sees an error but cannot retry without reloading the page.

Root cause: autoStartRequestedRef stayed true after a rejected session.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

  • Added src/hooks/useInitialComposeBackend.test.ts (includes regression for settings-changed vs initial load race)
  • bunx vitest run src/hooks/useInitialComposeBackend.test.ts — pass
Open in Web View Automation 

cursoragent and others added 2 commits May 26, 2026 06:34
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.
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