[Bug]: Swift iOS: tapping a delegated task in the Agents sheet fails with thread_not_found
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 apps/swift-ios/Core/OrchestrationV2Client.swift 中的 threadPath(约第 325 行)开始,它会对线程 ID 进行一次百分号编码;然后查看 apps/swift-ios/Core/HTTP.swift 中的 endpoint(约第 767 行),它会把这个已编码的路径赋给 URLComponents.path,并再次编码。把 endpoint 改为设置 percentEncodedPath 应该可以修复问题。完成标准是:回归测试显示线程 ID thread:a%3Ab 生成的请求路径为 /api/orchestration/threads/thread:a%253Ab/bounded,并且委派任务的线程能够在应用中打开。
由索引模型根据 Issue 内容生成。
描述
Opened on behalf of Ben by Claude Code (Opus 5.5).
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/mobile (experimental SwiftUI client, apps/swift-ios)
Steps to reproduce
- In a thread on a desktop host, have the agent call the
delegate_taskMCP tool (for example a Codex child task) and let it finish. - On iPhone, open the same thread in the Swift app (TestFlight).
- Open the Agents sheet. The delegated task shows as Completed.
- Tap the task row.
Expected behavior
The child thread opens, the same as it does on web and desktop.
Actual behavior
The app shows Could not open thread: thread_not_found. The child thread exists. t3_thread_read and desktop both open it.
Delegated-task thread IDs contain literal % characters, for example thread:delegated-task:command%3Amcp%3A<uuid>%3Adelegate-task%3A<clientRequestId>. The Swift client percent-encodes the ID twice, so it requests a thread that does not exist:
GET /api/orchestration/threads/thread:delegated-task:command%25253Amcp%25253A…/bounded
The server decodes the path once and looks up command%253Amcp… instead of command%3Amcp….
On t3code/rebuild-mobile-app-swift @ 52912fe7e3:
apps/swift-ios/Core/OrchestrationV2Client.swift:325(threadPath) encodes the ID once. It removes/?#%from.urlPathAllowed, so%3Abecomes%253Aand:is left alone.apps/swift-ios/Core/HTTP.swift:767(endpoint) assigns that already-encoded path toURLComponents.path. That setter expects an unencoded path and escapes%again, so%253Abecomes%25253A.
HTTPClient.threadSnapshot (HTTP.swift:274) pre-encodes with .urlPathAllowed and goes through the same endpoint, so it double-encodes too. Ordinary thread IDs are UUIDs with nothing to escape, which is why only delegated-task children (and any other ID containing %) hit this.
A likely fix is to set components.percentEncodedPath = path in endpoint and keep the per-segment encoding in threadPath. Fixed paths such as /api/orchestration/shell are already valid encoded paths, so they are unaffected. A regression test could assert that thread ID thread:a%3Ab produces the request path /api/orchestration/threads/thread:a%253Ab/bounded.
Impact
Major degradation or frequent failure
Version or commit
Swift app: TestFlight build 60 (code reference: t3code/rebuild-mobile-app-swift @ 52912fe7e3). Server: 0.0.46-nightly.20261008.2849.
Environment
iOS 27, iPhone. macOS host running the Nightly desktop app, connected over Tailscale HTTPS. Child task: Codex gpt-6.1-sol.
Logs or stack traces
# server.trace.ndjson, http.server GET
http.route: /api/orchestration/threads/:threadId/bounded
url.path: /api/orchestration/threads/thread:delegated-task:command%25253Amcp%25253A9dd2e492-724d-437f-b41a-cdc6ec10ec65%25253Adelegate-task%25253Averify-t3-workflow-vs-flowition-r1/bounded
user_agent: T3Code/60 CFNetwork/3896.100.1.2.1 Darwin/27.0.0
# sql.transaction failure
ProjectionStoreThreadNotFoundError: No orchestration projection exists for thread thread:delegated-task:command%253Amcp%253A9dd2e492-724d-437f-b41a-cdc6ec10ec65%253Adelegate-task%253Averify-t3-workflow-vs-flowition-r1.
# actual thread ID
thread:delegated-task:command%3Amcp%3A9dd2e492-724d-437f-b41a-cdc6ec10ec65%3Adelegate-task%3Averify-t3-workflow-vs-flowition-r1
Workaround
Open the child thread from desktop or web.
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 6 小时 53 分钟
- 30 天内合并 PR
- 222
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
bug via-triage
难度 2/5 1-3 小时 新手友好度 72/100
pingdotgg/t3code#20128 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: T3_CODE_ORCHESTRATION_INSTRUCTIONS has no carve-out for user- or repo-mandated CLI review workflows (unlike T3_CODE_BROWSER_TOOL_INSTRUCTIONS)可能已有人在做 @nivethass15102007-tech 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
pingdotgg/t3code#19908 · 1 条评论 ·
维护者通常 1 天内回复
-
accepted bug via-triage
难度 2/5 1-3 小时 新手友好度 70/100
pingdotgg/t3code#19536 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
[Bug]: Diff panel hides the current branch name and the arrow overlaps the base ref when the panel is narrow可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭accepted bug via-triage
难度 2/5 1-3 小时 新手友好度 72/100
pingdotgg/t3code#19048 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
bug category:ai category:devices effort:s
难度 2/5 1-3 小时 新手友好度 72/100
LanternOps/breeze#8943 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
-
area:reliability difficulty:easy help wanted points:100 Stellar Wave
难度 2/5 1-3 小时 新手友好度 80/100
Divinity-Labs/Lens#341 · 1 条评论 ·
维护者通常 1 天内回复