Skip to content

Make workspace bootstrap failures non-blocking and feed errors to agent - #39

Merged
dkarzon merged 1 commit into
mainfrom
bootstrap-failures
Oct 7, 2026
Merged

dkarzon merged 1 commit into
mainfrom
bootstrap-failures

Conversation

@localagent-box

@localagent-box localagent-box Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Non-blocking bootstrap by default (workspace-bootstrap.ts): a failed setup/verify command no longer throws and blocks the agent start. The failure is recorded on the agent's bootstrap record (status: 'failed' with the command, exit code, output tail, and error) and the run continues.
  • setup.failOnError inverted to default false: the previous throw-on-failure behavior is now the explicit escape hatch — setting setup.failOnError: true still fails the whole agent start. verifyCommand failures follow the same semantics (recorded+non-blocking by default, fail-hard with failOnError: true; previously verify had no opt-out).
  • Error fed to the agent (opencode/runner.ts): formatBootstrapSummaryBlock now renders a ## Workspace bootstrap failed (host) block — failing command, exit code, error, and output tail — instructing the agent to diagnose and repair the environment as part of the task (without touching .localagent-box/ config). Wired into batch/interactive kickoff (session-orchestrator.ts) and the loop INITIAL_PLAN kickoff (loop-run-flow.ts). Skipped-bootstrap prompt behavior is unchanged.
  • Docs (docs/repo-config.md): setup.failOnError documented as default-false (record + agent fix attempt) vs true (fail-hard); setup script and verifyCommand sections updated; post-setup summary section now covers both the ready and failed blocks.

Test plan

  • Updated workspace-bootstrap.test.ts: failing setup.sh is recorded and non-blocking by default; throws only when environment.json sets failOnError: true; failing setup.command records status: 'failed', the error message, and output tail, and logs "continuing (the agent will attempt to fix it)".
  • Updated workspace-setup.test.ts to match the new non-blocking/verify semantics.
  • New formatBootstrapSummaryBlock failure-block tests in runner.test.ts covering the failed-bootstrap prompt block and skipped-state passthrough.
  • npx tsc --noEmit clean; full suite green (136 tests, 0 failures).

Created from a Local Agent Box session.

Branch: bootstrap-failures
Base: main
Commit: 2a9b1f9
Session: 98d7dc39b353
Model: glm-5.3-flash:cloud

@dkarzon
dkarzon marked this pull request as ready for review October 7, 2026 21:11
@dkarzon
dkarzon merged commit bf59af5 into main Oct 7, 2026
1 check passed
@dkarzon
dkarzon deleted the bootstrap-failures branch October 7, 2026 21:16
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