Skip to content

feat: expose rate limits on usage updates - #334

Open
s-cork wants to merge 1 commit into
agentclientprotocol:mainfrom
anvil-works:stu-dev/usage-updates-main
Open

s-cork wants to merge 1 commit into
agentclientprotocol:mainfrom
anvil-works:stu-dev/usage-updates-main

Conversation

@s-cork

@s-cork s-cork commented Jul 24, 2026 •

Copy link
Copy Markdown

Problem

ACP clients receive context usage but cannot display current Codex account limits or refresh them when account/rateLimits/updated arrives independently of token usage.

Change

Expose current rate-limit snapshots as _meta["_codex/rateLimits"] in usage_update and emit the same update after account-limit changes, once context usage is available. Rebased onto main at ba7b216, including upstream ACP v2 support. The v2 conversion preserves the usage update and its metadata unchanged.

Keep upstream mergeRateLimitSnapshot behavior unchanged, including missing limitId handling and sparse window updates. This remains additive metadata; it does not opt clients into experimental compaction or notice events.

Validation

  • pnpm test: 1,236 passed, 33 skipped.
  • pnpm typecheck: passed.
  • Regression coverage verifies rate-limit-only notifications and retained upstream merging behavior.
  • No new live-provider test was run on this rebased revision.

Anvil separately carries the same usage fix on the exact Codex ACP 2.0.1 release in fork PR #11, pinned at 69248525458b84b94f3329f35f70daf56e2a3d3d. This upstream PR contains only the rate-limit usage change.

AI assisted implementation, tests, rebase and PR text.

@s-cork
s-cork force-pushed the stu-dev/usage-updates-main branch from 4fa79d5 to b670a4e Compare August 25, 2026 09:27
@s-cork s-cork changed the title Expose rate limits on usage updates feat: expose rate limits on usage updates Aug 25, 2026
@s-cork
s-cork force-pushed the stu-dev/usage-updates-main branch 2 times, most recently from e7d2078 to f9f13d1 Compare September 23, 2026 13:48
@s-cork
s-cork force-pushed the stu-dev/usage-updates-main branch from f9f13d1 to 50ea831 Compare September 30, 2026 00:55

This branch has not been deployed

No deployments
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