release: v0.1.1212 — ai-agent starter passes its own eval out of the box - #3460
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
📝 WalkthroughWalkthroughThe calculator template replaces ChangesCalculator and assistant templates
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Assistant
participant Calculator
User->>Assistant: Request currency shares
Assistant->>Calculator: Execute split operation
Calculator-->>Assistant: Return cent-accurate shares
Assistant-->>User: State every returned share
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cli/templates/files/ai-agent/tools/calculator.ts`:
- Around line 21-32: Bound the caller-controlled split count in calculator.ts by
capping the computed parts value at 1,000 while preserving the minimum of one
and existing truncation/absolute-value behavior before Array.from. Regenerate
the embedded copy in cli/templates/manifest.json at line 34 from calculator.ts;
do not edit the manifest copy manually.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 55a8c0ea-377a-49fd-adb3-7bc9fdc20d51
⛔ Files ignored due to path filters (1)
src/html/hydration-script-builder/hydration-runtime.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (6)
cli/templates/files/ai-agent/agents/assistant.tscli/templates/files/ai-agent/tools/calculator.tscli/templates/index.test.tscli/templates/manifest.jsondeno.jsonsrc/utils/version-constant.ts
52f8ed3 to
5bf6256
Compare
A fresh `veryfront init --template ai-agent` scaffolded a project whose own smoke eval failed roughly one run in four. Two independent causes, both found by reading eval traces rather than the source. `b` meant the second operand for add/subtract/multiply/divide and the decimal places for a fifth `round` operation. The model could not hold both meanings at once. Traces show it inventing a `round` key the schema never declared, then calling `divide` with `b: 0` when it meant "round to 0 places". That throws, and one thrown call fails the noFailedTools gate. The judge failed separately, and for a reason no prompt wording fixes: asked to divide $99.71 three ways the model rounded each share on its own and answered "$33.24 each", which is $99.72. Rounding shares independently cannot preserve a total. Both go away with one operation. `split` divides a money amount in integer cents and hands back shares that add up to it exactly, so the model never rounds money and never needs a decimal-places argument. That retires the `round` operation and the float-rounding helper it needed: money is counted here, not rounded. The system prompt shrinks to match, since it no longer has to explain how to distribute a leftover cent. `b` becomes an array length, so an unbounded value from the model would throw RangeError and fail the same gate. Splits above 1000 shares are refused outright rather than silently capped. Verified on a scaffolded project against the gateway: 8 of 8 runs green on all three gates, all 8 calling `split`. Before the change the same measurement was 6 of 8.
5bf6256 to
bbf8934
Compare
Cuts v0.1.1212 to ship one fix: the ai-agent starter's own eval now passes out of the box.
v0.1.1211 (#3459) removed two rubric lines the assistant could not reliably meet. That helped, but measuring properly showed the starter still failed about one run in four, for two causes that had nothing to do with the rubric. #3459 merged while that measurement was still running, so the fix missed the release.
Both causes were found by reading eval traces, not by reading the source.
1.
bmeant two different thingsThe model could not hold both meanings at once. From a failing trace:
It wanted to round, the schema gave it no way to say so on a
divide, and it encoded the request asb: 0. The tool throws, andagent.noFailedToolsfails on a single thrown call.2. Rounding each share cannot preserve a total
No prompt wording fixes this one. Asked to divide $99.71 three ways, the model rounded each share on its own and answered:
That is $99.72.
One operation fixes both
splitdivides a money amount in integer cents and returns shares that add up to it exactly:Because the model never rounds money, it never needs a decimal-places argument either. So
roundretires, and the float-rounding helper it required (Number.EPSILONnudge intotoFixed) retires with it. Money is counted here, not rounded. The system prompt shrinks too, since it no longer has to explain how to distribute a leftover cent.The tool is 38 lines: four operations that do the obvious thing, plus
split.bbecomes an array length, so an unbounded value from the model would throwRangeErrorand fail the same gate this PR exists to fix. Splits above 1000 shares are refused rather than silently capped, since returning 1000 shares when 5000 were asked for is quietly wrong.Review follow-ups
Math.mincapping, since a silently wrong split defeats the point of an operation that promises the shares add up. CodeRabbit confirmed the approach.Evidence
Measured the way a user meets it:
veryfront init --template ai-agent, thennpm run eval -- assistantagainst the gateway.agent.noFailedToolsjudge.rubricsplitAll 8 called
splitand read the shares straight back, so this is the mechanism working rather than the sample being kind. Dropping the rounding helper costs nothing: the model receives15.209999999999999for the tip and writes$15.21unaided, with no float noise in any of the 8 answers.What this does not claim. Eight consecutive green runs is not proof of determinism. A live model graded by a live model can still surprise you, and the judge resolves to the
automodel, so the rate will drift as that moves. What changed is that both systematic failures are gone: one was a schema the model could not use correctly, the other was arithmetic it was being asked to do in its head. Nothing in CI runs this eval, so nothing catches a regression here except someone scaffolding.Testing
cli/templates/,cli/commands/init/: 15 passed, 208 steps, 0 faileddeno check,deno lint(36 files),deno fmt --check: clean[99.71, 3],[0.01, 3],[10, 4],[-99.71, 3], asserting the shares always add back to the total, plus the 1000-share ceiling and the zero guardcli/templates/manifest.jsonembeds template contents verbatim and is regenerated, soveryfront initscaffolds the fixed files.Release bump is the standard three files. No tag pushed.
🤖 Generated with Claude Code