Repository navigation
fix(evi): reject a spend-report window that ends in the future - #793
Open
evlogai[bot] wants to merge 1 commit into
Open
evlogai[bot] wants to merge 1 commit into
evlogai[bot] wants to merge 1 commit into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
4 Skipped Deployments
|
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Contributor
|
Thank you for following the naming conventions! 🙏 |
@evlog/cli
evlog
@evlog/nuxthub
@evlog/signals
@evlog/telemetry
commit: |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ai_gateway__reportaccepts anyYYYY-MM-DDwindow, including one that ends after today. The gateway answers an out-of-range window with zero rows, and the empty-scope receipt then says "empty results usually mean traffic predates evi:env tagging": a wrong diagnosis that sent today's cost investigation chasing a tagging bug that did not exist. The actual cause was a window dated in 2027.This hit in practice on 2026-10-08: three report calls with future end dates returned empty scopes, and the note pointed at the wrong layer.
Change
Window validation moves up front, in
apps/evi/agent/lib/gateway.ts:ai_gateway__report's input schema now runs it viasuperRefine, so a future-dated window is rejected at the tool boundary with the offending field named, instead of returning a plausible-looking empty report:A caller that asks for
2026-02-07to2027-03-07when today is2026-10-08now gets: "endDate is in the future: the window ends 2027-03-07 but today is 2026-10-08 (UTC), and the gateway has no data for dates that have not happened yet", and can correct the dates in the same turn.Checks
Run at
be37147offmain(59a105f), cold:apps/evi:tscclean.vitest run agent/lib/gateway.test.ts: 23 passed, including 4 new: window ending today accepted, futureendDaterejected with the field and message, inverted window rejected, andtodayUtcreturning the UTC calendar date across a local-midnight boundary under fake timers.pnpm run lint: exit 0.No changeset: the change is confined to
apps/evi.ELI5
When someone asks the spending report for dates that have not happened yet, the gateway quietly answers "nothing here" and the message blames a configuration problem that is not the real cause. This change makes the report say "that date is in the future" instead, so nobody goes looking in the wrong place.