Repository navigation
fix(composer): skip predictions for occupied drafts - #6722
Conversation
Generated-by: Maka (GPT-6.1)
There was a problem hiding this comment.
I reviewed the six-file change at bbbb16f4236d37d9345361e978c6ab28121cf523 against Rust baseline 09ca38c23ae9d46214c2743e182fe018c6544429. I found no demonstrated P0–P2 issue in this scope.
The controller now separates continued ownership of an admitted prediction from permission to start a new one. Conversation.tsx:2414 admits a new request only after draft restoration completes and text, staged files and attachment rows are empty. messagePrediction.ts:271 applies that admission check after handling the existing request; typing therefore does not cancel an already admitted operation. The existing source, settings-revision, cancellation and receipt checks remain in place. Composer.tsx:82 also suppresses presentation during attachment restoration or while attachment rows remain.
I ran all 170 workbench JavaScript tests successfully with Node 24.18.1 and the locked, patched Pele dependency, including the eight prediction tests. Running the same eight tests with only the controller restored from the baseline gives seven passes and one failure: the occupied draft incorrectly starts a request while preferences finish loading. I also checked the production caller and the draft/attachment restoration gates. These are controller and component-source checks; I did not execute the complete native composer or a live remote prediction service.
The actual merge into 09ca38c2 succeeds. There is no database-schema or wire-contract change. CI run 42633305895, attempt 1 has since completed successfully at this same head, including its final aggregate. Current Rust has subsequently advanced to 12971e440e93af1501872ec8eaf6bd781360ba92 through #6726; an actual merge of this PR into that baseline also succeeds. The new baseline has its own pending CI; the previous run does not validate an arbitrary later integration.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
EnglishThanks for working on this! Avoiding new prediction requests when the composer already has a draft/attachment, hiding suggestions while attachments are restoring or uploading ( One design adjustment requested before merging: when the composer is occupied, please skip/retire an unstarted prediction for that turn instead of deferring it until the composer is cleared. Deferring an unsettled
Suggested state behaviorDistinguish three composer states in
Please also update the 简体中文感谢处理这个问题!在输入框已有草稿或附件时不发起新的预测请求、在附件恢复或上传期间隐藏建议( 合并前希望调整一个设计点:当输入框处于非空占用状态时,如果当前轮次的预测尚未发起,请直接跳过/退役本轮预测,而不要挂起等待输入框清空后再补发。 把未发起的
建议的状态行为在
同时请同步更新 |
Generated-by: Maka (GPT-6.1)
|
Thanks for the review. Addressed in 9238ef6: an occupied composer now retires an unstarted source, so clearing it does not dispatch a delayed prediction; restoration waits without retiring, and admitted predictions still finish. The tests also cover replacement while an older request drains and settings changes while occupied. All 173 workbench tests pass locally; the PR description records the remaining environment and native-renderer verification limits. — Maka (AI agent) |
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed the six-file change at 9238ef6c186022ebcc21a509466eadf4d5f5c683, including the follow-up to bbbb16f4. I found no demonstrated P0–P2 issue in this scope. The documented behavior now skips an unstarted prediction for an occupied composer rather than merely delaying it until the draft is cleared. A restoring composer waits for its contents before deciding. An already admitted prediction can finish, while source, context, preference-revision, cancellation and original-receipt ownership checks remain in place.
I checked the caller's restoring/occupied/empty classification, draft and attachment gates, the controller's skipped state and request-draining paths, and both README descriptions. All 173 workbench JavaScript tests pass with Node 24.18.1 and the locked, patched dependencies, including all 11 message-prediction tests. Running those same 11 tests with only the controller restored from bbbb16f4 produces seven passes and four failures: occupation while settings load, restoration waiting, a replacement source while an older request drains, and stale-result regeneration after a settings change. Biome accepts all four changed TypeScript/JavaScript files. The temporary controller replacement was restored and the worktree is clean.
The actual merge into current Rust c20025e904a94c2b68020c9705a6a1bb19fe9a7f succeeds. No database-schema or wire-contract change is introduced. Current-head CI 42741683570 has not completed, so the old commit's successful CI does not establish the current commit's result. I did not run native composer/IME integration, a live prediction service, full UI typechecking, or packaged-app and populated-session acceptance. The author's results remain attributed to the author.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
…ion-composer-draft
|
I compared the failed CI jobs against upstream before updating the branch:
Merged current — Maka (AI agent) |
There was a problem hiding this comment.
I reviewed integration commit c7e1d625fcc804a9dd5a8383cb050dd863b78fc6 and the six-file author patch against 853052bec2f7c31aaefcf0beceeb0c7ad504fbb5. Its tree is exactly the actual merge of previously reviewed 9238ef6c with that base, and the author patch has the same stable patch identity. There is no new author logic in this integration, and I found no new demonstrated P0–P2 issue in that scope.
The reviewed behavior remains: a restoring composer waits for its contents, an occupied composer skips an unstarted prediction, clearing it does not resurrect that same skipped source/context, and an already admitted prediction can finish under the original source/configuration/receipt fences. I checked the incoming Composer changes separately from those admission and presentation gates. The 173-test workbench result and the 11-test controller comparison (seven passes/four failures with the old controller) were executed at 9238ef6c; I did not rerun them locally at this integration commit or claim native-composer acceptance.
Current-head CI 42749835323 is still running but already has failures: CLI slice 2 times out in the copy/undo test at 69.721s (18 passes, one failure, 94 skipped), and Mac times out in desktop_file_gestures_preserve_drafts_and_stage_an_image at 65.552s (four passes, one failure, 17 not run). I read the original logs, verified checkout 61e0787c989358c2e4b868ca30f8a9cf6fb4a93a and matched its parents/tree to the actual merge. The unmodified base also fails the CLI test, and the earlier base has the same Mac test failure; I have not isolated a PR-specific cause. Windows also fails desktop_side_pane_keeps_its_draft_separate_when_closed_and_reopened at 72.801s (18 passes, one failure, three not run), with the same verified checkout; its cause is not isolated here. The old 9238ef6c run finished cancelled and does not establish this commit's result.
An actual merge into the newer Rust baseline a75113d8b7d0cccf181a4d4214dab962e9124ac2 now conflicts because that baseline deletes products/maka/workbench/tests/message-prediction.test.mjs while this PR modifies it. There are no schema or wire changes in this PR. Integration of the changed baseline contracts, full UI typechecking, native composer/IME behavior, live prediction-service checks, and packaged/populated-session acceptance remain unverified here. The author's results remain attributed to the author.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
|
The CI run after merging upstream, 42749835323, completed with failures:
I did not merge the PR. Local post-merge workbench tests passed (154/154). The native failures require further investigation or an upstream fix before a green aggregate. — Maka (AI agent) |
|
Windows side-pane follow-up (Maka, AI agent): I ran the real Windows For the control, I restored all six PR-modified files to upstream 853052b, verified This demonstrates the CI symptom exists without this PR, although the small sample does not establish whether timing affects its frequency. The test checks text by issuing Select All and Copy back-to-back. Upstream #6731 specifically addresses that keymap race; its Windows CI currently fails earlier at an unrelated No PR code change was made for this existing failure. — Maka (AI agent) |
Summary
Skip an unstarted next-message prediction when the composer contains a draft or attachment, including uploads. Clearing it later does not dispatch that turn's skipped prediction. While a saved draft or attachments are restoring, wait for their state before deciding whether to predict or skip.
An already-admitted prediction can finish and its result can be reused; typing or adding an attachment hides the suggestion without cancelling that request. A new turn or changed model context can predict normally. This preserves the source/configuration invalidation and prefix reuse introduced in #6568 without adding a setting or legacy behavior path.
Verification
node --test products/maka/workbench/tests/*.test.mjs: 173 passed at the review-fix commit.packages/plugin-sdk/tsconfig.acceptance.jsonandproducts/maka/bundle/tsconfig.json: passed. The full contracts / workbench UI type check passed at the original PR commit, but was not rerun for the review-fix commit.git diff --check: passed. The staged Biome, license and whitespace checks were run manually before committing because the pre-commit hook could not spawnbiome.cmdunder Node 26 on Windows.node scripts/ci.mjs check tooling-testshad 283 passes, 2 failures, and 3 skips: release signing could not generate a GPG key, and the archive/cache test could not find usable Python on PATH.node scripts/ci.mjs check formatwas blocked by a pre-existing ignoredthird-party/nsh/crates/gpui/targetdirectory without aCargo.toml. Native renderer integration tests were not run locally.Remaining verification
AI use
Tool(s) and scope: Maka (GPT-6.1) investigated the original implementation, implemented the change and review follow-up, and authored tests and documentation. The commits include Generated-by trailers.
Checklist
Does this PR entail a change in behavior?