Repository navigation
feat(server): update Chat mode sub-thread labels at fixed user-message counts - #260
Merged
Merged
Conversation
…, then every 10 The sub-thread label ran the text-generation model on every message. It now runs only when a user reply brings the sub-thread's user-message count to 1, 3, 6, 10 or a later multiple of 10 since the reply the label covers, and once when an agent answer opens a sub-thread that has no label yet. The count follows the typed user messages that Chat shows, in timeline order (rolled-back turns, undelivered queued replies, server-made and empty Resume messages do not count). One table keeps the covered position per sub-thread and one keeps the replies whose run did not store a label, so a second wrap of one starts no run. Wraps of one sub-thread run one at a time; the label and the covered position are stored in one transaction that rechecks the reply still shows with the same text. ShownHistory exports its typed-message SQL so both use one rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
This change limits how often Chat mode sub-thread labels update.
改了什么行为
Behaviour change: yes, users in Chat mode see sub-thread summary labels update at fixed user-message counts instead of every message.
Before, every reply, answer, and rewrite updated the label. Now it runs at reply 1, then user messages 3, 6, 10, and every 10 after. A user first message counts as 1, so replies 1 and 2 update it. Under an agent message, replies 1, 3, 6, 10, and every 10 after do. An agent answer that opens a sub-thread under a user message makes its first label. Other answers and rewrites start no run beyond a due one. Failed calls keep the old label and retry on the next user reply. Restarts skip done counts.
Why
Each update costs a model call. Running at these counts avoids a call per message.
Checks
vp run check:changedpassed for format, lint, knip, typecheck, and tests.How to undo
Revert the commit. The two new tables stay unused, and labels return to every message.
Details
How it works:
apps/server/src/fork/subThreads/SubThreads.ts, its test file, andapps/server/src/fork/shownHistory/ShownHistory.tschange.ShownHistory.tsnow exports its typed-user-message SQL so both files share one rule.Accepted limits:
Surfaces not changed: