Skip to content

Fix CI: the budget timer never throws after its database is closed; Docker builds without git - #76

Merged
danielehrhardt merged 2 commits into
mainfrom
fix/runner-binary
Oct 4, 2026
Merged

danielehrhardt merged 2 commits into
mainfrom
fix/runner-binary

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

Main's "Typecheck, test, build" job has failed since #58 (spend and budgets). The failures are the three the godmode binary runner tests, each with database not opened thrown from budgets.ts → amountsNow → getSettings.

Cause: budgetsMayHaveChanged() debounces with a 250 ms setTimeout whose body was outside the try/catch. When an earlier test file changed an agent and closed its database within those 250 ms, the timer fired afterwards and threw. Bun then failed whatever test was running. It only shows up in CI's file order on Linux; locally the suite passes in both orders.

Fix: the whole timer body is now in the try/catch (it logs a warning), and the timer is unref'd so it never keeps a process alive.

Checks:

  • Core: full suite 1418 pass, 0 fail.
  • The budget, spend and remote-cli tests pass (32).
  • The other failing CI jobs aren't from this: Docker fails on git missing in the build stage (older than this), and the Cloud relay test is a timing flake in another package.

The debounced check after a budget change ran outside its try/catch: in a test that closed its database (or while
shutting down) it threw "database not opened" and failed whatever test was running then (on Linux CI: the three
`godmode binary` runner tests). It is caught now, and the timer no longer keeps the process alive.
Bun.spawnSync throws when git isn't installed (the image's build stage), so the stamp's own fallback to "unknown"
was never reached and the binary build failed.
@danielehrhardt danielehrhardt changed the title Fix CI: the budget timer never throws after its database is closed Fix CI: the budget timer never throws after its database is closed; Docker builds without git Oct 4, 2026
@danielehrhardt
danielehrhardt merged commit d7fe29b into main Oct 4, 2026
7 of 8 checks passed
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