Repository navigation
Conversation
…from non-Desktop clients Clients without the codexhost renderer, such as the ChatGPT iOS app over SSH, call thread/settings/update before turn/start and list attachments and queued submissions for every open Thread. The Host rejected these for External Threads with -32076, which aborted every send from those clients. Answer them with the empty official response shape instead. Settings updates are acknowledged but not applied; the Harness keeps its own permission mode. Refs BytePioneer-AI#543 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
目的
修复 #543:ChatGPT iOS app 通过 SSH 连接 Remote Host 后,能看到 Claude Code External Thread,但发不出消息。
iOS app 在
turn/start之前会先调thread/settings/update,打开 Thread 时还会调thread/attachment/list和thread/queue/list。Host 对 External Thread 的这些请求一律返回-32076 External Thread does not support …,app 收到后就中止发送,turn/start根本发不出去。改动范围
packages/host-runtime/src/external-thread-official-defaults.ts。对 External Thread 的这三个方法,按官方ThreadAttachmentListResponse/ThreadQueueListResponse/ThreadSettingsUpdateResponse的结构返回空结果。thread/settings/update只确认、不应用。权限仍由 Harness 自己的 permission mode 决定,不会把官方的 sandbox / approval 套到 Harness 上。app-server-host.ts只在原有的-32076分支里查这张表,其他未支持的thread/*行为不变,这三个请求也不会转发给官方。docs/architecture/official-traffic-ownership.md补充了这个例外。把
approvalPolicy/sandboxPolicy映射到 Harness permission mode 留作后续讨论,本 PR 不做。验证
自动测试(Linux aarch64,Node 22.22.1):
packages/host-runtime/test/app-server-host.external-official-defaults.test.ts。覆盖三个方法返回空结果、不转发官方,以及其他未支持方法仍返回-32076。已确认去掉修复后该测试失败。npx vitest run --config tests/vitest.config.js packages/host-runtime/test/app-server-host:25 个文件通过、1 个跳过;296 个测试通过、2 个跳过(均为原有的跳过)。npm run lint、npm run typecheck通过;改动文件prettier --check通过。npm run check:rust(本 PR 没有改 Rust)和 e2e。实机验证(本地给已安装的 0.13.2
host-runtime.mjs打了等价补丁):codexhost remote stop && start后,iOS app 对 Claude Code Thread 发出了turn/start(turnTrigger: "remote_ios",不带model),Host 返回inProgress。Claude Code transcript 收到了这条消息,回复以item/agentMessage/delta流式推回 app。抓包细节见 [Bug] ChatGPT iOS app(SSH)无法向 Claude Code External Thread 发送消息:thread/settings/update 等方法被 -32076 拒绝 #543。关联 Issue
Fixes #543
🤖 Generated with Claude Code