Skip to content

FEA-1346: Bound bootstrap preflight#232

Open
peterulsteen wants to merge 3 commits into
mainfrom
fix/fea-1162-pending-exit
Open

FEA-1346: Bound bootstrap preflight#232
peterulsteen wants to merge 3 commits into
mainfrom
fix/fea-1162-pending-exit

Conversation

@peterulsteen
Copy link
Copy Markdown
Contributor

@peterulsteen peterulsteen commented May 22, 2026

Summary

  • Move auto-bootstrap into the launch-owned preflight so the Started event is emitted before bootstrap progress output.
  • Bound bootstrap execution with detached process-group cleanup, typed outcomes, and redacted stdout/stderr diagnostic tails.
  • Keep bootstrap failure/timeout non-terminal for primary and additional-repo launches while preserving terminal context-pack materialization failures.

Validation

  • pnpm --dir apps/desktop exec tsx --test test/symphony-bootstrap.test.ts test/symphony-loop-cloud-failures.test.ts test/symphony-loop-multi-repo-spawn.test.ts
  • pnpm --dir apps/desktop run typecheck
  • pnpm --dir apps/desktop run lint

Note: the first sandboxed focused test attempt failed on tsx IPC pipe creation with listen EPERM; the same command passed outside the sandbox.

@peterulsteen peterulsteen requested a review from a team May 22, 2026 21:00
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Comment thread apps/desktop/test/symphony-bootstrap.test.ts Outdated
Comment thread apps/desktop/test/symphony-bootstrap.test.ts Outdated
- Move bootstrap into the launch-owned preflight path.

- Bound bootstrap execution with typed outcomes and redacted diagnostics.

- Cover timeout, event ordering, and additional-repo continuation behavior.

Testing: Desktop typecheck, lint, and full test suite passed during finalization.

Risks: Bootstrap timeout handling touches process lifecycle behavior and is covered by focused gateway/process tests.
@peterulsteen peterulsteen force-pushed the fix/fea-1162-pending-exit branch from f291bd2 to 315828f Compare May 22, 2026 21:24
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

Compatibility Smoke Test Results ⚠️

Status: skipped
Electron SHA: f56a18b1fa25495ed67bf110300fd8f4fdfde54a
Symphony Alpha SHA (last-known-good): 24741ed9be45cc761195d7a7b6613bd30cdfce84
Note: Skipped because the stage GitHub App credentials are not configured for this workflow run.

View Actions run

- Move bootstrap plugin registry fixture into shared symphony test utilities.

- Reuse shared file and PID polling helpers across bootstrap tests.

Testing: Focused bootstrap/gateway/multi-repo tests, desktop typecheck, and lint passed.

Risks: Test-only refactor with no production behavior change.
if (
worktreeDir &&
(body.command === LoopCommand.Plan ||
body.command === LoopCommand.Execute ||
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.

This guard covers Plan/Execute/RequestChanges. On main, bootstrap also ran for GeneratePrd and RequestPrdChanges because it was embedded inside ensureWorktreeImpl (line 1637) and ensureLoopWorktreeMaterialized (line 1735), both of which setupPrdWorktree calls. Those functions no longer call runBootstrapIfNeeded, and this block skips PRD commands. Is the PRD bootstrap loss intentional? Probably fine since PRD generation doesn't use generated agents, but want to confirm it's not an oversight from extracting bootstrap out of the worktree helpers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid catch. This was an unintended regression from moving bootstrap ownership out of worktree materialization.

Addressed in f56a18b: GeneratePrd and RequestPrdChanges now use the launch-owned bootstrap preflight alongside Plan/Execute/RequestChanges, so PRD primary and additional repo worktrees keep the previous bootstrap behavior while still posting Started before bootstrap output.

I also added focused coverage in symphony-loop-multi-repo-spawn.test.ts for PRD commands with and without peers: 3 bootstrap-completed markers for primary + two peers, and 1 marker for primary-only.

Validation: focused bootstrap/gateway/multi-repo tests passed (38 tests), plus desktop typecheck and lint.

Copy link
Copy Markdown
Contributor

@thadeusb thadeusb left a comment

Choose a reason for hiding this comment

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

Clean restructure. The process-group kill, redaction, and non-terminal outcomes all look right. One question about PRD commands below.

- Include GeneratePrd and RequestPrdChanges in launch-owned bootstrap preflight.

- Cover PRD primary and additional repo bootstrap markers in multi-repo tests.

Testing: Focused bootstrap/gateway/multi-repo tests, desktop typecheck, and lint passed.

Risks: Restores prior PRD bootstrap behavior after moving bootstrap ownership out of worktree materialization.
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.

3 participants