Repository navigation
fix(harness): record each Claude turn once, never the CLI's estimate, and date the price table (TH-9057, TH-9039) #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
khushalsonawat
wants to merge
6
commits into
feat/TH-8804-source-subfolder
Choose a base branch
from
feat/TH-9057-claude-cost
base: feat/TH-8804-source-subfolder
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a30533c
fix(harness): record each Claude turn once, never the CLI's own estim…
khushalsonawat a232700
fix(harness): guard a turn below its own usage, test on the locked SD…
khushalsonawat ffa61b7
fix(harness): keep pricing past CHECK_BY at the latest row, and check…
khushalsonawat 67b5251
Merge remote-tracking branch 'origin/feat/TH-8804-source-subfolder' i…
khushalsonawat be64c35
fix(harness): the build's reading adds each turn as the backend repor…
khushalsonawat 5e45ac8
test(harness): pin the locked-SDK rerun, the per-count guard, the UTC…
khushalsonawat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: Price check-by | ||
|
|
||
| # Schedules run on the default branch only, so this checks main's table. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 6 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| check-by: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| cache: pip | ||
| - name: Install package | ||
| run: python -m pip install . pytest | ||
| - name: Check the price table's re-check date | ||
| env: | ||
| ALK_PRICE_CHECK_BY: "1" | ||
| # A skip exits 0, so the job checks that the test ran and passed. | ||
| run: | | ||
| set -o pipefail | ||
| python -m pytest -q -rs "tests/harness/test_spend.py::test_the_price_table_is_re_checked_before_its_check_by_date" | tee pytest.out | ||
| grep -q "1 passed" pytest.out | ||
|
|
||
| # Separate, so the issues token never reaches the job that installs packages. | ||
| notify: | ||
| needs: check-by | ||
| if: failure() && github.event_name == 'schedule' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| permissions: | ||
| issues: write | ||
| steps: | ||
| - name: Open or update the re-check issue | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| title="Gemini price table: re-check before CHECK_BY" | ||
| body="The weekly price-check-by run failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}. Compare every row in vertex_gemini.py with the gateway's litellm.json and Google's Vertex pricing page, then move CHECK_BY on." | ||
| number=$(gh issue list --repo "$GITHUB_REPOSITORY" --state open --search "\"$title\" in:title" --json number --jq '.[0].number // empty') | ||
| if [ -n "$number" ]; then | ||
| gh issue comment "$number" --repo "$GITHUB_REPOSITORY" --body "$body" | ||
| else | ||
| gh issue create --repo "$GITHUB_REPOSITORY" --title "$title" --body "$body" | ||
| fi |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.