Skip to content

test: run the timing tests only in the integrator's checks - #1366

Merged
amiddavid merged 2 commits into
mainfrom
test/timing-switch
Nov 24, 2026
Merged

amiddavid merged 2 commits into
mainfrom
test/timing-switch

Conversation

@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

Timing tests run only with CG_TIMING_TESTS=1. scripts/dev/local-tests.sh skips them unless the PR adds or changes one. The integrator's heavy CI and Part A run them.

Owner decision (David Amid, 2026-11-24, integrator session): "put the switch, but dont run them on local-tests.sh, only run them by integrator. if a PR contributes a new timing test then it runs the timing tests as well".

Why

  • PR-owner sessions run local-tests.sh on one shared laptop. It has 10 CPUs. The load average is 136 to 390.
  • Timing tests fail under that load. Each one passed alone.
  • Flaky so far: TestMetricsCallLatency, TestRegistrationRateLimitedPerIP, TestMetricsDoNotChangeResponseTime, and 5 OpenCode plugin tests at load about 390.

What changed

  • testutil.RequireTiming(t) skips unless CG_TIMING_TESTS=1. testutil.TimingEnabled() guards only the time check of a test that checks more.
  • ci.yaml: build-test and record set CG_TIMING_TESTS: "1". part-a.sh sets it by default (and writes a timing-tests line in its summary).
  • local-tests.sh sets it to 1 only when scripts/dev/timing-tests-needed.sh says run: a changed line holds RequireTiming, TimingEnabled or timingOnly, or a changed test file holds one. The comment ends with timing tests: run (this PR adds or changes one) or timing tests: skipped (integrator runs them).
  • Extra fix, same script: local-tests.sh now judges a FAILED step by its rerun log, as the flaky rule of part-a.sh does. A test that fails only on the 1st run is listed as flaky. Real case: refactor(agent): one client.Identify entry point; label OpenCode and Pi #1331 at d4cd32e. Its 1st race-rest run failed 3 tests, the rerun failed only the known TestNoHooksKeepsTheBinaryDefaults, and the result was fail. It is now pass with a flaky note. New fixture cases in local-tests_test.sh fail on the old script.
  • CLAUDE.md and RELEASING.md explain the rule.

Gated Go tests (whole test skips):

  1. TestMetricsDoNotChangeResponseTime: p50 and p99 of request time against a ceiling.
  2. TestMetricsCallLatency: added latency per call against a ceiling.
  3. TestDashboardAddsNoRequestLatencyWithContentCapture: median spend budget, 30 ms.
  4. TestDashboardCaptureAddsNoRequestLatencyAtMaxContent: median spend budget, 25 ms.
  5. TestCaptureOverheadIsNegligible: per-request capture cost budget.
  6. TestOverviewStaysFastOnALargeWindow: query time bound.
  7. TestOverviewSessionScopedStaysFastWithManyOtherSessions: query time bound.
  8. TestStatuslineFinishesWithinItsBudgetOnASlowProxy: render time against floor plus allowance.
  9. TestRegistrationRateLimitedPerIP: races the per-minute rate limit under load.
  10. TestSignInAttemptsAreRateLimited: same race (argon2 cost per attempt).
  11. TestCheckHookFinishesInsideItsOwnTimeout: hook must finish inside half its timeout.
  12. TestStartHookBudgetsOnWallClockNotIterations: same, for SessionStart.
  13. TestRefusingCollectorDoesNotBlockRecording: 100,000 records in under 1 s.
  14. TestHangingCollectorDoesNotBlockRecording: same.
  15. TestASilentStreamingRequestIsResentOnANewConnection: resend in about 150 ms, under 2 s.
  16. TestRegistrationBucketIsPerIPv6Prefix: the unit part still runs. The end-to-end part (rate limit race) skips.

Go tests where only the time check is guarded (the rest still runs): TestStatuslineGoldenOutput, TestStatuslineGoldenMoney, TestStatuslineAgentNamesAreBounded, TestStatuslineGoldenWeeklyTip, TestStatuslineMoneyShowsWhenCachestateIsSlowerThanTheRender, TestStatuslineReportsLoadingNotDownOnATimeout, the shutdown test in proxyapp/shutdown_test.go (2 s), and TestLiteLLMConcurrentSingleFlight (100 ms).

OpenCode node tests (4, via timingOnly in helpers.mjs):

  1. "a restart that never gets healthy waits about 5 s once ...": asserts waits of 4.5 to 6 s.
  2. "a restarted binary that exits at once fails the restart at once ...": asserts waits under 3 s and 1 s.
  3. "a restart that is healthy before the 5 s cap ...": asserts under 5 s.
  4. "startProxy fails fast when its own child exits ...": asserts under 8 s.

The log-check test at the end of failopen.test.mjs expects the timing lines only when the switch is on.

Not gated: tests with a 10 s or 15 s bound that is only a safety net, tests with a fake clock, and tests that skip themselves when "inconclusive".

How it was tested

macOS, Go 1.27.4. The load average was 230 to 325 during the run, so a result may be slower than on a calm machine.

  • go vet ./..., CGO_ENABLED=0 go build ./...: pass.
  • scripts/dev/local-tests_test.sh: all cases pass, including the new timing and rerun cases.
  • node --test opencode-plugin/test/*.test.mjs: without the variable 116 pass, 4 skip, 0 fail. With CG_TIMING_TESTS=1: 120 pass.
  • timing-tests-needed.sh: this PR gives run; a docs-only diff gives skip.
  • Go package runs without and with the variable: see the comment below.

Behavior change

None for users. Tests and test scripts only.

Data dependence

None.

Add a switch for tests whose result depends on wall-clock time or machine load.
They run only with CG_TIMING_TESTS=1.

- internal/testutil: RequireTiming(t) skips unless the switch is on. TimingEnabled() guards
  only the time check of a test that checks more than time.
- 16 Go tests and 4 OpenCode node tests use the switch. 8 more Go tests guard only
  their elapsed-time assertion.
- ci.yaml: build-test and record set CG_TIMING_TESTS=1. part-a.sh does too, by default.
- local-tests.sh sets it only when the PR adds or changes a timing test
  (scripts/dev/timing-tests-needed.sh decides from the diff). The comment says which.
- local-tests.sh also judges a FAILED step by its rerun log, as part-a.sh's flaky rule does.
- CLAUDE.md and RELEASING.md say so.

Owner decision (David Amid, 2026-11-24): "put the switch, but dont run them on
local-tests.sh, only run them by integrator. if a PR contributes a new timing test then
it runs the timing tests as well".

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Go test results, macOS, Go 1.27.4. The load average was 325 to 365, not calm.

  • Without CG_TIMING_TESTS: the 16 gated Go tests show SKIP. The packages proxy, dash, metricspush, context-guru-plugin pass in the targeted run. go test ./proxyapp/ fails only on TestNoHooksKeepsTheBinaryDefaults, a known failure on an unchanged origin/main.
  • With CG_TIMING_TESTS=1: all 16 gated tests PASS, also at this load (for example TestMetricsDoNotChangeResponseTime 15.7 s, TestCheckHookFinishesInsideItsOwnTimeout 14.6 s).
  • local-tests.sh 1366 runs next. This PR changes a timing test, so it sets CG_TIMING_TESTS=1 for that run.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 offload-review skill, @amiddavid's session fresh 2 of 2 1 of 2 184f46a42377 blocking

Verdict: blocking

Findings

  1. opencode-plugin/test/helpers.mjs:13 — the node timing tests run nowhere after this PR
    • What fails: 4 node tests are gated behind CG_TIMING_TESTS=1 (3 in failopen.test.mjs, 1 in
      review1.test.mjs), but no runner sets the variable for them. The only runner of these files is
      .github/workflows/opencode-plugin.yaml:35 (node --test opencode-plugin/test/*.test.mjs), and
      that workflow does not set CG_TIMING_TESTS. The runners that do set it run Go only:
      ci.yaml jobs build-test and record (make cover, go test), and part-a.sh (vet, builds,
      go test -race steps — no node --test step). So the 4 tests never execute, on a PR or on
      main.
    • Proof: grep -rln CG_TIMING_TESTS over .github/, scripts/, opencode-plugin/, Makefile
      lists only ci.yaml, part-a.sh, timing-tests-needed.sh, local-tests.sh and the two test
      files themselves. grep "node --test" .github/workflows/*.yaml hits only
      opencode-plugin.yaml. Before this PR those tests ran on every opencode-plugin/** PR push.
      The lost tests are fail-open behavior tests, not only timing bounds: "a restart that never gets
      healthy waits about 5 s once, then goes direct" and "a restarted binary that exits at once fails
      the restart at once" (failopen.test.mjs:339,370), "a restart that is healthy before the 5 s cap
      sends the next request to the proxy" (failopen.test.mjs:479), "startProxy fails fast when its
      own child exits" (review1.test.mjs:159).
    • Side effect of the same gap: timing-tests-needed.sh treats a change to a .test.mjs file as
      "run", so local-tests.sh posts "timing tests: run (this PR adds or changes one)" for such a PR
      — while the changed node tests still never ran. CLAUDE.md and RELEASING.md say "The integrator
      runs them in heavy CI and in Part A". That is true for the Go tests only.
    • Fix: run them somewhere that sets the switch. Either set CG_TIMING_TESTS: "1" in
      opencode-plugin.yaml (for main pushes at least), or add a node --test step to part-a.sh
      under the existing CG_TIMING_TESTS default. Then the docs claim holds for both languages.

Non-blocking

  • scripts/dev/local-tests.sh:97-101: when a rerun log exists but holds no --- FAIL: lines (a
    panic or a build failure), flaky1 still lists every 1st-run failure and the note says "passed on
    the rerun". The step result is still fail, so only the note text is wrong.
  • scripts/dev/timing-tests-needed.sh:16: the first check greps the whole diff, so a docs line or a
    script comment that names RequireTiming also answers "run". The error direction is safe (it
    never skips when it should run). No change needed.
  • scripts/dev/local-tests.sh:70: with --reuse of a summary that says timing-tests 0 for a PR
    that needs them, the comment says only "skipped (integrator runs them)". The normal path cannot
    produce this (the script sets the variable itself before the run), so it stays a note.

What I checked

  • The full diff 1d20435f..HEAD and the code around each hunk: internal/testutil/testutil.go and
    its tests, every gated Go test (plugin, dash, proxy, metricspush, litellm, shutdown), the node
    helpers and both changed .test.mjs files, ci.yaml, part-a.sh, local-tests.sh,
    local-tests_test.sh, timing-tests-needed.sh, CLAUDE.md and RELEASING.md.
  • Each gated test asserts a wall-clock bound or races a rate limit, which matches the new CLAUDE.md
    rule. Tests that only check output keep running; only their bound is guarded (TimingEnabled() &&).
    Tests with a fake clock or a safety-net timeout stay ungated. I found no wrongly gated test.
  • failopen.test.mjs's last aggregate test: with the switch off it expects only
    /refused the connection/, and the always-running test at line 97 produces that line
    (opencode-plugin/index.js:988). No aggregate test in review1.test.mjs depends on the gated one.
  • timing-tests-needed.sh: the ^[+-][^+-] filter excludes the +++/--- headers; deleted and
    renamed timing tests are caught (removed lines match, or the file at head matches); a missing base
    answers "run" (fail toward running). The local-tests_test.sh fixtures cover skip and run paths.
  • local-tests.sh rerun logic against part-a.sh: $name.rerun.log exists exactly when the 1st run
    failed, so the rerun-decides rule matches the writer. set -uo pipefail without -e, so the
    [ -f ... ] && line is safe. notes is initialized before the loop.
  • ci.yaml: build-test and record run only on workflow_dispatch and v* tags, so no PR run
    turns the timing tests on. context-guru-plugin is in the root module, so the
    internal/testutil import is legal; all new imports are in _test.go files.
  • Fail-open, data dependence, binaries: no proxy or library behavior changes; no data-dependence row
    needed; no binaries added.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 offload-review skill, @amiddavid's session fresh 1 of 2 1 of 2 184f46a42377 blocking

Verdict: blocking

Findings

  1. opencode-plugin/test/helpers.mjs:113 — the 4 gated node tests run nowhere after this PR
    • What fails: a PR that breaks the plugin's restart and fail-open paths passes every check. The tests that would catch it never execute.
    • Proof: timingOnly skips a test unless CG_TIMING_TESTS=1. The only runner of opencode-plugin/test/*.test.mjs is .github/workflows/opencode-plugin.yaml:35, and that workflow sets no CG_TIMING_TESTS (checked the whole file). The checks that do set it run Go only: ci.yaml build-test runs make cover (go test -race ./...), record runs go test, and every step in scripts/release/part-a.sh is a go command. So "a restart that never gets healthy waits about 5 s once" and "startProxy fails fast when its own child exits" (fail-open properties) execute in no CI job and no laptop run. Before this PR they ran on every PR that touched opencode-plugin/**. Two side effects: the CLAUDE.md and RELEASING.md claim "The integrator runs them in heavy CI and in Part A" is false for node tests, and timing-tests-needed.sh counts *.test.mjs and helpers.mjs as triggers, so a plugin-only PR gets timing tests: run (this PR adds or changes one) in the posted comment while no node timing test ran.
    • Fix: set CG_TIMING_TESTS: "1" in the opencode-plugin workflow's job env (it runs on GitHub runners, not the loaded laptop, and these tests passed there before this PR), or add a node step to the integrator's checks. Then the docs claim holds.

Non-blocking

  • scripts/dev/timing-tests-needed.sh:18 — a changed line whose content starts with + or - (for example a markdown bullet +- ...) is dropped by the ^[+-][^+-] filter, and the file-scan fallback covers only test files. Cosmetic: a docs-only change wants skip anyway.
  • scripts/dev/timing-tests-needed.sh:14 — with an explicit <base> that git cannot resolve, both git diff calls fail silently and the script prints skip, which contradicts its own header ("If the base cannot be found, print run"). Only the no-arg merge-base path is guarded. No current caller passes a bad base.
  • Gating is inconsistent at the margin: failopen.test.mjs:413 ("a restart whose binary is missing returns at once") asserts waited < 1000 and stays ungated, while the gated "exits at once" test allows 3000 ms. proxy/tooldefer_test.go:491 and proxy/tooldefer_866_test.go:233 assert 1 s bounds and stay ungated. The PR description names only 10–15 s safety nets as "not gated".

What I checked

  • The full diff, commit by commit (one commit), and the code around each change.
  • internal/testutil: TimingEnabled and RequireTiming logic, and both new tests in testutil_test.go. Traced the ran flag through skip and non-skip paths: both assertions are sound. t.Setenv forces the switch inside each subtest, so the tests hold also when the integrator runs with CG_TIMING_TESTS=1.
  • Every gated Go test: each one runs in a step of part-a.sh (race-proxy, race-dash, race-plugin, race-rest) and in build-test/record with the env set. The mid-test skip in TestRegistrationBucketIsPerIPv6Prefix keeps the pure regBucket unit part running. The TimingEnabled-guarded time checks match the CLAUDE.md rule (guard only the time check).
  • failopen.test.mjs final log test: index.js:988 writes "proxy refused the connection" from the non-gated test at line 97, so the reduced pattern list holds with the switch off. review1.test.mjs has no aggregate test that depends on its gated test.
  • local-tests.sh rerun logic: traced it against part-a.sh's step() (a .rerun.log exists only when the first run failed; FAILED means both runs failed). The rerun-decides rule, the flaky1 note, and the known-failure fallthrough all behave as the fixture tests in local-tests_test.sh claim. Both comm inputs are sorted.
  • timing-tests-needed.sh: traced the four fixture cases in local-tests_test.sh by hand (base→docs skip, docs→plain skip, plain→timingfile run, timingfile→newtiming run). Deleted test files are caught by the changed-lines grep.
  • part-a.sh summary format: commit stays line 1, the new timing-tests line is ignored by the step loop and by the sha check.
  • Where each suite runs: ci.yaml (all jobs), opencode-plugin.yaml, heavy-ci.sh, Makefile (cover), part-a.sh. This is what proves finding 1.
  • The PR description names the extra local-tests.sh rerun fix and the owner decision for the timing switch. No user-facing behavior change; no data dependence; no binaries.

The 4 node tests that timingOnly gates ran nowhere: the opencode-plugin workflow does not
set CG_TIMING_TESTS, and the heavy jobs and part-a.sh ran Go only.

- part-a.sh: new step node-timing runs the node tests with CG_TIMING_TESTS=1. With
  CG_TIMING_TESTS=0 it writes a "skip" line instead.
- ci.yaml: build-test (heavy, dispatch and tags only) installs node 22 and runs the node tests.
  It sets CG_TIMING_TESTS=1 already.
- local-tests.sh: a "skip" step is a row that says the timing tests are off. A step line is
  still required for every step, also node-timing. The step list now allows indented steps.
- CLAUDE.md and RELEASING.md: Go and node timing tests run in the integrator's checks.
- local-tests_test.sh: fixtures for the skipped, failed and missing node-timing step.

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Fixed in 6f5950c: the 4 node timing tests now run in Part A (step node-timing) and in the heavy build-test job (node 22). local-tests.sh shows the step as skipped when the timing tests are off. Docs match. New fixtures cover the step.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 offload-review skill, @amiddavid's session resumed 1 of 2 2 of 2 6f5950c8fd45 approve

Verdict: approve

Findings

None.

Earlier findings

  1. Round 1, finding 1 (also reviewer 2, finding 1): the 4 gated node tests ran nowhere — fixed in 6f5950c.
    • scripts/release/part-a.sh:77 runs step node-timing env CG_TIMING_TESTS=1 node --test opencode-plugin/test/*.test.mjs when the switch is on, and writes a skip line when it is off. The step sits inside the exported CG_TIMING_TESTS default, so Part A runs it.
    • .github/workflows/ci.yaml:68-73: build-test (dispatch and tags) installs node 22 and runs the same node test command under the job-level CG_TIMING_TESTS=1.
    • The misleading-comment side effect is gone too: a PR that changes a .test.mjs file makes timing-tests-needed.sh answer run, so local-tests.sh sets the switch and node-timing runs on the laptop. The docs (CLAUDE.md, RELEASING.md) now name the step, and the claim is true.
    • I traced the wiring end to end; the tests now run in Part A and in the heavy build-test job.

Non-blocking

  • part-a.sh:77 needs node on PATH and offers no fallback, unlike GO. The header says "node 22 is needed", and the author ran the suite on the laptop. A box without node gets a FAILED node-timing row, which is visible and honest.
  • The round-1 non-blocking notes stand as notes: the ^[+-][^+-] filter edge, the unresolvable-explicit-base path in timing-tests-needed.sh, and the margin of ungated 1 s bounds (failopen.test.mjs:413, tooldefer tests). None blocks.

What I checked

  • Last review: round 1, 184f46a, 2026-11-24T17:23:41Z.
  • New commits read: 1 — 6f5950c8 "test: run the OpenCode timing tests in the integrator's checks".
  • Read in full: 2 reviews, 2 comments, 0 inline comments (from .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt).
  • New items since my last review, and what I did:
    • Reviewer 2's round-1 review (17:21:42Z): same finding 1 as mine. I checked the fix myself against both wordings; it covers both (Part A step plus heavy CI).
    • Author comment (17:26:15Z): announces the fix in 6f5950c8. Verified against the diff.
    • Author comment (17:16:11Z, pre-dated my round 1): Go test results at load 325 to 365, all 16 gated tests pass with the switch on. Noted; matches the PR description.
  • The fix commit hunk by hunk:
    • part-a.sh: the if [ "$CG_TIMING_TESTS" = 1 ] guard sits after the export, so the value is always set. The skip line matches what local-tests.sh parses. The step runs through step(), so a failure gets the rerun and the FAILED line like any other step.
    • local-tests.sh: the step list now matches the indented step line (^[[:space:]]*step) and accepts the skip state; awk '{print $2}' still yields the step name on an indented line. A summary with only skip lines still fails the grep -qE '^(ok|flaky|FAILED) ' guard, which is right: the Go steps always emit a result line.
    • local-tests_test.sh: traced the three new fixtures by hand. Skipped step → row | node-timing | skipped, rc 0. FAILED step with a node TAP log (not ok, no Go --- FAIL: line) → empty failing → the else branch → rc 1. Deleted step line → "no result line" → rc 1.
    • ci.yaml: the node step runs before make cover, under the existing job env; the shell expands the glob.
    • Old Part A summaries have no node-timing line, so --reuse of one now fails with "no result line". Correct: such a summary says nothing about the new step. The normal path always runs the new part-a.sh.
  • No proxy or library behavior change; no data dependence; no binaries.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 offload-review skill, @amiddavid's session resumed 2 of 2 2 of 2 6f5950c8fd45 approve

Verdict: approve

Findings

None. The one round-1 finding is fixed, and the fix commit adds no defect I can show.

Status of earlier findings

  1. Reviewer 2, round 1 (also reviewer 1, round 1): the 4 node timing tests ran nowhere.
    Fixed in 6f5950c8. I checked the fix myself:
    • scripts/release/part-a.sh:80: the new step node-timing runs
      node --test opencode-plugin/test/*.test.mjs with CG_TIMING_TESTS=1 when the switch is on.
      With the switch off it writes a skip summary line instead. Part A is the integrator's run,
      and local-tests.sh turns the switch on for a PR that adds or changes a timing test.
    • .github/workflows/ci.yaml:68-73: build-test (dispatch and tags only) installs node 22 and
      runs the same node tests under the job's CG_TIMING_TESTS: "1".
    • local-tests.sh now accepts the skip state, requires a line for every step including
      node-timing, and its step scan allows the indented step. The skipnote line
      ("skipped TestBobReleasePythonSuite…") does not match ^(ok|flaky|FAILED|skip) , so it is not
      read as a step row.
    • The new fixtures in local-tests_test.sh cover the skipped, failed and missing node-timing
      step. I traced the failed case: a node TAP log has no --- FAIL: lines, so failing is empty
      and the step fails through the else branch, as the fixture expects (rc 1).
    • CLAUDE.md and RELEASING.md now name the node-timing step, and the text matches the code.
  2. Reviewer 1's non-blocking notes (3): the ^[+-][^+-] filter, the explicit bad <base> path,
    the gating at the margin.
    Not addressed by the author. I checked the bad-base one myself: an
    explicit base that git cannot resolve makes both git diff calls fail and the script prints
    skip, against its own header. No caller passes a bad base (the only caller with args is the
    fixture test, with valid tags), so it stays non-blocking. The other two I also confirm as
    non-blocking.
  3. My round-1 non-blocking notes (3): the flaky-note wording on a rerun without --- FAIL:
    lines, the diff grep matching docs text, the --reuse timing-line edge.
    Not addressed. All
    three stay non-blocking; none changes a posted result.

Non-blocking

  • None new.

What I checked

  • Last review: round 1, 184f46a4237770e2a7a0ea4616479135eec59b60, 2026-11-24T17:21:42Z.
  • New commits read: 1 — 6f5950c8 "test: run the OpenCode timing tests in the integrator's checks".
  • Read in full: 2 reviews, 2 comments, 0 inline comments (from the three files
    .review-in-reviews.txt, .review-in-comments.txt, .review-in-inline.txt).
  • New items since my last review, and what I did about each:
    • Reviewer 1's round-1 review (17:23:41Z): same main finding as mine. I verified the fix for both.
    • Comment by amiddavid (17:16:11Z), Go test results under load 325-365: 16 gated tests SKIP
      without the switch and PASS with it. Evidence the gating works; nothing to act on.
    • Comment by amiddavid (17:26:15Z), the fix report: I verified each claim against the commit.
    • Commit 6f5950c8: full diff read (6 files), plus the code around each hunk — part-a.sh
      (step, skip line, run() handling), ci.yaml (job env and node setup), local-tests.sh
      (skip state, indented-step scan), local-tests_test.sh (3 new fixtures), CLAUDE.md, RELEASING.md.
  • The full diff 1d20435f..HEAD from round 1 stays read; the new commit changes only the six files
    above.
  • part-a.sh details: the step runs through run(), so it gets a log, a rerun on failure and a
    FAILED line like every step. awk '{print $2}' drops the leading whitespace of the indented-step
    match, so the step list is right. A missing node binary fails the step with a clear log, not a
    hang.
  • Commit message: DCO sign-off present, Assisted-By: attribution, conventional title.
  • No user-facing behavior change, so no human-permission item. No data-dependence row needed. No
    binaries or LFS files added.

@amiddavid
amiddavid merged commit e54d499 into main Nov 24, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 24, 2026
amiddavid added a commit that referenced this pull request Nov 24, 2026
Picks up #1366, so local-tests.sh skips the timing tests at this head.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
amiddavid added a commit that referenced this pull request Nov 24, 2026
The rebase on e54d499 replayed an older "restore chain_test.go to
main" step. That step dropped the testutil import that #1366 added.
This commit takes the file from main again. The PR does not change
chain_test.go.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
amiddavid added a commit that referenced this pull request Nov 25, 2026
feat(modelinfo): add prompt-size price tiers (no caller yet)

Some providers bill a whole request at higher rates when the prompt is
large. Add the data and the rule. Nothing calls Price.At yet, so no
figure or decision changes.

- Price.Tiers and PriceTier hold the rates above a prompt size.
- Price.At(promptTokens) returns the rates for that size.
- PromptTokens(fresh, read, write) is the one definition of prompt size.
- Built-in tiers: OpenAI GPT-5.4+ above 272k, Claude Haiku 5.5 above 100k.
- litellm parses _above_<N>k_tokens keys. A rate the feed states wins.

fix(modelinfo): keep Price comparable; fill partial tiers; tier operator prices

- Tiers is a fixed [3]PriceTier array, so Price stays comparable with ==.
  Revert the DeepEqual edits. A test keeps it comparable.
- A partial feed tier fills each missing rate from the built-in multiple,
  else from the input ratio. A negative rate drops the line.
- The operator price file gets the built-in tiers too.
- GPT54OrLater and GPT56OrLater share one version parser.
- Tests: write-cost key, two tier lines, partial tier, negative rate.

test(modelinfo): correct a stale comment on the partial-tier fill

The unstated output rate of gpt-5.6-x now comes from the built-in
1.5x multiple, not from the input ratio. Only the comment changes.

feat(modelinfo): add a flat key to the price file to turn built-in tiers off

An operator entry with `flat: true` gets no built-in prompt-size tier.
Use it for a gateway that bills one flat rate. Absent means the tiers
apply, as before. The key is per entry. A non-bool value stops the load.

fix(modelinfo): treat a tail that differs only in flat as ambiguous

deriveBareTails compared price, window and compaction point but not
flat. Two same-tail entries that differ only in flat let the bare id
take the first entry's tier setting, by file order. Compare flat too.

test(modelinfo): keep main's chain_test.go after the rebase

The rebase on e54d499 replayed an older "restore chain_test.go to
main" step. That step dropped the testutil import that #1366 added.
This commit takes the file from main again. The PR does not change
chain_test.go.


No behavior change: prompt-size price tiers in modelinfo; nothing calls Price.At yet. Approvals still count (approval-still-valid: same change). Local tests waived (owner rule).

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant