fix: resume interrupted desktop turns after cli restart#468
Conversation
PR quality triageChanged areas: area:server CLI core policy: No CLI-core policy block detected. Missing-test policy: Blocked by policy until a maintainer applies Coverage baseline policy: No coverage-baseline policy block detected. CLI core files:
Coverage policy files:
Expected checks:
Test coverage signals:
Risk notes:
Hard merge gates still come from GitHub Actions, not AI review. Dosu handoff: Dosu can be used as the AI reviewer for risk explanation, missing-test prompts, and maintainer Q&A. If it does not comment automatically from the PR template, ask: @dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact. |
|
Here's my assessment of this PR across the requested dimensions: Changed-Area Risk: Low Missing Tests
Docs Impact: None Desktop Startup Risk: Negligible CLI Core Impact: None
Summary: This is a low-risk, well-scoped fix. The main concern is the coverage gate failure ( To reply, just mention @dosu. Docs are dead. Just use Dosu. |
|
补充本地审查备注:
|
This pull request updates the logic for setting the
CLAUDE_CODE_RESUME_INTERRUPTED_TURNenvironment variable in theConversationService. Now, this environment variable is only set when running in SDK sessions, ensuring that interrupted turns are only resumed in that context. The tests have also been updated to verify this behavior.Environment variable handling:
ConversationServiceso thatCLAUDE_CODE_RESUME_INTERRUPTED_TURNis only set to'1'when an SDK URL is present, ensuring that interrupted-turn resume is only forced for SDK sessions.Testing improvements:
CLAUDE_CODE_RESUME_INTERRUPTED_TURNis not set for non-SDK sessions, and updated existing tests to check for its presence in SDK sessions.## SummaryFeature Quality Contract
server/provider-runtime/desktop chat runtimesrc/server/__tests__/conversation-service.test.tsCLAUDE_CODE_RESUME_INTERRUPTED_TURN=1的断言bun test src/server/__tests__/conversation-service.test.tsartifacts/quality-runs/2026-05-15T14-29-07-357Z/report.mdartifacts/coverage/2026-05-15T14-31-31-634Z/coverage-report.mdserver-api/agent-tools/agent-utilscoverage command exited with 1changed-lines显示src/server/services/conversationService.ts为0% (0/10)4027e2dc-751f-4d88-90ca-35252e2ab4e4修改前测试截图(历史消息会丢失):

修改后测试截图(历史消息不丢失):
sdkUrl存在时注入CLAUDE_CODE_RESUME_INTERRUPTED_TURN=1src/server/services/conversationService.ts中该环境变量注入逻辑Verification
bun run verifyfor code changes, including the coverage gate.Verification notes:
bun test src/server/__tests__/conversation-service.test.ts16 passed / 0 failedartifacts/quality-runs/2026-05-15T14-29-07-357Z/report.mdartifacts/quality-runs/2026-05-15T14-29-07-357Z/junit.xmlartifacts/quality-runs/2026-05-15T14-29-07-357Z/logs/passed=6 failed=2 skipped=2impact-reportpolicy-checksdesktop-checksnative-checkspersistence-upgradequarantineserver-checkscoveragecoverage仍未通过,详见artifacts/coverage/2026-05-15T14-31-31-634Z/coverage-report.mdchanged-lines对src/server/services/conversationService.ts仍显示0% (0/10)server-checksfailed,详细原因见对应 lane logRisk
allow-cli-core-change.allow-missing-tests.allow-coverage-baseline-change.Additional notes:
@dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact.