Skip to content

fix(claude): surface usage-limit pauses in the thread - #7165

Merged
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
vitalyiegorov:fix/claude-usage-limit-surfacing
Sep 5, 2026
Merged

juliusmarminge merged 4 commits into
pingdotgg:mainfrom
vitalyiegorov:fix/claude-usage-limit-surfacing

chore: merge latest main into Claude usage limit fix

236989c
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Effect Service Conventions succeeded Sep 5, 2026 in 2m 53s

Effect Service Conventions: All clear

All clear

Details

Note

Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.

Reviewed the only in-scope changed file, apps/server/src/provider/Layers/ClaudeAdapter.ts (tests excluded by check scope; docs/user/providers-claude.md out of scope).

Checked against the conventions:

  • Imports: new type SDKRateLimitInfo comes from the whole @anthropic-ai/claude-agent-sdk package as a type-only named import, which is permitted. Existing Effect imports remain subpath namespaces (import * as Effect from "effect/Effect"); no new named imports from bare "effect".
  • Service definition: no service was created, moved, or refactored — the change adds pure helpers (describeClaudeUsageLimit, formatClaudeUsageLimitWait), a constant window map, and a per-turn dedupe field on the existing ClaudeSessionContext.
  • Dependency acquisition: names is read from the existing scopedLimitNames Ref option; "now" is taken from the Effect-derived makeEventStamp() timestamp rather than an ambient clock; no ManagedRuntime.make, runPromise, or runPromiseExit introduced.
  • Errors: no new error classes, mappers, predicates, or catchTag/catchIf usage introduced.
  • Change discipline: no new lint/type-checker suppression directives; the behavior change is covered by focused tests added in ClaudeAdapter.test.ts using the existing adapter harness.

🔍 Agent activity — 3 tool calls

💭 I'm examining the changes to ClaudeAdapter.ts, checking how the SDKRateLimitInfo type and ClaudeScopedLimitNames are used and comparing against the current head version to understand the diff's context.

1. browse_code — apps/server/src/provider/Layers/ClaudeAdapter.ts

2. browse_code — apps/server/src/provider/Layers/ClaudeAdapter.ts

💭 Checking the imports and confirming they're fine, then looking at the new code's use of Date.parse—it's pure and not really an Effect service concern. I don't see new errors or services introduced here, just checking how it references announced state through context. announcedUsageLimits, which matches an existing mutable-field pattern already used elsewhere. Now I want to look at the rate-limit handler to make sure nothing like Date.now() or runPromise sneaks in.

3. browse_code — In apps/server/src/provider/Layers/ClaudeAdapter.ts, show the full handler for rate_limit_event SDK messages (the function that computes stamp, base, claudeRateLimitEventToUpdate, and calls emitRuntimeWarning), including how stamp is produced and the signature of emitRuntimeWarning.

💭 I'm checking whether parsing the timestamp with Date.parse counts as a clock or dependency violation under these conventions—since it operates on an already Effect-derived value rather than calling Date.now() directly, it seems acceptable rather than a hidden dependency issue. Reviewing the rest: the import of ClaudeScopedLimitNames looks pre-existing rather than newly added, only a type-only SDK import was introduced, and new tests already exist satisfying test discipline with no new lint suppressions. So there's nothing to flag here, and I'll finalize the response as "All clear."


Agent Credits: 113 credits

Token usage: 12 uncached input · 96,234 cache-read input · 139,711 cache-write input · 6,138 output
Agent Credits may also include non-token charges from external tools such as web research.