Skip to content

fix(ci): restore the AI auditor — upgrade the firewall/api-proxy and pin the model - #262

Closed
WomB0ComB0 wants to merge 3 commits into
masterfrom
fix/ai-auditor-model-pin
Closed

fix(ci): restore the AI auditor — upgrade the firewall/api-proxy and pin the model#262
WomB0ComB0 wants to merge 3 commits into
masterfrom
fix/ai-auditor-model-pin

Conversation

@WomB0ComB0

Copy link
Copy Markdown
Member

The auditor has been failing on every PR, and reading nothing

agent fails on #259, #260 and #261 alike. It is not any of those branches — it is one bug in the workflow.

The proxy's model alias table maps gemini-3.1-flash to the glob gemini-3.1*flash*. That glob also matches gemini-3.1-flash-tts-preview — a text-to-speech model. The router is therefore permitted to select it, but the AI-credits pricing table has no entry for it, so the proxy rejects every request:

_ApiError: {"type":"unknown_model_ai_credits",
 "message":"Model \"gemini-3.1-flash-tts-preview\" has no AI credits pricing ..."}
[Routing] NumericalClassifierStrategy failed: ...
##[error]Process completed with exit code 144

Both the classifier sub-call and the main sendMessageStream turn used it, and the run reports total_tokens: 0. The audit was not a strict reviewer — it never read a single file. A red check that means "nothing was examined" is worse than no check, because it looks like coverage.

Pinning engine.model removes the router's freedom to reach a model the pricing table does not cover.

Two things worth flagging in the diff

1. The recompile wanted to downgrade two actions. The committed locks were built by gh-aw v0.79.4; my installed extension is v0.83.4. Compiling with v0.83.4 rewrote 457 lines and bumped gh-aw-actions/setup to a new SHA. So I fetched v0.79.4 and compiled with that instead — but it still tried to revert Dependabot's work:

Action Committed (uses:) What a recompile produced
actions/checkout 9c091bb v7.0.0 df4cb1c v6.0.3
actions/setup-node 8207627 v7.0.0 48b55a0 v6.4.0

The cause is that the lock's embedded manifest still records v6 while Dependabot bumped only the uses: lines. I held the v7 SHAs. The diff contains no action version change — please confirm that in review, since a silent checkout v7→v6 downgrade is exactly the kind of thing a green CI run would have waved through.

2. .secretsignore gains six files. The scanner flagged 45 uses: action@<40-hex> lines as "High-Entropy Hex (≥40 chars)" — i.e. it flags SHA pinning, the practice zizmor fails the build for omitting. Notably every generated *.lock.yml was unlisted, so any commit touching one was unlandable; that is why this is bundled here rather than split out.

Before allowlisting, I checked each of the six for high-entropy strings that are not action pins:

File 40+ hex strings not a pin/manifest/digest
agentics-maintenance.yml 45 0
ai-auditor.lock.yml 74 0
auto-triage-issues.lock.yml 73 0
daily-secrets-analysis.lock.yml 70 0
duplicate-code-detector.lock.yml 70 0
sync-github-packages.yml 1 0

Test plan

  • gh-aw v0.79.4 compiles clean: 0 errors, 0 warnings
  • GEMINI_MODEL: gemini-2.5-flash reaches both the agent and detection jobs
  • Lock diff is exactly the model pin — no action SHA movement
  • resq secrets --staged → no secrets detected
  • The real test is this PR opening: ai-auditor triggers on pull_request: opened and runs from the head branch, so the agent check here either goes green or proves the pinned model is also unpriced

Audit fails in the local pre-commit hook on untouched master too (audit-ci cannot read bun.lock), so hooks were skipped for that check only.

No changeset: CI/tooling only, no package behaviour change.

The Gemini router resolved the proxy's `gemini-3.1-flash` alias through the
glob `gemini-3.1*flash*`, which also matches `gemini-3.1-flash-tts-preview`
— a text-to-speech model carrying no entry in the AI-credits pricing table.
Every call was rejected `unknown_model_ai_credits`, so the job exited 144
having read zero files and consumed zero tokens. It failed this way on #259,
#260 and #261 alike.

Pinning `engine.model` removes the router's freedom to reach a model the
pricing table does not cover.

Recompiled with gh-aw v0.79.4 to match the four committed lock files; the
`actions/checkout` and `actions/setup-node` pins are held at the v7.0.0 SHAs
Dependabot moved them to, which a plain recompile would have reverted to v6.

Also allowlists the six SHA-pinned workflow files the secrets scanner still
flagged as high-entropy hex — including every generated `*.lock.yml`, which
made any commit touching them unlandable. Each was checked first: all their
40-char hex strings are action pins, manifest entries or image digests, and
nothing else.
@github-actions github-actions Bot added C-Documentation Improvements or additions to documentation pkg:ui Changes to @resq-systems/ui pkg:helpers Changes to @resq-systems/helpers A-CI CI/CD, workflows, actions, and git hooks labels Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@WomB0ComB0, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 95acde31-02a9-4f8f-9e41-8a0b0891db98

📥 Commits

Reviewing files that changed from the base of the PR and between f49f66e and b195dd0.

📒 Files selected for processing (9)
  • .github/aw/actions-lock.json
  • .github/workflows/ai-auditor.lock.yml
  • .github/workflows/ai-auditor.md
  • .secretsignore
  • packages/helpers/CHANGELOG.md
  • packages/map/README.md
  • packages/telemetry/README.md
  • packages/ui/CHANGELOG.md
  • packages/ui/css.d.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
resq-design b195dd0 Commit Preview URL

Branch Preview URL
Aug 12 2026, 10:53 PM

Pinning GEMINI_MODEL alone was not enough. The CLI does request the pinned
model, but the proxy runs with enableTokenSteering and resolves the request
through its alias globs: `gemini-2.5-flash` still matched
`gemini-3.1*flash*` and landed back on the TTS preview.

The auditor ran green from 2026-07-27 to 2026-08-10 and has failed every run
since, so this is a provider catalogue regression rather than a bad engine
choice — the fix is to pick a family whose glob does not resolve to the new
TTS variant.
Neither model pin worked: the proxy resolves the model independently of what
the CLI requests, and landed on `gemini-3.1-flash-tts-preview` whether the
workflow asked for `gemini-2.5-flash` or `gemini-2.5-pro`.

`unknown_model_ai_credits` is raised by the api-proxy, and its pricing table
ships inside the firewall image — which this repo pins at 0.27.0. Recompiling
with gh-aw v0.83.4 moves it to 0.27.42. The alias globs are unchanged, so the
pricing table is the only thing that can account for the regression window
(green through 2026-08-10, red every run since).

`actions/checkout` and `actions/setup-node` are held at their v7.0.0 SHAs;
`gh-aw-actions/setup` moves to v0.83.4 because it must match the compiler.
@github-actions github-actions Bot added size/XL and removed size/L labels Aug 12, 2026
@WomB0ComB0 WomB0ComB0 changed the title fix(ci): pin the ai-auditor model so the audit stops failing on every PR fix(ci): restore the AI auditor — upgrade the firewall/api-proxy and pin the model Aug 12, 2026
@WomB0ComB0

Copy link
Copy Markdown
Member Author

Verified green: run 31648687169agent, detection and safe_outputs all success, 28,434 tokens consumed. The auditor has actually read the code for the first time since 2026-08-10.

Two wrong hypotheses first, both disproven by CI

I originally claimed pinning the model was the fix. It was not, and the runs said so:

# Change Result
1 model: gemini-2.5-flash fails — CLI requests it correctly, proxy still resolves gemini-3.1-flash-tts-preview, 0 tokens
2 model: gemini-2.5-pro fails — identical TTS model, 0 tokens
3 + firewall/api-proxy 0.27.00.27.42 success, 28,434 tokens, model gemini-2.5-pro

Attempt 2 is what killed the "pick a family whose glob dodges the TTS variant" theory: a pro request still landed on a flash-tts model, so the proxy was choosing independently of the request. No workflow-file setting could have fixed that.

unknown_model_ai_credits is raised inside the api-proxy, whose pricing table ships in the firewall image. The alias globs are byte-identical between compiler v0.79.4 and v0.83.4 (gemini-3.1*flash* appears in both), so config was never the variable — the image was. That also fits the regression window exactly: green through 2026-08-10, red on all 9 runs after.

Worth noting: the error string still appears once in the green run, then the run recovers and completes. So both halves contribute — the newer proxy retries rather than dying, and the pin gives it a valid target.

What to check in review

  • actions/checkout and actions/setup-node are held at their v7.0.0 SHAs. A plain recompile reverts them to v6.0.3 / v6.4.0, because Dependabot bumps the uses: lines while the lock’s embedded manifest still records v6. Verified 0 remaining v6 references.
  • gh-aw-actions/setup does move to v0.83.4 — required, as the setup action must match the compiler that generated the lock.
  • The lock is ~457 lines of regenerated output; the meaningful deltas are the firewall image tag and the model pin.

Open question, not blocking

No pull_request-triggered run was ever created for this PR — all three runs here are workflow_dispatch, while #259/#260/#261 each got a pull_request run. The plausible explanation is that GitHub declines to auto-run a workflow whose own file the PR modifies. I could not confirm that, so I am flagging it rather than asserting it. It should resolve once this merges to master.

@WomB0ComB0

Copy link
Copy Markdown
Member Author

Superseded by #263. This branch was cut from a stale master and went CONFLICTING once #256/#257/#258 landed; #263 is the same fix rebuilt on current master, with the redundant .secretsignore additions dropped (master already has all six entries) and actions/checkout carried at master's newer v7.0.1 pin.

The investigation and the three-attempt result table are reproduced in #263.

@WomB0ComB0 WomB0ComB0 closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI CI/CD, workflows, actions, and git hooks C-Documentation Improvements or additions to documentation pkg:helpers Changes to @resq-systems/helpers pkg:ui Changes to @resq-systems/ui size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant