Repository navigation
Promote stage to bkt3: plan supersession (#317) and Claude account revive queue (#322) - #324
Merged
Merged
Conversation
A superseded plan could come back as the thread's current plan and be implemented instead of the approved revision. - The provider event ingestor supersedes every other active proposed plan when a new one arrives, for every adapter (only Claude did it, in memory). - Continuing a thread in any interaction mode completes the plan the turn implements and supersedes any other open plan. A background-task wake does not count as a continuation. - Plan review's decided-plan write-back now reaches V2 through the new thread.proposed-plan.retire command; before, V2 rejected the legacy upsert and the error was swallowed. - The web no longer falls back to an earlier run's plan. - The approval prompt names the approved revision and plan id, and repeats the full plan when the agent wrote more than one revision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A retire that finds the plan already closed is an expected no-op, not a rejected command; plan review keeps closing the rest if one fails. - `/compact`, `/logout` and background-task wakes do not end an open plan; a queued message completes only the plan it names. - The web falls back to an earlier run's plan only while it is active, so a wake or a subagent thread keeps the banner and a closed plan never returns. - Fix the web type narrowing, fork markers and formatting in ProjectionStore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(TEC-1331) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TEC-1331) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TEC-1331) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…331) fix(server): only the newest plan stays actionable
A thread kept its PLAN pill, Plan Ready group and needs-human count for as long as its plan stayed active, even after plan mode was turned off. A plan now waits only while its thread is in plan mode, matching upstream's Plan Ready rule, so stale tags clear without a migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Remove the plan card's Preview button; Expand plan stays. - New header: icon, title, state, step count, reading time, and a Widen plan toggle that lets cards use the free width beside the chat. - Plan bodies get the chat's markdown features (skills, runnable shell commands, image preview, artifact templates). - HTML in a plan renders as a live themed page, like html_render: a whole HTML plan, a raw HTML document, or an html-render fence. - Selecting plan text offers Cite and the comment actions; highlights, pins and scroll-to-quote work on plans, and the panel labels them. - Plan-mode turns tell the agent how to add an html-render visual. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The plan-format hint joins the fork's plan policy only when plan submission is off, so provider replays keep their recorded input. - Compare a citation's message id with the plan id as plain strings. - Type the comments panel's message list so plans can join it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Plan HTML loads inline through srcDoc, so a frame opened on its own cannot run with the app's origin. The reader's theme is written into the page for the first paint and posted on change. - A remounted plan page starts at its last measured height, so the virtualised list does not jump. - A wide card starts after the timeline minimap's clickable strip. - Plan cards read a memoised slice of the timeline state. - Comment gutter bars sit in the card padding, not over the text. - Settings and docs no longer point at the removed Preview button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ke comments feat(web): plan cards render like chat, go wide, and take comments
…smissed When a run fails while the agent waits on a question (the provider stream closes, an event fails to ingest), the run ends and its provider session is detached, but the question stays pending with a live capability. Submit then failed with "Provider session ... was not found", dismiss failed with "This question needs an answer", and Stop was gone. A request whose session is detached or whose run has ended is now handled in message mode: an answer resolves it and reaches the agent as the next message, a dismissal closes it, and an approval closes without a reply. The composer marks such a question dismissible. Multi-select answers join their choices when sent as a message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A completed run no longer counts as ended: its session stays live and a background subagent can still wait on an approval. Failed, interrupted and cancelled runs do. - Read only the request's own run, and take it from the timeline item when the node has none. - MCP lists a question whose run failed or stopped as non-blocking, so t3_answer can dismiss it and t3_send_message no longer refuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed or dismissed fix(server,web): questions left by a failed run can be answered or dismissed
…spread load - A failed hard-limit move no longer leaves the rejection in the duplicate filter, so a new turn's rejection moves the thread (2026-10-16: a thread stayed on `sam` for 20 min while `tushar` had room). - Limit notices expire at their reset; the "all accounts are at their limit" notice is derived live from a durable revive queue (migration 1053). - A thread no account can take is parked and continued in waves as accounts reset (revive pass after every status poll); the 5-minute reset wait is now a queue entry, so a restart no longer loses it. - Auto threads move off an account over its fair share at turn boundaries, at most once an hour. - New claudeAccounts.leaveQueue RPC and a "Leave queue" item in the picker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alance - A revive checks it still owns the queue entry before it moves or continues the thread, so Leave queue / a user message during placement wins. - The duplicate filter forgets a condition after a successful move and when the first turn on the new account starts. - Rebalance runs only at a real turn end, pre-checks the last status before asking the switcher, backs off 5 min after a probe finds nowhere better, moves at most one thread per source account per status read, and writes only the row so the old session keeps its own attribution. - Parking no longer forks a revive pass; archived threads leave the queue; a passed reset time is no longer shown as expected. - Test counts for the new RPC (237) and migration 1053; formatting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…very turn start forgets stale limit keys Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…turn in flight The provider-level idle check also counted the failed turn that parked the thread, so a mid-turn thread never got its continue. Test for the race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(server): Claude accounts revive waiting threads after resets and spread load
…ezing bkt3 The minute pull-request sweep checked all 1,100 unsettled threads on bkt3. Each check starts 6-7 git processes and every start forks the 1.4 GB server on the event loop, so a sweep ran 50-95 s of every two minutes with the main thread saturated (55% of samples in uv_spawn). Replies took 504 ms median during a sweep against 2 ms outside it, and desktop connections hit their 15 s setup limit. A thread with no run or message for a day is now checked once every 30 passes; its own events still queue an immediate check. The agent toolkit's plan-flag correction read a run's turn items with an `IN (...) OR (...)` filter, so SQLite walked every item of the thread in ordinal order: 0.3-2.6 s per cold 30,000-item thread, measured as a 2.5 s event-loop stall at 10:32 UTC. Run filters now read through the (thread_id, run_id) index: 4 ms median on the same cold threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(server): pull-request sweep and plan-flag reads no longer freeze the server
Tushar, 2026-10-19: pull the latest bkt3 before the stage -> bkmain merge, and deploy to stage first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-10-19 Merge latest bkt3 (bkmain b7af1e6) into stage
tusharbhardwaj-bk
approved these changes
Oct 19, 2026
Collaborator
Author
|
Merged by bk-agent-01 on Tushar's approving review of head a26a040 (2026-10-19 14:51 UTC) and his "Merge when approved" / "i approved you can merge now" answers in the owning T3 session. |
This was referenced Oct 19, 2026
This branch was successfully deployed
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.
Summary
This PR promotes the full
stagebranch (nowa26a040f) tobkmain, on Tushar's instruction of 2026-10-17 ("merge full stage to bkmain"). It replaces #323, which carried only the Claude account commits.stagemerges intobkmainwith no conflicts. Thebkmain-only commits (#296 to #318, #321) stay as they are.Stage merges this PR carries
bkmain?orchestration-v2/Orchestrator.ts,ProjectionStore.ts,ProviderEventIngestor.ts,Layers/OrchestrationEngine.ts,planreview/*,packages/shared/src/planReview.ts,contracts/orchestrationFork.ts,web/session-logic.tsclaudeAccounts/*,persistence/ThreadClaudeAccount.ts, migration 1053, contracts, web pickerNet change against
bkmain: 43 files, +2430 / −171.Commits (non-merge) on
stagethat are not inbkmain34d6ad4b5efix(server): a revive skips its continue only when the shell shows a turn in flight4ca0a20b4cfix(server): revive skips the continue when a turn already started; every turn start forgets stale limit keysbbe817cc2dfix(server): review fixes for the Claude account revive queue and rebalance50ed9eff86fix(server): Claude accounts revive waiting threads after resets and spread load56e13066dcfix(server,web): review fixes for orphaned questions2a6abc88e0chore(web): mark the plan review lookup as a fork edite8ee65f5bafix(server,web): questions left by a failed run can be answered or dismissed09017432c4fix(web): review fixes for plan cards9e3b3f8bc3fix: keep replay input unchanged and fix plan citation typesa0d2255a52chore(web): mark the plan citation predicate as a fork edit0d144384c4feat(web): plan cards render like chat, go wide, and take commentse925a5bf52fix(web): the BK sidebar drops the PLAN tag once plan mode is off8dec884073chore(server): mark the queued-run plan supersession as a fork edit (TEC-1331)650ab2332dfix(server): detect wakes from the message, including notifications (TEC-1331)cc197621a2fix(server): a queued continuation ends the open plan when it starts (TEC-1331)f9554a0e8cfix(server): address review of plan supersession (TEC-1331)4753c0f4b8fix(server): only the newest plan stays actionable (TEC-1331)The #319 and #320 commits appear here because #321 promoted them as cherry-picks. Their content is already in
bkmain.How I tested
fd41ddad).fd41ddadsince 2026-10-16 17:15 UTC.stage. fix(server): Claude accounts revive waiting threads after resets and spread load #322 passed 2 fresh-context reviews and CI onstage, and the same 4 commits were green againstbkmainin fix(server): promote Claude account revive queue and rebalance to bkmain (#322) #323.~/.t3/nextbkt3-dev/deployed-shaand read theclaude.account.*lines (place-none,revived,rebalance,hard-limit) of the next production limit event.Risks and rollback
activeplan are fixed at their next turn, and there is no backfill.thread_claude_account. A rebalanced thread loses its prompt cache once, at most once an hour.bkmain. Migration 1053 stays applied and is harmless to older code.🤖 Generated with Claude Code (Claude Opus 5.5, T3 Code)