fix(server): subagents stop burning tokens on pull request watch wakes #16217
Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromt3code/audit-delegate-token-wasteopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
juliusmarminge added labelsmacroscope-review
- apps/server/src/orchestration-v2/PullRequestWatchReactor.ts line 238Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -215,4 +231,7 @@215231 const key = failureKey(target);216232 if (Exit.isFailure(read)) {217233 if (Cause.hasInterruptsOnly(read.cause)) return yield* Effect.failCause(read.cause);234+ // A rate limit stops every read on the host until it resets, so it says nothing about this235+ // pull request. Giving up would wake the agent to re-watch into the same limit.236+ if (isRateLimited(read.cause)) return;218237 const failures = (readFailures.get(key) ?? 0) + 1;
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed