Skip to content

fix(desktop): resolve ask cards through the Host input path - #1293

Merged
vastsa merged 2 commits into
vastsa:mainfrom
mingkun968:fix/asktool-resolve-clears-host-input
Oct 2, 2026
Merged

vastsa merged 2 commits into
vastsa:mainfrom
mingkun968:fix/asktool-resolve-clears-host-input

Conversation

@mingkun968

Copy link
Copy Markdown
Contributor

确认过的提问卡片切窗口回来又冒出来:Composer 确认走了直连 sidecar 通道(askToolResolve → asktool.resolve),Host 那份 pendingInputs 没清;切回会话时 restorePendingInteractive 又把它读回来重建卡片。

改动(3 个文件,纯 fix):

  • apps/desktop/electron/main/agent-host-bridge.ts:新增 resolveAskByRequestId,按 requestId 找 Host 侧 open input,命中则走 agentHost.respondInput(先删记录再结算 sidecar);无命中返回 null。
  • apps/desktop/electron/main/ipc/agent-ipc.ts:askToolResolve 先走 bridge,命中直接返回;未知请求 fallback 直连 sidecar,保证兼容。
  • apps/desktop/test/asktool-resolve-clears-host-input.test.mjs:新增 2 个单测(命中结算后 pendingInteractive 为空且 sidecar 被调一次;未知/空身份返回 null 且不调 sidecar)。

验证:

  • 新增单测 2/2 通过;周边 bridge/restore 单测 13/13 通过;desktop typecheck 通过。

Composer ask confirmations went straight to the sidecar, leaving the
Host-owned pending input behind. Switching windows back to the session
re-read it via pendingInteractiveRequests and resurrected the already
answered card. askToolResolve now settles the matching Host input first
(clearing it before the sidecar resolves) and keeps the direct sidecar
resolve only as a fallback for unknown requests.
@vastsa
vastsa merged commit e21c6a2 into vastsa:main Oct 2, 2026
4 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 57a7e031 Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants