feat(desktop): consume task submission readiness - #2523
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks—this is a good direction. Two non-blocking P2 suggestions:
- For an unlocked stale session, this can disable Send even though the existing send authority would rebind it to a healthy connection. Please reuse the session-send projection.
- Readiness is cached by the hook and not refreshed when Send is clicked, so runtime/workspace changes can bypass or stale the gate. Consider a final send-time check while keeping
unknownfail-open.
P3: route the workspace action from repairTarget; “New task” can be a no-op when already on that surface.
|
Addressed all three suggestions in
Added the stale-session rebind behavior case; 18 targeted readiness tests, Desktop main build, and Renderer typecheck pass. 已在 |
|
Thanks for addressing the previous round — I should have been more explicit about ownership in my send-time suggestion. The remaining issue is not the refresh itself, but keeping authorization and execution bound to the same submission target.
The smallest patch would be to capture the composer owner before the await and cancel if it changes. The cleaner fix, and my preference, is to move the readiness guard into |
|
Fixed in
22 related tests pass, along with Desktop main build and Renderer typecheck. 已在 |
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for moving the readiness check into the stable send() ownership boundary. The previous P2 is resolved: the owner is captured before the await, revalidated before any Session creation, attachment ingest, or send, and ordinary/Graph/Swarm submissions now share the same guard. The deferred Session-switch regression covers the original failure well.
One optional P3: requestSequence prevents a superseded checkNow() result from overwriting UI state, but the old call still returns its snapshot to the send-time decision. Two overlapping reads that settle out of order can therefore briefly disagree about whether to send. It may be worth returning/carrying the generation and cancelling when the send-time result has been superseded.
This is timing-dependent and remains fail-safe at the Host authority, so it does not block this PR. All checks are green and I found no remaining P1/P2 issues.
English
What changed
repair_requiredorunavailablestates;unknownand loading states remain non-blocking.Validation
npx biome check(changed files)Known baseline issue
@maka/uiatsrc/tool-activity.tsxbecauseChatToolCallItemdoes not exposeactivateLabel/onActivate. Desktop builds pass after rebuilding the other workspace dependencies; this PR does not touch that code.中文
改动内容
repair_required或unavailable时禁止提交;unknown和加载中不会阻塞用户。验证
已知基线问题
@maka/ui/src/tool-activity.tsx停止,因为ChatToolCallItem尚未暴露activateLabel/onActivate。重建其余依赖后 Desktop 构建均通过;本 PR 未修改该处。Refs #2497
Related to #2469