Skip to content

feat(queen): a runner bee that left no bundle is judged empty after the card's grace, behind TRIOS_QUEEN_NO_BUNDLE_EMPTY (Closes #1886) - #2044

Merged
dmitrii-f-t27 merged 1 commit into
queenfrom
dmitrii-f-t27/queen-no-bundle-empty
Oct 18, 2026
Merged

dmitrii-f-t27 merged 1 commit into
queenfrom
dmitrii-f-t27/queen-no-bundle-empty

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Collaborator

What this does

A runner bee that commits nothing leaves no bundle, so the reviewer's diff fails and the row answers wait for up to six hours while its issue stays claimed. This adds reviewer.t27's no_bundle_is_empty and wires it into the review sweep: with TRIOS_QUEEN_NO_BUNDLE_EMPTY=on, a finished runner row with no stored bundle is judged empty after a 10-minute grace, exactly as a container bee that committed nothing already is. A bundle that arrives inside the grace is still judged on its branch.

The flag is off by default: without it the code asks nothing new and every verdict is byte-identical to today's.

Provenance

This is a re-issue of #1891 by @gHashTag (original commit 216a6dc072), rebased onto today's queen so the dmitrii-f-t27 lane can carry it. The original commit did not apply cleanly: queen gained the region-merge check in the meantime. Both features are additive and are kept:

  • queen-reviewer.ts and queen-tick.ts now carry both regionCheck (regions) and runnerBundleFacts (no-bundle);
  • specs/PIN keeps today's holds hashes and the new reviewer hashes;
  • queen-tick.ts gained the missing GC_RV_SEND_BACK / GC_RV_WAIT import that today's queen uses but does not import β€” without it bun run typecheck fails on queen itself.

The original author is credited in the commit trailer.

Verification

  • biome ci . β€” 0 errors (120 pre-existing warnings).
  • bun run --cwd apps/server typecheck β€” exit 0.
  • bun test apps/server/tests/api/queen-no-bundle.test.ts apps/server/tests/api/queen-no-bundle-bench.test.ts β€” 17 pass, 0 fail, 1032 expect() calls.
  • bun run --cwd apps/server test:api β€” 2220 pass, 72 skip, 18 fail; all 18 are environment-bound on this Mac (missing age-keygen, failing local git clone in vault/salvage fixtures), none touch the changed files. CI is the authority here.

Live context

/queen/status at 2026-10-18 02:59Z: capacity 70, active 12, unreviewed 328, reviewedLastHour 3, finishedLastHour 72. Measured 2026-10-11: 425 of 480 reviewer visits answered wait for a missing runner bundle. The six-to-seven-minute review rounds are also what makes the HUD print round stale.

Refs: gHashTag/t27#9021, gHashTag/t27#9069, #1886, #1891.

Dmitrii Fedorov (@dmitrii-f-t27)

…he card's grace, behind TRIOS_QUEEN_NO_BUNDLE_EMPTY (Closes #1886)

