Skip to content

proof(repro): #4674 fails without ACP unknown-usage enrichment (expected red) - #12

Open
LeoLin990405 wants to merge 3 commits into
proof-basefrom
proof/grok-4674-fix-reverted
Open

LeoLin990405 wants to merge 3 commits into
proof-basefrom
proof/grok-4674-fix-reverted

Conversation

@LeoLin990405

Copy link
Copy Markdown
Owner

Fork-only proof for steipete#4679. Same head tree as the fix commit (928ffca), with only the ACP unknown-usage enrichment call in GrokStatusProbe.fetch() reverted; seam, helpers, tests, docs, and changelog are unchanged. Expected: GrokACPUnknownUsageTests fails (weekly ACP period with omitted percentage yields no primary window), demonstrating the regression test is failing-before-fix. Do not merge.

The ACP `_x.ai/billing` credits payload can describe an active weekly period
and a prepaid balance while omitting `creditUsagePercent` right after a period
rollover. `GrokRPCClient.fetchBilling()` accepted that wallet-only snapshot, so
`GrokStatusProbe.fetch()` treated billing as successful and the auto pipeline
never reached the steipete#3261 web fallback; `toUsageSnapshot()` then had no primary
window for the rest of the week.

Reuse the existing bounded, same-account usage enrichment for ACP credits whose
percentage is unknown: ask the grok.com bearer surface with the same auth-file
token under the six-second budget and adopt only a wire-published percentage or
a parser-validated implicit zero for an active period. The ACP period, plan,
and prepaid balance stay authoritative, a failed or slow enrichment keeps the
already-valid wallet-only billing, and missing or expired tokens never reach
the network.

Adds synthetic ACP regression coverage for the zero-usage week, enrichment
unknown/failure/cancellation/timeout paths, credential guards, published-percent
no-retry behavior, and unknown-usage preservation. Updates docs/grok.md and the
0.79.1 changelog.

Refs steipete#4674
`CredentialsMode` is a parameter of an internal `@Test(arguments:)` entry
point, so declaring the nested enum private fails the macOS test-target
compile: "method must be declared private because its parameter uses a
private type". Nesting it in the internal suite already keeps it
test-target-local.

Refs steipete#4674
…nt wiring

Proof-only variant: keeps the fix commit's seam, helpers, tests, docs, and
changelog (plus the test access-level fix), but removes the production call in
`GrokStatusProbe.fetch()` that enriches ACP credits whose usage percentage is
unknown. The focused `GrokACPUnknownUsageTests` regression is expected to fail
on this tree, demonstrating that it is a failing-before-fix test.

Refs steipete#4674

Do not merge.
@LeoLin990405
LeoLin990405 force-pushed the proof/grok-4674-fix-reverted branch from 565a7f0 to 179adfe Compare October 21, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant