Skip to content

Fix bootstrap to respect BASE_WORKER_CAP when spawning initial workers - #319

Merged
joryirving merged 1 commit into
mainfrom
recover/issue-310
Aug 7, 2026
Merged

Fix bootstrap to respect BASE_WORKER_CAP when spawning initial workers#319
joryirving merged 1 commit into
mainfrom
recover/issue-310

Conversation

@joryirving

Copy link
Copy Markdown
Collaborator

Summary

  • Recovers completed coder work that was stranded on an unreviewable branch.

Refs #310

Provenance

The coder finished this successfully (verdict GO) on foreman/wl-misospace-windowstead-0/issue-0, commit 83d912a92. The review never ran: foreman's litellm key was not scoped to the reviewer alias, so every review request was rejected and the task ended INCOMPLETE, and no PR was opened.

That branch name is derived from issue number 0, which is a bug — it is shared by every third-attempt retry in this repo, so the commit was one retry away from being force-pushed over. Cherry-picked onto a non-foreman/* branch to preserve it.

Not using a closing keyword: foreman may still redo this issue, and it owns the issue lifecycle.

Verification

  • Cherry-pick applied cleanly onto main; no conflicts.
  • No manual edits — the diff is the original commit.

The bootstrap_state() loop iterated over Constants.WORKER_NAMES.size() (10),
spawning all workers regardless of the configured BASE_WORKER_CAP (2). Changed
the loop bound to Constants.BASE_WORKER_CAP so only 2 workers are spawned at
game start, matching the worker cap and the e2e test expectations.

Fixes #0

Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
@joryirving joryirving self-assigned this Aug 7, 2026

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Automated Review

Full PR review.

Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — escalated (fast_low_confidence)

Recommendation: Approve

This is a clean, minimal fix that corrects a bug where bootstrap_state() was spawning 10 workers instead of the intended 2 (BASE_WORKER_CAP) on new game start.

Change Analysis

File: scripts/main.gd

Before: for i in Constants.WORKER_NAMES.size(): — loops 0–9, spawning all 10 workers
After: for i in Constants.BASE_WORKER_CAP: — loops 0–1, spawning only the 2 free workers

This fix ensures bootstrap respects the documented game constant. The SPEC.md explicitly states "The first 2 workers are free (BASE_WORKER_CAP = 2)" and the BASE_WORKER_CAP = 2 constant in constants.gd confirms the intended value.

The worker names remain correct — workers 0 and 1 are "Jun" and "Mara" in both cases, so no name-access issues arise from this fix.

Standards Compliance

No repository conventions are relevant to this mechanical constant correction. The change:

  • Uses existing constants correctly
  • Leaves no test coverage gaps (CI passed all suites)
  • Does not touch save/version migration paths
  • Aligns with documented game design (2 free workers)

CI Verification

All six CI checks passed on the PR commit:

  • ✅ Export validation (Windows)
  • ✅ Script test suite
  • ✅ Export validation (Linux)
  • ✅ Headless smoke test
  • ✅ Export validation (macOS)
  • ✅ macOS validation

Conclusion

This is a straightforward, correct bug fix that aligns bootstrap behavior with the game's documented constants and design. No blockers.

@joryirving
joryirving merged commit 35a539a into main Aug 7, 2026
7 checks passed
@joryirving
joryirving deleted the recover/issue-310 branch August 7, 2026 15:11
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.

2 participants