已合并
fix(acp): propagate prompt errors and transport termination #165
fix(acp): propagate prompt errors and transport termination #165
已合并
guantw创建于 1 天前
guantw成员
1 天前

Summary

Propagate ACP prompt errors and transport termination to the active turn so a failed request no longer leaves BitFun waiting indefinitely. Preserve partial output, final replies, cancellation, and same-session retries.

Type and Areas

Type: Bug fix and regression coverage.

Areas: ACP client request lifecycle and transport handling.

Motivation / Impact

The ACP SDK queues successful prompt stop reasons but can leave the session update reader waiting when a prompt fails or agent output closes. Track the prompt response independently and process transport termination after queued frames, allowing the existing turn-failure path to report the error.

Verification

  • Seven focused regression tests passed using the production helper code compiled for HarmonyOS AArch64 and executed under QEMU: prompt errors and retries, partial output, cancellation, connection termination, and final success/error responses immediately followed by EOF.
  • An unsigned HarmonyOS HAP containing this fix was built and checked for package integrity and native-library provenance before rebasing. The user confirmed Qwen and OpenCode network failures were reported correctly on device.
  • Rebase/cherry-pick completed without conflicts. ACP files match the previously validated version; git show --check passed. No additional HAP build was run after rebasing.
  • Remote workspace, remote control, Peer Device Mode, and Detached Dispatch were not exercised.

Reviewer Notes

The transport-closure marker is injected only into the client incoming queue; it is never sent to the agent. The ACP wire protocol and normal end_turn behavior remain unchanged. No external agent code or configuration is included.

Checklist

likedislike
Pull Request已成功合入, 合并人@SWangHash
(感谢 guantw 的贡献)
SWangHashSWangHash成员
1 天前 合入了pull request,合并节点 SHA:7732e7b3a355879cfbf8d11f37c9d7afe432d5e7