Repository navigation
chore(stage): merge expbkmain and port Claude account rotation to the V2 adapter - #277
Merged
Merged
Conversation
…em feed electron-updater's GitHubProvider reads releases.atom, which lists only the ten newest releases. Stage and mobile builds share the repository and publish many times a day, so production builds fell out of the feed and installed BK T3 Code apps stopped finding updates. Each BK app now uses the generic provider against its own fixed release (bk-desktop-production / bk-desktop-staging). After each dated release is public, the publisher uploads that build's manifest to the fixed release with payload URLs made absolute into the dated release. Multi-range requests are off, because GitHub answers them with 501. A re-run repoints the feed for an already-published build, and the feed never moves to an older version. Also moves the release repository constant to iamtushar324/bkt3code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-feed fix(desktop): BK T3 Code finds updates again
…pped A session that held an actionable plan was filed under Plan Ready even while its subagents or a monitor loop were still running. Plan Ready also hid the Working/Monitoring badge, so the row read as parked. Background liveness now outranks a held plan for grouping, the work badge, the plan pulse, and tree hoisting. The plan stays visible as the outlined PLAN badge until the work stops. Also remove the violet pulsing row highlight for Plan Ready rows. They now use the default row surface; the PLAN badge and group header still mark them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rejected rate_limit_event carries its utilization only under unifiedWindows, so claudeRateLimitEventToUpdate dropped it and no account.rate-limits.updated event fired. The hard-limit rotation never ran: Auto threads stopped with the usage-limit row instead of moving to the next account and continuing. Read the fraction from unifiedWindows when the top-level one is missing, and accept seven_day_overage_included in the rotation listener. An Auto thread whose window resets within five minutes now keeps its account: the session stops, a notice names the continue time, and the thread continues on the same account a minute after the reset. A user message, an account-mode change or a thread delete cancels the wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review findings on the first commit: - The converter fix still dropped model-scoped and overage rejections, and it let rejections that overage absorbs stop the thread. Trigger the rotation from the adapter's usage-limit runtime.warning instead: it carries rate_limit_info, covers every limit type, and fires only when the rejection blocks the turn. The upstream converter is unchanged. - Clear the dedup key when a wait ends, so a fresh rejection on the same account is handled instead of swallowed. - Only wait while the reset is still ahead; a rejection whose reset has passed moves the thread instead of waiting again. - Cancel the wait as soon as a message is accepted for the thread (thread.turn-start-requested), not only once its turn starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(server): Claude threads continue after an account hits its limit
…plan fix(web): sessions with live subagents or monitors no longer look stopped
A background subagent or monitor can make the CLI call the API while no T3 turn runs. When that call is rejected, the rate_limit_event arrives with no turnState, so the adapter raised no usage-limit warning. A second later the CLI starts a turn of its own, which fails with an assistant `rate_limit` error and no fresh window event. The warning is the only rotation trigger, so Auto threads stopped on the exhausted account instead of moving and continuing. On bkt3, 2026-10-06 10:09 UTC, three Auto threads on `sam` stopped this way. Hold a blocking rejection that lands between turns on the session, drop it on any recovery event, and raise the same warning (same rate_limit_info detail) when the next turn fails with `rate_limit`. The rotation listener and account service are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An answer or approval sent to a thread whose provider session had stopped failed with "No active provider session is bound to this thread." Clients only close a pending request on a stale-request failure, so the card stayed open and every retry added another error row. Report these failures with the existing stale-request detail so the server count and every client close the request after the first attempt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(server): close question cards when their session has stopped
Brings stage up to expbkmain a5d6bb7 (bkmain 7c0b134 plus 8a30edb and PR #276): #273 desktop update feed, #274 sidebar live work over plan, #275 Claude limit auto-continue, 8a30edb between-turns rotation. Resolutions: - ClaudeAdapter.ts and ProviderCommandReactor.ts (+ tests) stay deleted: stage runs ClaudeAdapterV2 and orchestration-v2. 8a30edb and #276 target those files, so neither applies here as written. - claudeHardLimitRotation.expbkt3.ts keeps stage's trigger, the fork account.rate-limits.updated event carrying the raw rate_limit_event. Git auto-merged bkmain's runtime.warning trigger into it, which the V2 adapter never emits, so rotation would have silently stopped. Kept from bkmain: the seven_day_overage_included type. Added: a rejection that provisioned overage absorbs is not a trigger (the adapter's own rule). - PhaseGroupedSidebar.tsx keeps stage's archive-progress props and takes #274's four-argument row class. Stage port of the rotation fix: ClaudeAdapterV2 sent the trigger only when claudeRateLimitEventToUpdate produced windows, and a real rejection carries its fraction only under unifiedWindows, so no rejection reached rotation. The converter now reads unifiedWindows (from e826c31), and the adapter sends the trigger for every rejection, with no windows when none can be drawn (model-scoped types). The V2 adapter already emits it before the active-turn check, so between-turns rejections are covered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… shell uses #274's phaseSidebarIsAgentLive picked the bkmain shell's `session` field, which stage's ThreadShell names `runtime`, so the stage merge failed the client-runtime typecheck and the liveness test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bk-agent-01
added a commit
that referenced
this pull request
Oct 6, 2026
stage moved to 668aab6 (PR #277: expbkmain and the Claude rotation port) while the upstream merge was in progress. Two conflicts: one import line in ClaudeAdapterV2.test.ts, and the restored claudeUsageLimits test, which git moved out of provider/Layers/ (flattened upstream). publish-bk-desktop-dmg.ts follows the new prefer-catch-tags lint rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
stagedid not have the newestbkmainwork, and Claude account rotation could not fire onstage.stagelacked 7 commits fromexpbkmain(a5d6bb775): fix(desktop): BK T3 Code finds updates again #273 (desktop update feed), fix(web): sessions with live subagents or monitors no longer look stopped #274 (sidebar), fix(server): Claude threads continue after an account hits its limit #275 (Claude limit auto-continue),8a30edb73(rotation when the limit hits between turns) and fix(server): close question cards when their session has stopped #276 (question cards).claudeRateLimitEventToUpdatereturned windows. A real rejection carries its fraction only underunifiedWindows, so no rejection reached rotation onstage.What this PR does
It merges
origin/expbkmainintostage. It does not changebkmain.It resolves the conflicts for the stage code:
ClaudeAdapter.ts,ProviderCommandReactor.ts(+ tests)stagerunsClaudeAdapterV2and orchestration-v2, so8a30edb73and fix(server): close question cards when their session has stopped #276 do not apply here as written.claudeHardLimitRotation.expbkt3.tsaccount.rate-limits.updatedevent with the rawrate_limit_event). Git auto-merged thebkmainruntime.warningtrigger, but the V2 adapter never sends that event, so rotation would have stopped without an error. Frombkmain, it keeps theseven_day_overage_includedtype. It adds the adapter's overage rule: a rejection that overage absorbs is not a trigger.PhaseGroupedSidebar.tsxIt ports the rotation fix to
stage:claudeUsageLimits.tsreads the fraction fromunifiedWindowswhen the top-level value is missing (frome826c31ba).ClaudeAdapterV2.tssends the trigger for every rejection. When no window can be drawn (model-scoped types), the trigger has no windows. The adapter sends it before the active-turn check, so a rejection between turns also triggers rotation.Tests
ClaudeAdapterV2.test.tscase: the real bkt3 frame, once during a turn and once between turns, plus aseven_day_opusframe. Each sends one trigger.seven_day_overage_includedtriggers rotation.claudeUsageLimits.expbkt3.test.ts.Not in this PR
ProviderCommandReactor.ts, whichstagedoes not have. The owner of fix(server): close question cards when their session has stopped #276 must decide whether orchestration-v2 needs the same fix.Model: Claude Opus 5.5, Claude Code harness in T3 Code.
🤖 Generated with Claude Code