Skip to content

Queue time in review --max (AGT-4313): a new src/cli/reviewQueueTime.ts starts the httpDispatcher queue-time collector o - #965

Merged
unohee merged 1 commit into
mainfrom
goal/62-queue-time-in-review-max-agt-4
Nov 21, 2026
Merged

unohee merged 1 commit into
mainfrom
goal/62-queue-time-in-review-max-agt-4

Conversation

@unohee

@unohee unohee commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Milestone of an auto-claude run.

Check: (test -d node_modules || npm ci --prefer-offline --no-audit --no-fund) && npm run lint && npm run typecheck && grep -rqF 'prints request queue p50 and p90 after the review --max fan-out' src && grep -rqF 'adds a Transport section with the queue time to the audit report' src && test "$(wc -l < src/cli/reviewMaxCommand.tsx)" -le "$(git show origin/main:src/cli/reviewMaxCommand.tsx | wc -l)" && npx vitest run src/cli/reviewQueueTime src/cli/reviewAudit src/cli/reviewMax src/adapters/httpDispatcher

Plan: .claude/auto-plan.md (local to the run).

…ut (AGT-4313)

- New src/cli/reviewQueueTime.ts.
  - beginReviewQueueTimeCapture() starts the httpDispatcher queue-time
    collector only when it is not already running. end() freezes the
    snapshot and stops the collector only when this capture started it.
  - captureQueueTime(fn) stops it in a finally.
  - formatQueueTimeLine prints 'Request queue time (undici
    create->sendHeaders): p50 X ms, p90 Y ms over N request(s)', or an
    explicit n/a line. It never prints 0 ms for a missing measurement.
- runReviewMaxCommand keeps the capture in a local value, never on
  AuditRun.
  - The capture spans the first reviewer fan-out and its usage-limit
    fallback merge.
  - It ends in a finally, before history dedupe, CodeQL, --fix, the quality
    harness and Linear filing, so their traffic is not counted.
  - The line is printed after the fan-out summary and passed to
    formatAuditReport, whose optional fourth argument adds a Transport
    section.
  - The exit code is unchanged, and reviewMaxCommand.tsx shrinks from 1075
    to 1071 lines.
- Tests:
  - unit tests for the format, the n/a case, collector ownership, an
    already-running collector and a throw;
  - the Transport section;
  - a non-dry-run wiring test against a loopback HTTP/1.1 server (3
    fan-out requests counted, 2 harness requests not), which fails when the
    wiring is reverted;
  - fallback and throw coverage.

Assumption: the figure is the process-wide in-process undici queue time of
the first fan-out. undici 6.x publishes sendHeaders only for HTTP/1.1, so h2
requests are not counted, as the collector already documents.
@unohee
unohee merged commit 1b4164b into main Nov 21, 2026
9 checks passed
@unohee
unohee deleted the goal/62-queue-time-in-review-max-agt-4 branch November 21, 2026 18:43
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