The review now asks reviewer.t27 no_bundle_is_empty (gHashTag/t27#9069,
spec PR t27#9095) where it used to write `wait` for "the diff of queen-N
could not be read". With TRIOS_QUEEN_NO_BUNDLE_EMPTY=on, a finished runner
row has no stored bundle and finished NO_BUNDLE_GRACE_MINUTES (10) or more
ago. Its branch is then read as a branch with no commit, so the row is judged
exactly as a container bee that committed nothing: `empty`, or the existing
dead-letter escalate, and its issue is free after the retry floor. Inside the
grace it still waits. The flag is off by default; off, the review asks
nothing new and writes what it wrote before.

- reviewer.t27 re-vendored byte-identical from the t27 PR head; reviewer.wasm
  rebuilt with every fn exported, no_bundle_is_empty included (two builds,
  one hash); PIN and the gen-ts constants updated.
- queen-review-loop.ts: the card call and the flag, next to the reviewer
  card's other calls.
- queen-export.ts runnerBundleFacts: whether queen_bundle holds the issue's
  bundle and the minutes since this attempt finished, in one statement.
- Tests: queen-no-bundle.test.ts (flag off byte for byte, inside and past
  the grace, a container row, a stored bundle, a bundle 40 s late) and
  queen-no-bundle-bench.test.ts, which replays the recorded 07:10-10:31Z
  window through the real sweep, flag off against flag on.

Part of gHashTag/t27#9021.

Re-issued on the dmitrii-f-t27 lane from #1891 (original commit 216a6dc, author @gHashTag).

Co-authored-by: Dmitrii Vasilev <raoffonom@icloud.com>
@tri-claw

tri-claw Bot commented Oct 18, 2026

Copy link
Copy Markdown

Summary by t27-bees

Checked by the t27 compiler

t27c parse, parse-complete and typecheck on each changed .t27 file at c0e3103. Nothing was generated, built or run. A pass means the file is well formed, not that it is right.

  • trios/agent-server/specs/queen/reviewer.t27: parses and typechecks.

Read by the model

This PR adds a feature flag TRIOS_QUEEN_NO_BUNDLE_EMPTY (off by default) that makes the reviewer judge a finished runner row as empty when: (1) the diff cannot be read, (2) the runner stored no bundle for that issue, and (3) 10 minutes have passed since the turn ended. This matches how container bees that commit nothing are handled. The change wires a new runnerBundleFacts query and the no_bundle_is_empty Wasm function into the review sweep.

Worth a look

  • trios/agent-server/apps/server/src/api/routes/queen-export.ts:337 β€” The runnerBundleFacts query checks EXISTS (SELECT 1 FROM queen_bundle b WHERE b.issue = d.issue) without filtering by conversation_id. If an issue has multiple attempts, a previous attempt's bundle will make a new attempt appear to have stored: true, preventing it from being judged empty even when its own bee committed nothing. The bundle check should likely include AND b.conversation_id = d.conversation_id (assuming queen_bundle has that column).

  • trios/agent-server/apps/server/src/api/routes/queen-export.ts:351 β€” stored: row.stored !== false treats any non-false value (including null) as a stored bundle. The EXISTS subquery returns a boolean, so this is probably fine, but the defensive comment "an unreadable answer must not make finished work look empty" suggests concern about null; if the column is nullable, EXISTS still returns true/false.

  • trios/agent-server/apps/server/src/api/services/queen-tick.ts:3256 β€” runnerLeftNoBundle returns false (continue waiting) when runnerBundleFacts returns null (no finished row for the conversation or unreadable finished_at). This is safe, but means a row whose dispatch record was cleaned up or corrupted will wait indefinitely rather than being judged.

  • trios/agent-server/apps/server/src/api/services/queen-tick.ts:3455 β€” When runnerLeftNoBundle returns true, the code overwrites diff = { ok: true, files: [] }. This makes the review proceed as if the diff read succeeded with zero files, leading to an empty verdict. The logic is sound, but it silently converts a "diff unreadable" error into a successful empty diff β€” ensure this is the intended semantics (the tests confirm it is).

  • trios/agent-server/specs/PIN:23 β€” The reviewer.t27 and reviewer.wasm hashes are updated. The new Wasm exports no_bundle_is_empty; the generated TS declarations in queen-reviewer-card.gen.ts include it. The PIN update looks correct and matches the compiler output shown.


Read: 11 files, +1394 -6, the whole diff up to 60000 characters (the rest was not read). Head c0e3103. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

@github-actions

Copy link
Copy Markdown

βœ… Tests passed β€” 3915/3988

Suite Passed Failed Skipped
βœ… agent 429/429 0 0
βœ… build 9/9 0 0
βœ… cdp-protocol 5/5 0 0
βœ… eval 93/93 0 0
βœ… server-agent 280/280 0 0
βœ… server-api 2273/2345 0 72
βœ… server-browser 6/6 0 0
βœ… server-integration 10/11 0 1
βœ… server-lib 279/279 0 0
βœ… server-pglive 166/166 0 0
βœ… server-root 68/68 0 0
βœ… server-sim 8/8 0 0
βœ… server-skills 31/31 0 0
βœ… server-tools 244/244 0 0
βœ… shared 14/14 0 0

View workflow run

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