Skip to content

queen(actors): the reviewer's worker pool follows its backlog and its lanes - reviewer_sizing.t27, behind TRIOS_QUEEN_REVIEWER_ADAPTIVE #1715

Closed

Description

@gHashTag

Part of #1712 (item 3: reviewer concurrency read from the measured backlog).

The actor reviewer starts a fixed REVIEWER_CONCURRENCY = 4 workers (queen-review-actors.ts). gHashTag/t27#8212 already says how many rows may be reviewed at once: reviewer_concurrency(keys, lanes_per_key, free_mb, mb_per_review, waiting), capped at 16. gHashTag/t27#8273 adds reviewer_sizing.t27, which covers what the runtime feeds that rule and how it grows and shrinks the pool.

What

  • The reviewer domain sizes its worker pool from the card, behind TRIOS_QUEEN_REVIEWER_ADAPTIVE=1 (default off).
    • It re-reads the lanes and memory on every wake.
    • It grows by starting transient workers under a dynamic supervisor (start_answer).
    • It shrinks by stopping idle workers once worker_retires says so.
  • The lanes are counted by the review sweep's own arithmetic. Each key is capped at what its provider is measured to carry: two requests a key on z.ai (key_free_lanes).
  • Tests: the pool follows the card for backlogs of 0, small and huge, and never exceeds the lanes.
  • Benchmark: fixed 4 against adaptive on the same seeded input as queen-actors-bench.test.ts.
    • Cases: quiet, steady, overload at 120/h, and a burst.
    • Measures: throughput/h, p95 wait, the most provider calls at once, and backlog drain time.

Boundary

  • trios/agent-server/specs/queen/reviewer_sizing.t27, .wasm, specs/PIN
  • apps/server/src/api/services/queen-review-actors.ts, queen-actors-dynamic.ts (new), queen-reviewer-sizing-card.gen.js (new), queen-review-loop.ts, queen-tick.ts (the capacity reader and the start call)
  • apps/server/tests/api/queen-review-adaptive.test.ts (new), queen-actors-bench.test.ts

Acceptance criteria

Activity

  1. gHashTag commented on Oct 10, 2026

    @gHashTag
    OwnerAuthor

    Shipped: #1716 merged into actors-next, which went into queen as 56c5df7 via #1730 (2026-10-10 13:38Z). Every new behaviour is behind a flag that is off. Closes fires only on the default branch main, so this is closed by hand. Ledger: #1729.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions