Skip to content

fix: bound the calls around a turn, and build packages in dependency order - #109

Merged
filipeforattini merged 1 commit into
mainfrom
fix/build-order
Sep 4, 2026
Merged

fix: bound the calls around a turn, and build packages in dependency order#109
filipeforattini merged 1 commit into
mainfrom
fix/build-order

Conversation

@filipeforattini

@filipeforattini filipeforattini commented Sep 4, 2026

Copy link
Copy Markdown

Two gaps left over from the five tranches, both found by the CI work in #108.

The calls around a turn had no bound

The inactivity watchdog from #103 reads a step handle. Two model calls have none:

  • naming the session runs inside the turn loop before the step that produces the answer, so a
    small model that stops answering holds up the work the user actually asked for;
  • compacting creates a processor of its own, which is not the handle the watchdog watches.

Both now give up and say so — naming after two minutes, compacting after ten, since compacting
reads the whole conversation back. Neither failure is the turn's failure: a session keeps its
default name, and a compaction that did not happen is reported as itself.
experimental.aux_timeout overrides both, false removes the bound.

Builds ran in arbitrary order

turbo.json declared "build": { "dependsOn": [] }, which does not mean "no extra dependencies" —
it replaces the topological default. The CLI build bundles the app, which imports sources the
SDK build generates, so with enough tasks in flight the two raced and the CLI build read
gen/types.gen.js before it existed. That is the failure that killed the first attempt at #108.

Verification

  • Integration test seen failing first (with the bound removed the turn never finished) and passing
    after: a provider that never answers the naming request no longer delays the answer, and the
    session keeps its default name. Needed a new hangTitles control on the fake provider.
  • Unit tests for the policy, including the default ordering and disabling.
  • turbo build --dry confirms @reddb-io/redcode#build now waits for all eleven package builds it
    actually needs, sdk among them.
  • bun typecheck across all 31 packages; packages/redcode session suite 444 pass, with three
    failures reproduced on unmodified sources on this machine (3 s and 60 s test timeouts under local
    load).

https://claude.ai/code/session_01U29Yk1UscZJ5ZVBXV1Sn8b


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…order

Naming a session and compacting the conversation call a provider from outside
the step loop, where the turn watchdog cannot see them: a provider that stops
answering there holds the turn open with nothing on screen.

The build task declared `dependsOn: []`, which disables topological ordering.
The CLI build bundles the app, which imports sources the SDK build generates,
so the two raced and the loser read a file that did not exist yet. It surfaced
the moment CI started running enough tasks to lose that race.

Claude-Session: https://claude.ai/code/session_01U29Yk1UscZJ5ZVBXV1Sn8b
@filipeforattini
filipeforattini merged commit 78d1b03 into main Sep 4, 2026
10 of 11 checks passed
@filipeforattini
filipeforattini deleted the fix/build-order branch September 4, 2026 14:06
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