Repository navigation
Description
area:cloud · #37142 thread · session_01JQwxbZNHwt6dj15KeoAPMP
Filing gate: ③ maintainer-directed (topic #36996). This is finding N4 of the contract review on PR #37215 (record 7160086862), filed by the #37142 thread as the seat's ACCEPT (comment 7160106004) asks. It is the same open nit #36999 left for its entry points.
Grading: area:cloud · Bug · p2 · evidence: read (code path below; no failing test yet).
维护者速读
- 问题:点「问 AI」会开一个新对话并盯住这条记录。如果用户还没发消息,就转去历史里点开另一个旧对话,这个旧对话原来盯住的记录会被这条记录覆盖。
- 影响:旧对话之后每一轮都带错记录。助手面板上的记录标签看得见,也可以手动移除,所以不会悄悄出错,但容易让人困惑。
- 要你做的:无。
What
In ui/packages/app-shell/src/layout/chatFocus.ts (useConversationFocus), a setChatFocus hand-off that lands while the host has no conversation id sets carry: true. The next id that arrives then takes that focus, whatever the id is. The derived-state branch reads carried = state.key === undefined && conversationId !== undefined && (state.carry || sendingRef.current) && state.entry.focus !== null.
The carry exists so a pin made before the drawer resolves its thread lands on the resolved thread ("pin, then open the drawer"). It cannot tell that resolve apart from a history row the user picks. So:
- The user clicks an
ask_aiaction.useAskAiHandleropens a fresh thread and pins the record with{ follow: true }. The fresh thread has no id, so the focus is held with carry. - Before sending, the user opens conversation X from the history list.
- X's id arrives while carry is still set. X takes the record, and its stored focus (
ai-chat-focus:X) is overwritten.
PR #37215 widened the window: every ask_ai click now lands on an unsent fresh thread.
Fix direction (for the implementer to confirm)
- Carry only onto the id the host resolves for the SAME target. Drop the carry when the dock's target names a different conversation (a history pick sets
target.conversationId). - Or have the host spend the carry when the scope or target changes, not only on the chip's own moves.
Acceptance
- A test in
layout/__tests__/chatFocus-36999.test.tsxcovers the sequence:ask_ai(orsetChatFocuson an unsent thread), thenpage.open({ agent, conversationId: 'conv-old' }), then conv-old shows and sends its own stored focus. - The existing "pin, then open the drawer" and first-send carry cases stay green.
Parent: #36996. Related: #37142, #37215, #36999.
Generated by Claude Code
Activity
objectstack-fleet commentedon Nov 25, 2026
repo:cloud#1 · os-warren · session_01JQwxbZNHwt6dj15KeoAPMP
Claim: PM loop round 1 (folded into PR #37215 at the seat's contract-review ruling)
Session:
session_01JQwxbZNHwt6dj15KeoAPMPThread session:
session_01JQwxbZNHwt6dj15KeoAPMPAccount:
os-warrenBranch:
claude/project-thread-1nmo7qWorktree:
objectstack(the #37142 card thread's own checkout)Domain:
domain:uiSeat:
repo:cloud#1File surface:
ui/packages/app-shell/src/layout/chatFocus.ts,ui/packages/app-shell/src/layout/ChatDockConversation.tsx,ui/packages/app-shell/src/layout/__tests__/chatFocus-36999.test.tsx,.changeset/37142-ask-ai-action-type.mdContainer & model:
M,mode:thread,model: TIER_DEFAULT,effort: highClause-②: no
Metadata-protocol: none
Responsibility:
objectstack console code (app-shell focus host) | none | any console user who clicks an ask_ai action and opens a history conversation before sendingThread-read: none
Premise: holds
Serial constraints cleared:
PR #37215 (same branch; this fix lands inside it)The contract review on PR #37215 (
76f9cdab, record 7160086862) graded N4 should-fix. The seat asked for the fix inside #37215, and the guard needs that before hand-off. Fix pushed at8c569968.objectstack-fleet commentedon Nov 25, 2026
triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE
First touch 2026-11-25T11:32Z. Confirmed as filed: area:cloud · Bug · p2, claimed by repo:cloud#1 and folded into PR #37215. The card is now linked under #36996, as its body says.