🟠 High
When a queued run targets the old provider after a handoff, this guard reads sessionError from the thread’s new provider, so a different error there masks the old provider’s usage_limit failure. usageLimitBlockedRun then returns null, and startNextQueuedRun starts the still-limited provider, failing the attempt and consuming the queued message; select the session error for queuedRun.providerInstanceId instead.
🤖 Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/server/src/orchestration-v2/Orchestrator.ts around line 1321: |
| 2 | |
| 3 | When a queued run targets the old provider after a handoff, this guard reads `sessionError` from the thread’s new provider, so a different error there masks the old provider’s `usage_limit` failure. `usageLimitBlockedRun` then returns `null`, and `startNextQueuedRun` starts the still-limited provider, failing the attempt and consuming the queued message; select the session error for `queuedRun.providerInstanceId` instead. |
Confirmed and fixed in 0c21f52f7. threadErrorSummary drops the run's usage_limit class when the session error has a different message, and the guard was reading that session error from the thread's current provider. Since the guard now only holds the queue for the queued run's own provider, it reads the session error from queuedRun.providerInstanceId too. When the queued run targets the thread's provider (the usual case), behavior is unchanged.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.