[scan-fix] Phase 8: LLM providers / usage / billing#322
Merged
Conversation
…the GrokCliProvider
…reflects grok agents
…ep so live cost reflects Anthropic cache spend
…ud 429 parks instead of crash-respawning
…ens roll into usage/cost summaries
…r's revisit counter survives a restart
…rates after 2026-08-31
…ilently falling back to a zero-usage env id
…ken-sweep test signatures)
…ck stays reachable
|
Thanks for opening your first pull request on RoboCo! Quick checklist before review (most of these are enforced by CI, but worth a glance):
See CONTRIBUTING.md for the full workflow and the Code of Conduct for the community standards we follow. Welcome aboard — a maintainer will review shortly. |
… tokens are bounded
…ry so a stolen cookie's exp is fixed
…t revokes the current jti
…w + jti revocation
[phase9] Auth hardening: bound agent tokens (iat/exp) + JWT jti revocation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Phase 8 of the 9-phase serial codebase-scan fix program. Stacks on #321 (Phase 7). CEO merges bottom-up — do not merge until #321 lands.
Findings fixed (8)
_apply_grokenables the seeded GROK provider row soresolve_for_agentroutes to GrokCliProvider (SuperGrok auth), not just sets the global default.roboco/services/llm.py_resolve_active_tokensroutes GROK tousage.jsonso the live USAGE_SNAPSHOT sweep reflects grok agents mid-run, not only at finalize.orchestrator.pycalculate_costand tracks them in_usage_by_agent, so live cost reflects Anthropic cache spend (matches the finalize path).orchestrator.py_RATE_LIMIT_MARKERS_BY_PROVIDER/_OVERLOAD_MARKERS_BY_PROVIDERmarker map; aglm-5.2:cloudollama.com 429 parks the provider instead of crash-respawning into the weekly limit. Grok deliberately absent (exit-75 detector).orchestrator.py_reconcile_orphan_spawn_sessionsat startup closes crash-orphanedagent_spawn_sessionsrows so their tokens roll into usage/cost summaries.orchestrator.pyrevisit_resetscolumn (migration 067, additive) + persist/restore in the respawn tracker, mirroringtracing_resets, so the PM-respawn breaker's revisit counter survives a restart.tables.py+orchestrator.py_sonnet5_prices()returns the promo tuple<= 2026-08-31, list rates after; Sonnet-5 row removed from_PRICING.roboco/billing/pricing.pygrok_cli_usage.main()warns on run-log parse failure (lazy%-formatting) instead of silent zero-attribution; swallow preserved so finalize can't crash on one bad log.roboco/llm/providers/grok_cli_usage.pyGate (green)
uv run ruff format .— 2 files reformatted (trailing hygiene commitfbfcf20b)uv run ruff check .— cleanuv run mypy roboco/— 358 files, no issuesROBOCO_TEST_DB_PORT=55432 ROBOCO_TEST_DB_USER=renzof uv run pytest— 12025 passed, 418 skipped, 95% coverage (11 new tests over Phase 7)Review
Per-task sonnet reviews all Approved (Tasks 1–9). Opus whole-branch review: SHIP, no fix wave. All binding constraints hold (signed commits, no new
# type:ignore/# noqa, AGPL-3.0, migration 067 additive withdown_revision=066_tasks_source_status_idx).Notes for the CEO
revisit_resets) ships here — runalembic upgrade headafter merge.TestSonnet5PromoTierclass asserts promo rates with no date monkeypatch and will fail on/after 2026-09-01. Plan-mandated; the two new tests pin both sides of the gate. Worth a separate follow-up to monkeypatch or delete those 7 tests before the promo expires.067_respawn_tracker_revisit_resets(34 chars) →067_respawn_revisit_resets(26 chars) becausealembic_version.version_numisVARCHAR(32).down_revisionunchanged.🤖 Generated with Claude Code