Repository navigation
Replies: 1 comment
|
Note Drafted by Claude Opus 5.5 in Claude Code (via T3 Code); reviewed and posted by @jieyuexing. +1. A real use case, and a request about which fields to include. I coordinate from a T3 thread and send most work to other providers with Running that CLI daily has shown that label + used percent + reset time is not enough to decide well. Everything below already exists in
I agree with the non-goals: no automatic fallback, and no change to Related: #16366 (OpenCode Go limit failures, which asks for the same exposure in its Expected section) and #15665. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Include each provider instance's existing usage-limit state in the
orchestrator_capabilitiesresult, so an orchestrating agent can avoid delegating to a provider that is currently rate-limited or out of quota and pick another one.Problem to solve
Agents choose a child provider from
orchestrator_capabilities. Its per-providerconstraintsandcanRunChildTaskflags reflect only adapter presence, enabled and installed state, driver availability, provider status, and authentication. A provider whose account has hit its usage limit still reportscanRunChildTask: truewith no constraints. An orchestrator then delegates, the child fails with a durable rate-limit failure such as "Claude API rate limit reached. Try again later.", and nothing tells the agent when the limit resets, so it may keep routing work to the exhausted provider or retry blindly. The server already tracks this data:ServerProvider.usageLimitscarries usage windows withusedPercentandresetsAt(updated from runtime rate-limit events), and threads recordlastErrorClassandusageLimitResetAtafter a usage-limit failure. The data is visible to people in the UI but not to agents.Proposed behavior
Each provider entry in
orchestrator_capabilitiesgains optional, read-only usage information derived from what the server already knows: for example the current usage windows (label, used percentage, reset time) and, when the instance's most recent child or thread failure was a usage-limit failure, the time it is expected to reset. When the provider does not report usage, the field states that it is unavailable rather than implying capacity. The existingcanRunChildTaskandcanRunCrossProviderChildTasksemantics, which also gatedelegate_task, do not change.Acceptance criteria
orchestrator_capabilitiesreturns that window's label, used percentage, and reset time for the instance.orchestrator_capabilitiescall shows that the instance is limited and when it resets, until the reset time passes or a fresh usage snapshot clears it.canRunChildTaskvalue is unchanged.delegate_taskbehavior and existing capability fields are unchanged for all providers.orchestrator_capabilitiestool description tells agents the usage fields exist and are advisory.Affected area
apps/server/src/mcp/OrchestratorMcpService.ts(capabilities result built nearproviderConstraintsat L218), the capability schema inpackages/contracts/src/orchestratorMcp.ts, and the existing usage data inpackages/contracts/src/server.ts(usageLimitsat L280),packages/contracts/src/providerUsageLimits.ts, andpackages/contracts/src/orchestrationV2.ts(lastErrorClass,usageLimitResetAtat L1793-1794).Non-goals
delegate_taskaccepts.Alternatives considered
canRunChildTaskfalse while a provider is limited: blocks delegation on advisory and possibly stale data, and changes a gating contract.Supporting context
Current constraint logic is at OrchestratorMcpService.ts:218. Related open work: PR #15930 (capabilities re-probe providers that look unavailable), #15716 and #15992 (capabilities listing models disabled in settings). No existing request for agent-visible usage limits was found.
All reactions