Repository navigation
fix(console): a failed AI chat create gives back every message sent while it waited - #33673
Conversation
…or it ChatbotEnhanced takes an optional unsentText from the host; ChatPane hands it the joined held first message when the conversation create fails, so a second send made during the wait is not the only part that comes back. Pins the held send on a linked conversation that has not opened yet. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mV4rtksbPPvwm9w8L
|
domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8 Contract reviewServed-tier: Inputs: card #33562 (body + 3 comments: claim 6889053115, unblock 6889055942, os-dev-report 6889844803), card #33567 (body + triage 6886866267 + claim 6889061870), PR #33673 body and its 5-file net diff, and the head's check-runs. Code outside the diff ( Check-runs at render (36): 10 success, 13 skipped, 13 in_progress, 0 failure. Green: Check Changeset, Check PR Size, PR-body guards, Governed Surface Queue Guard, Type Check · workspace, Type Check · debt ledger, Test Core, Dogfood Regression Gate, Auto Label, filter. Still running: Build UI Deps, Plan Test UI shards, Live E2E UI, Type Check · source gates / consumer gates, and the 8 Lint jobs. This verdict covers the contract. It does not replace the gates, which must finish green before the merge. ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
… it was sent The restore comment and the prop doc now say that a held suggestion chip comes back through unsentText too, and a unit pin holds it, with the composer-only CONTROL that restores no chip text. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mV4rtksbPPvwm9w8L
|
domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8 Contract reviewServed-tier: Delta record on the round-1 record (PASS on d32d4df, comment 6889891363). Inputs: that record, the delta d32d4df..07caf19 (one commit, Check-runs on 07caf19 at render (56): 40 success, 15 skipped, 1 in progress, 0 failure. The one in progress is a second ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:ui#2 · os-project-manager · session_01FEkQ5oF8GgTHN2jBZoDwz8 席位核对Verdict: ACCEPT · head
|
…known, and gives back a send held when a linked conversation fails to load (objectstack-ai#33727) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XLXYgtfyzgVxE3YRd4MNb3s)_ Fixes objectstack-ai#33674 Fixes objectstack-ai#33685 Clause-②: no Metadata-protocol: none Seat `domain:ui#2` · os-project-manager · card thread `session_01FEkQ5peXUXXQ6HU4H89s6J` · claims 6890508556 and 6890872696 · one PR for both cards, two commits (one per card), as the seat ruled. ## 维护者速读 - 改了什么:AI 对话(`/ai` 全页、控制台聊天停靠栏、Studio copilot)两处输入丢失。① 会话还没确定时(打开会话链接正在加载,或新会话正在创建)在输入框里打了但没发送的文字,会话确定后不再被清空,光标停在末尾、焦点保留,不会自动发送;切换到另一个会话时草稿不跟过去(与今天一致)。② 打开会话链接后、会话还在加载时发出的消息,如果加载失败(5xx 或断网),不再永远转圈:消息退回输入框(连发两条时两条都退回,先后不变)并显示"未发送"提示,不发送任何内容;再发一次会重新加载该会话并只发一次。 - 为什么改:① 聊天面板以会话 id 为 key,id 确定时整块重建,输入框里的文字随旧面板一起丢弃(objectstack-ai#33673 开发者实测)。② 会话加载失败的 catch 只清空 id,既不让发送去创建会话,也不通知宿主,暂存的消息就一直挂着(objectstack-ai#33673 契约复审发现,开发者实测)。 - 风险与回滚:只改前端私有包 `@object-ui/app-shell` 的两个文件(`AiChatPage.tsx` 的 `ChatPane`、`useChatConversation.ts` 的加载失败分支),不改 `ChatbotEnhanced` 的属性、服务端、spec;面板 key 保持不变。回滚即还原本 PR(两个提交可分别还原)。 - 先看:`ui/packages/app-shell/src/hooks/useChatConversation.ts`(resolve 的 `catch` 与 `ensureConversation` 的重试分支)、`ui/packages/app-shell/src/console/ai/AiChatPage.tsx`(`useComposerDraftHandoff` 与 `ChatPane` 的 `requestedConversationId`)、`ui/packages/app-shell/src/console/ai/__tests__/AiChatPage.firstMessageDrawnAtOnce-33420.test.tsx`(新增的钉子)。 - 两分钟验证:pnpm dev,打开 `/ai/build`,发一条消息后在会话创建期间输入第二段文字不发送:创建完成后第二段仍在输入框里。再在开发者工具把 `GET /conversations/ID` 设为 503,打开 `/ai/build/ID` 时立刻发一条消息:消息退回输入框并出现未发送提示;取消拦截后再发,只发出一次。 - 需要你做的:无,席位落地。 ## What changes ### objectstack-ai#33674: a draft typed before the pane knows its conversation survives the id remount (commit 0d69e25) `ChatPane` is keyed on `${chatApi}:${conversationId ?? 'pending'}` in all three hosts, and the composer's text lives inside the pane, so the remount from `…:pending` to the real id dropped text typed but not sent: on a deep link whose conversation GET answers, and on a new conversation whose create answers while a second message is being typed. - **The key stays.** Everything else in the pane (the chat runtime, its messages, the held first message's bookkeeping) belongs to one conversation and must reset with it; only the composer's text is carried. - **New hook `useComposerDraftHandoff` (in `AiChatPage.tsx`, called by `ChatPane`).** A pending pane (no conversation id) reads its composer box (`textarea[name="message"]` inside the pane) as it unmounts and leaves the text, whether the box had focus, the chat endpoint and the conversation the host was asking for when the text was last typed. The replacing pane reads that in its mount layout effect, in the same commit, and puts the text into its empty box with the cursor at the end, focusing it when the old box had focus. Nothing is sent. A microtask drops a hand-off no pane took, so it never reaches a later, unrelated mount. The hand-off is keyed by the host's page-owned `pendingFirstMessageRef`, the one object a host keeps across the remount, so two hosts never trade drafts. - **What is carried, and what is not.** Only from a pending pane (a pane that already had a conversation hands nothing on); only to a pane with an id on the same endpoint; and only while the host still asks for the conversation it asked for when the text was typed. That last guard is the new optional `ChatPane` prop `requestedConversationId`, which the `/ai` page passes (`urlConversationId ?? legacyConversationId`, the same value it gives `useChatConversation` as `activeId`). The dock and the Studio copilot pass nothing, which matches their `activeId: undefined`, so neither host file changes. Decision for the order's third CONTROL: opening ANOTHER conversation leaves a draft behind, both from a new chat and from an open conversation (today's behaviour), and a pin holds it. - `ChatPane` passes the hook's recorder to `ChatbotEnhanced`'s existing `onInputChange`. No new `ChatbotEnhanced` prop, so `@object-ui/plugin-chatbot` is untouched: `Clause-②: no`. ### objectstack-ai#33685: a send held while a linked conversation loads is given back when the load fails (commit 8702038) On a deep link (`/ai/build/conv-7`, and the dock resuming a cached conversation the same way), a send made while `GET /conversations/conv-7` is pending is held by `useDeferredFirstSend` and recorded by `ensureConversation`. When that GET failed with a 5xx or a network error, the resolve's `catch` cleared the id without settling the surface and its `finally` dropped the recorded request, so the held message hung with its thinking dots, nothing was sent and no notice showed. - **The `catch` now reports to the recorded send.** When a send was recorded during the failed run, the hook sets `createError` to a not-sent error (the GET's status when it had one). That is the existing objectstack-ai#33420 / objectstack-ai#33562 path: `useDeferredFirstSend` drops the held message and `ChatPane` hands its text (joined parts included) to `ChatbotEnhanced` as `unsentText`, so the box gets the text back with the not-sent notice. Nothing is sent and no create is made. - **A retry works.** The `catch` marks the key as failed. The next `ensureConversation` for that key, finding nothing resolving, records the request, clears the old `createError` and runs the resolve again (a `resolveAttempt` counter in the resolve effect's deps). If the GET answers, the held message is sent once into `conv-7`, as objectstack-ai#33567's pin shows for a GET that answers the first time. - `fetchConversation`'s thrown error now carries `status` (the notice reads it); its 404 / 403 answer (`null`) is unchanged. - **The 404 path keeps today's behaviour**, measured and pinned: a held send on a deep link whose GET answers 404 settles on "nothing to resume", creates a new conversation and is sent once into it, with no notice. - The same-conversation guard in the `catch` (a failed re-read of the conversation already held keeps it) is untouched. ### Changesets `.changeset/33674-ai-chat-draft-survives-remount.md` and `.changeset/33685-ai-chat-failed-load-gives-held-send-back.md`: `@object-ui/app-shell` and `@object-ui/console` patch each (app-shell is private and the console's `dist` ships it), both declaration lines `Clause-②: no` / `Metadata-protocol: none`. ## Tests All pins are in the objectstack-ai#33420 harness, `AiChatPage.firstMessageDrawnAtOnce-33420.test.tsx`: the REAL `AiChatPage` / `ChatDockConversation`, `ChatPane`, `useChatConversation`, `useObjectChat` transport and `ChatbotEnhanced`, driven through the composer, with `fetch` holding `GET /conversations/:id` and `POST /conversations` open until the test answers or fails them. **objectstack-ai#33674** (top-level describes `… a draft typed before the pane knows its conversation survives the remount`, `… switching to another conversation does not carry a draft`, `useComposerDraftHandoff — which remount carries the composer text`): - full page and dock, path (a): text typed while the conversation GET is held is in the NEW box (the old one is detached) when it answers: same text, cursor at the end, focused; nothing sent, no create. (The dock's link is the cached conversation it resumes with the same GET.) - full page and dock, path (b): first message sent, a second typed while the create is held; when it answers, the first is sent once and drawn once, the second is in the new box, not sent, not drawn. - CONTROL, full page and dock: a draft in an open conversation stays in the same box, unsent. - CONTROL, full page: a draft typed in a new chat, then another conversation opened (navigate to `/ai/build/conv-9`, its GET answers): the box is empty. Likewise from an open conversation to another. - hook unit pins: a pending pane hands its text on; a pane that already had a conversation hands nothing on; a pane on another chat endpoint takes nothing; a hand-off no pane took in the same commit is dropped. - CONTROL for submitted messages: the existing objectstack-ai#33420 / objectstack-ai#33562 / objectstack-ai#33567 pins in the same file stay green (held and sent once). **objectstack-ai#33685** (top-level describe `… a send held while the conversation loads, when the load fails`, on the full page and on the dock): - GET 503 and GET network error: the bubble goes, the box holds the message, the not-sent notice shows, nothing sent, no create. - two sends during the held GET, then a 503: the box holds `first part\n\nsecond part`. - retry: after the 503, sending what the box holds draws it, clears the notice, re-runs the GET; when it answers the message is sent once into `conv-7`, no create. - CONTROL: a GET that answers sends the held message once (the dock's leg is new; the page's leg is also objectstack-ai#33567's pin). - CONTROL: a 404 creates a new conversation and sends the held message once into it, no notice. The harness's held GET now also takes a network failure (`Held.fail`). <details><summary>Red first, on origin/main 5604aeb (which carries objectstack-ai#33673)</summary> - objectstack-ai#33674: sources at 5604aeb, harness at commit 0d69e25: 8 failed / 14 passed. The four path pins (page + dock, paths a and b) fail `expected '' to be 'add a due date field'` / `expected '' to be 'and add a due date'`, the box comes back empty; the four hook unit pins fail `useComposerDraftHandoff is not a function` (the hook does not exist on base). Every CONTROL is green on base. - objectstack-ai#33685: `useChatConversation.ts` at 5604aeb, everything else at 0d69e25, harness at 8702038: 8 failed / 26 passed: GET 503, GET network, joined, retry, on the page and the dock (the box stays empty, the bubble stays drawn). Both CONTROLs (a GET that answers; the 404 path) are green on base, on both hosts. </details> <details><summary>Ablations, through scripts/ablation-replace.mjs (ui vitest resolves app-shell from src, no build), each restored with the blob equal to HEAD and git diff HEAD empty</summary> Run over the whole harness file (34 tests): - A1, the restore write removed (`box.value = handoff.text;` to `void handoff.text;`): 5 failed / 29 passed, the four path pins and the hook pin "a pending pane hands its text to the pane that gets the id". - A2, the requested-conversation guard made always true: 1 failed, "a draft typed in a new conversation stays behind when the user opens another one". - A3, the pending-only guard (`if (conversationId) return;`) made never true: 1 failed, "a pane that already had a conversation hands nothing on". - A4, the microtask expiry removed: 1 failed, "a hand-off no pane took in the same commit is dropped". - A5, the endpoint guard made always true: 1 failed, "a pane on another chat endpoint takes nothing". - B1, the `catch`'s report skipped (an early return after marking the key failed): 8 failed / 26 passed, the eight objectstack-ai#33685 pins. A first attempt at this leg was refused by the tool before running (its replacement still contained the anchor, so the anchor count did not drop) and measured nothing; it was redone with a distinct replacement. - B2, the retry branch in `ensureConversation` made never true: 2 failed, the two retry pins (page and dock). </details> ## Acceptance notes - **Reachability.** Every pin drives the rendered page through the composer's real input events (`change`, `submit`) and real request timing (held then answered or failed `fetch`); the hand-off is read from the DOM box the next pane renders, not from the hook. - **The Studio copilot** renders the same `ChatPane` with no `requestedConversationId` (its `activeId` is undefined), so it takes both fixes unchanged; it has no rendered pin of its own here, the order names the page and the dock. - **A draft typed in a new chat before switching agent** (ask to build) is not carried: the endpoint differs. Unchanged from today. - **The dock moving between apps:** a draft typed in the dock's pending pane of app A, then the dock moving to app B, stays in the same pane while B resolves (same key, no remount, as today) and is now kept when B's conversation lands. A draft typed in an open conversation of app A is not carried. Not pinned beyond the hook unit pins. - **Out of scope, unchanged:** the latency of `POST /conversations`, objectstack-ai#33561's first-message drawing, server, spec and cloud. - **Three commits, not two.** The seat asked for one commit per card. A third commit, 8500bab, changes four lines of the test harness (the navigate helper sets its module variable from an effect instead of during render; `react-hooks/globals` refused the first form). The branch is the thread's harness branch, so it is not rewritten (AGENTS.md multi-agent §3, criterion ①). ## Verification <details><summary>Local gates, type-check, lint and suites (head 8500bab, base origin/main 5604aeb)</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derives 38 families for this diff (tree 8500bab; the same list as at 8702038). All 38 exit 0 on 8500bab after the `@object-ui/app-shell^...` closure build plus a rebuild of the ui packages the rebase moved. `pnpm --dir ui exec vitest run scripts/` first answered exit 99 (the lock's queue budget ran out behind the chat suites, nothing measured) and was re-run alone under the lock with `--maxWorkers=2`: 171 files passed, 2 skipped, VERDICT command-exit 0. `--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. - `pnpm --filter @object-ui/app-shell run type-check`: exit 0. - ESLint (`--no-inline-config`) on `AiChatPage.tsx`, `useChatConversation.ts` and the harness: exit 0, 0 errors; one more warning than on base, `react-refresh/only-export-components` for the new exported hook (the file already exports `useDeferredFirstSend` the same way). - `pnpm check:new-line-citations` (from `ui/`): 0 new citations, exit 0. - Suites under the lock, `pnpm exec vitest run --maxWorkers=2` from `ui/` over `packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx`, `packages/app-shell/src/console/ai/`, `packages/app-shell/src/layout/`, `packages/app-shell/src/views/studio-design/` and `packages/plugin-chatbot/`: 627 files, 4848 tests passed (VERDICT command-exit 0, head 8500bab). - `origin/main` moved to ee627c6 while the gates ran; none of those commits touches `ui/packages/app-shell/` or `ui/packages/plugin-chatbot/`. - The full app-shell suite and the rest of the farm are CI's. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5peXUXXQ6HU4H89s6J --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5peXUXXQ6HU4H89s6J)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Fixes #33562
Refs #33567
Clause-②: yes (widening)
Metadata-protocol: none
Seat
domain:ui#2· os-project-manager · card threadsession_01FEkQ5mV4rtksbPPvwm9w8L· claim 6889053115维护者速读
POST /conversations)等待期间连发两条消息,若创建失败,输入框现在拿回两条(先第一条、后第二条,与合并发送时的顺序一致),再发一次即把合并后的文字发出且只发一次;之前只拿回第二条,第一条丢失。为此ChatbotEnhanced(@object-ui/plugin-chatbot)新增一个可选属性unsentText,由宿主告诉它"未发出的是哪段文字";不传时行为不变。另一张卡 AI chat: a message sent from a conversation link before the conversation finishes loading may be dropped (seen in a test harness, unconfirmed) #33567(打开会话链接后、会话还没加载完就发消息会丢)实测不复现:在页面里发出的消息会被暂存并在会话打开后发出一次;当初测试里看到的"丢失"是测试在一个已被替换掉的旧输入框里打字。本 PR 只为它加一条钉子测试。ChatPane给ChatbotEnhanced的unsentText)、ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx(未发送恢复的 effect 读unsentText)、ui/packages/app-shell/src/console/ai/tests/AiChatPage.firstMessageDrawnAtOnce-33420.test.tsx(新增两组钉子)。/ai/build,在开发者工具里把POST /conversations设为失败并节流,连发「第一条」「第二条」:创建失败后输入框是「第一条」空行「第二条」,并有未发送提示;放开后再按发送,只发出一条合并消息。What changes
#33562. On a new conversation the first send creates the conversation, and
useDeferredFirstSendholds the message untilPOST /conversationsanswers; a second send during that wait joins the held one (first\n\nsecond, since #32984). When the create failed (#33420's rollback),ChatbotEnhanced's not-sent restore put back the text the composer itself last submitted, so the box got only the second part, and the held message (the only copy of the first part) was dropped so a retry would not send it twice. Measured onorigin/maind95ddeb through the rendered page: box"second part"(see Tests, red first).ChatbotEnhancedgains one optional prop,unsentText?: string: the text a not-senterrorgives back to the composer when the host, not the composer, holds what was not sent. The restore readsunsentText ?? lastSubmittedRef.current, once per not-sent error and only into an empty box, as before. One rule differs: on its own the composer restores only text the user typed (a chip or card send clearslastSubmittedRef, objectui#7253), while a host-namedunsentTextis restored however it was sent, a held suggestion chip included (see Acceptance notes). A host that passes nothing keeps today's restore. This is theClause-②: yes (widening)on@object-ui/plugin-chatbot.ChatPanepassesunsentText={conversationCreateError ? heldFirstMessage?.content : undefined}.heldFirstMessageis the joined held message AI chat: on a new conversation the user's first message is not drawn until POST /conversations answers, so the thread sits blank for that long #33420 already keeps in state for drawing; in the render the create error arrives in it is still set (useDeferredFirstSenddrops it in a passive effect of the parent, which runs after the composer's restore effect), so the composer gets the whole text. A handoff seed is never reported as held, so it still restores nothing of its own. All three hosts (the/aipage, the console dock, the Studio copilot) renderChatPane, so none needs a change..changeset/33562-ai-chat-failed-create-joined-restore.md:@object-ui/plugin-chatbot,@object-ui/app-shell,@object-ui/consolepatch (a widening shipspatch, AGENTS.md Post-Task Checklist step 3; app-shell is private and console'sdistships it).#33567 (measured first, does not reproduce). On a deep link to an existing conversation (
/ai/build/conv-7) with itsGET /conversations/conv-7held open, a message submitted through the composer is held byuseDeferredFirstSend(the pane is…:pending, soapiMode && !conversationId), drawn at once, andensureConversationrecords the request without creating anything (pendingKeyRefis unset while the resolve runs); when the GET answers, the resolve drops that request (finally: a run that found a thread), the pane remounts onconv-7and the replay sends the message once. The #33561 observation came from the harness:findByRole('textbox')resolved on the…:pendingpane's textarea, and by the time the test typed and submitted, the GET (answered at once there) had remounted the pane, so the test typed into a detached textarea (isConnected === falsebefore the change event) whose form React no longer listens to. No line drops a send. This PR adds the pin only.Tests
AiChatPage.firstMessageDrawnAtOnce-33420.test.tsx(the AI chat: on a new conversation the user's first message is not drawn until POST /conversations answers, so the thread sits blank for that long #33420 harness: the REALAiChatPage/ChatDockConversation,ChatPane,useChatConversation,useObjectChattransport andChatbotEnhanced, driven through the composer):first part\n\nsecond part(first part first), no bubble is left, the send-error notice shows, nothing was sent; submitting what the box holds retries the create and the chat request carries the joined text exactly once, and the notice goes. CONTROL: the existing single-send rollback (a failed create takes the bubble away and puts the text back in the composer, both hosts) stays green.conv-7held, a send → drawn once, not sent, no create; the GET answers → sent once intoconv-7, no create, drawn once, box empty. CONTROL: the existingCONTROL: a send in an existing conversation draws and sends as before(a send after the GET answers).ChatbotEnhanced.sendError.test.tsx: a host-namedunsentTextis what a not-sent error restores (the composer last submitted onlysecond part). The existing restore tests (429, generic 5xx) are the CONTROL with nounsentText.ChatbotEnhanced.sendError.test.tsx(patch round 1, 07caf19): a suggestion chip sent and then refused comes back when the host names it asunsentText; CONTROL in the same test: with nounsentTexta chip restores nothing (objectui#7253 unchanged).expected 'second part' to be 'first part\n\nsecond part'(the unit pin and both host pins); the AI chat: a message sent from a conversation link before the conversation finishes loading may be dropped (seen in a test harness, unconfirmed) #33567 pin is green on base, as the reading above says it should be.scripts/ablation-replace.mjson head d32d4df (ui vitest aliases@object-ui/plugin-chatbottosrc, so no rebuild), each restored with the blob equal to HEAD andgit diff HEADempty:ChatPanepassesunsentText={undefined}: 2 failed / 16 passed (both host pins; the unit pin and the single-send CONTROL stay green);unsentText(lastSubmittedRef.current || unsentText): 3 failed / 15 passed (the unit pin and both host pins);apiMode && !conversationIdANDed with an always-false term): 9 failed / 9 passed, the AI chat: a message sent from a conversation link before the conversation finishes loading may be dropped (seen in a test harness, unconfirmed) #33567 pin among the red; the existing-conversation CONTROL stays green.Acceptance notes
ChatPaneis keyed on${chatApi}:${conversationId ?? 'pending'}, and the composer's text lives in the pane. A rendered probe onorigin/maind95ddeb: on/ai/build/conv-7with the GET held, text typed (not sent) into the composer is gone when the GET answers (new box""); on/ai/build, after a first send, a second message typed but not sent is gone when the create answers (new box"", only the first part sent). A submitted message is never lost on either path. Reported for the seat to file; it needs the draft to outlive the remount, outside this card's ruling.POST /conversationsand fix(console): draw a new AI chat conversation's first message at once, and give its text back when the create fails #33561's first-message drawing are unchanged (the order's ⛔).unsentTextis read only on a not-senterror; a streamed-response error and a clean submit are unchanged.ChatPanenames the held text asunsentText, so the chip's text comes back into the composer; before this PR nothing came back, because a chip send clearslastSubmittedRef. It returns the message that was not sent, not a stale delivered prompt, which is the harm objectui#7253 guards against. The restore comment and the prop doc say so, and a unit pin holds it./ai/build/conv-7, a message sent whileGET /conversations/conv-7is held, then the GET answering 503 or failing as a network error: after 3 s the bubble and thinking dots are still drawn, nothing is sent, no create is made, no notice shows and the box is empty; a second send joins the held one and hangs the same way (still nothing sent, no create, no notice). Mechanism: the resolve's catch inuseChatConversation.ts(L1221 onward) clears the id without settling the surface (pendingKeyRefstays unset, so no create is ever allowed) and itsfinally(L1231) drops the recorded request, and no error reaches the host. This PR's diff does not touch that path.Verification
Patch round 1: local gates, type-check, lint and suites (head 07caf19)
ChatbotEnhanced.tsxcomments (the restore effect and theunsentTextdoc) and adds one test toChatbotEnhanced.sendError.test.tsx; no runtime line moved.dispatch-gates --commandsderives the same 37 families at 07caf19; all 37 exit 0 after the@object-ui/app-shell^...closure build;--ran: 37 derived, 37 run, 0 NOT-MEASURED, 0 UNRUN.@object-ui/app-shelland@object-ui/plugin-chatbottype-check: exit 0. ESLint (--no-inline-config) on the four changed source and test files: exit 0.check:new-line-citations(fromui/): exit 0.ui/:AiChatPage.firstMessageDrawnAtOnce-33420.test.tsxand all ofpackages/plugin-chatbot/: 100 files, 968 tests passed (VERDICT command-exit 0). Narrowed from the first round's 627-file run because no runtime line changed; CI runs the full suites.Local gates, type-check, lint and suites (head d32d4df, first round)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives 37 families for this diff (tree d32d4df). All 37 exit 0 on d32d4df, after the@object-ui/app-shell^...closure build (lock VERDICT command-exit 0).--ranreconciliation: 37 derived, 37 run, 0 NOT-MEASURED, 0 UNRUN.pnpm --dir ui exec vitest run scripts/ran alone under the lock with--maxWorkers=2.pnpm --filter @object-ui/app-shell run type-check: exit 0.pnpm --filter @object-ui/plugin-chatbot run type-check: exit 0. ESLint (--no-inline-config) on the four changed source and test files: exit 0.pnpm check:new-line-citations(fromui/, ui/AGENTS.md Migrate documentation site to Fumadocs with monorepo structure and shared content #11): 0 new citations, exit 0.pnpm exec vitest run --maxWorkers=2fromui/overpackages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx,packages/app-shell/src/console/ai/,packages/app-shell/src/layout/,packages/app-shell/src/views/studio-design/andpackages/plugin-chatbot/: 627 files, 4821 tests passed (VERDICT command-exit 0, head d32d4df).origin/mainmoved 36 commits since base d95ddeb while the gates ran; none touchesui/packages/app-shell/src/console/ai/,ui/packages/plugin-chatbot/oruseChatConversation.ts.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5mV4rtksbPPvwm9w8L
Generated by Claude Code