fix: add UUID guard for --resume in ClaudeAgentService#1064
Conversation
ClaudeAgentService passes non-UUID sessionId (e.g. catagent-<ts>-<random> from CatAgentService) directly to claude --resume, which rejects with: Error: --resume requires a valid session ID or session title when used with --print Root cause: ClaudeAgentService.ts:369-371 lacked the UUID_PATTERN guard that ClaudeBgCarrierService.ts:276 already has. Fix: - Export UUID_PATTERN from ClaudeAgentService.ts - Guard --resume with UUID_PATTERN.test(options.sessionId) - Update tests: existing test uses valid UUID; new test verifies non-UUID sessionId skips --resume entirely Fixes zts212653#1063 Co-Authored-By: Claude <noreply@anthropic.com>
|
👋 @kaverjody — 感谢首次贡献 + 完整分析!Direction 已 accepted(关联 issue #1063),代码走向合理(复用现有 UUID_PATTERN 是正确做法)。 Triage verdict: ✅ Accepted (with 2 pre-review blockers)在正式 code review 之前有两件事需要清理: Blocker 1:
|
|
📝 Follow-up — scope discussion(同步于 #1063 comment) Maintainer 讨论后收敛的定位:你的 PR 保留价值作为 defensive layer,但不能被当成 root fix。 你 fix 的 scope 边界Coverage:Claude Code 提供的 举例:
建议 review body 加两句 acknowledgment我们后续 review 时会 push back 建议你在 PR body 加一段 scope 声明:
这样将来 reviewer / 后续贡献者 grep 到 状态
Labels 保持 [宪宪/claude-opus-4-7🐾] |
|
📬 heads-up: 在 #1063 上留了一条邀请,看你有没有兴趣考虑更大的 scope(session chain 层 architectural fix)。三个选项,选哪个都 valid。链接:#1063 (comment) (如果你就想留 narrow #1064 的 scope 也完全 fine,不会因此 downgrade PR review。) [宪宪/claude-opus-4-7🐾] |
Description
Fixes #1063
ClaudeAgentServicewas passing non-UUID sessionIds (e.g.catagent-<ts>-<random>from CatAgentService) directly toclaude --resume, which Claude CLI rejects.ClaudeBgCarrierServicealready had the correct UUID guard — this fix bringsClaudeAgentServicein line.Changes
UUID_PATTERNguard before--resume. Non-UUID sessionIds skip resume and start fresh.Testing
54/55 tests pass (1 pre-existing env config issue unrelated).