Skip to content

spec(queen): key_failover.t27 -- a refused key moves the bee to the next key, then the next pool (Closes #9993) - #9998

Merged
gHashTag merged 1 commit into
masterfrom
spec/queen-key-failover-9993
Oct 17, 2026
Merged

gHashTag merged 1 commit into
masterfrom
spec/queen-key-failover-9993

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #9993. Part of #9976.

Why

The Railway logs of trios-bee-runner-2 for 2026-10-17 13:00-15:18Z show 17 of 93 bee turns ending after 0 steps.

  • At least 22 of those failures were z.ai 429 code 1305 (temporary overload), 16 of them in one minute at 14:08.
  • A bee is pinned to one key at dispatch (resolveWorkerProvider). The SDK retries that same key three times, and the turn closes as "cause undetermined" while 33 other keys in two pools stand by.

The card

  • error_kind(status, zai_code): classifies a refusal as transient, quota, auth or a bad request. The code wins over the status; the quota list is the runtime's closed list.
  • cooldown_seconds, key_closes: a transient refusal rests the key for 15 s, doubled per strike, at most 240 s. A quota or auth refusal closes the key for 30 min. 1302 and 1305 never close a key.
  • next_free: the next free key, wrapping, and never the key that just failed. The same rule picks the next pool. A list longer than a mask is refused, not truncated.
  • pool_overloaded: once 3 distinct keys of one pool answer 1305, the model is overloaded and the bee moves pools.
  • step: at most 8 attempts per turn, then provider_overloaded.
  • charges_issue: only a bad request charges the issue.

Evidence (Railway lab, master build)

  • t27c test-report: 9 tests, 112 runtime asserts, 0 FAIL, 0 vacuous, 4 invariants proved.
  • tri mutate spec --jobs 12 --timeout 240: 92 of 93 killed and 0 survived.
    • The first run had 10 survivors. They were fixed by removing dead guards, making next_free refuse an oversized list, and pinning the cap to base * 16.
    • The one hang is the k = k mutant's own endless loop.
  • Seal saved on the lab: .trinity/seals/queen_QueenKeyFailover.json; its spec hash matches this file.

Not here

The wiring into trios. That goes through t27b ts (#9994), which emits the card as TypeScript with function bodies. #7872 stays blocked by the own-language gate.

🤖 Generated with Claude Code

…ext key, then the next pool (Closes #9993)

A bee is pinned to one key at dispatch. On z.ai 429 code 1305 the SDK retried
that key three times and the turn closed after 0 steps: 17 of 93 turns on
trios-bee-runner-2 on 2026-10-17, while 33 other keys stood by.

The card classifies a refusal (error_kind), rests or closes the key
(cooldown_seconds, key_closes), picks the next free key and never the one that
failed (next_free), moves pools when three distinct keys said 1305
(pool_overloaded), bounds a turn at 8 attempts (step) and charges the issue
only for a bad request (charges_issue).

Railway lab: test-report 9/9, 112 runtime asserts, 0 vacuous, 4 invariants;
tri mutate spec 92/93 killed, 0 survived, 1 hang (the k = k mutant's own loop).
Seal saved there. Wiring into trios goes through t27b ts (#9994).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) October 17, 2026 15:50
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-17 15:50:51 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=e769ef021713 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit 6b8c363 into master Oct 17, 2026
27 of 29 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.

queen: bee key failover -- on 429/1305 the next attempt goes to another key, then the other pool, instead of retrying the same key until the bee dies

1 participant