[Fix] Tasks stall when interrupted subtasks resume - #1470
Conversation
Review processThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging.
Current step: Ready for human maintainer review and approval. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (9)Check persistence and lifecycle invariants: awaited atomic writes, rollback or explicit partial-failure behavior, cross-window state consistency, stale listeners/watchers, cancellation, idempotency, and safe restart/resume without lost or d...⚙️ CodeRabbit configuration file Files:
Treat model, provider, MCP, path, command, and tool data as untrusted. Check approval and allowlist bypasses, injection and traversal risks, secrets/PII exposure in logs, abort and stream behavior, retries, provider compatibility, and enfor...⚙️ CodeRabbit configuration file Files:
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases. Check cleanup and deterministic async behavior and prefer shared typed test helpe...⚙️ CodeRabbit configuration file Files:
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths. Verify promises and errors are handled, existing helpers are reused, and new code introduces no `any`, unjustified dou...⚙️ CodeRabbit configuration file Files:
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure. Check listeners, resources, and providers are disposed without stale state or duplicate w...⚙️ CodeRabbit configuration file Files:
Act as an adversarial second-opinion reviewer. Verify PR claims against implementation, contracts, and tests. Trace changed inputs through normal, boundary, error, cancellation, retry, and default paths and their consumers. Seek plausible c...⚙️ CodeRabbit configuration file Files:
Add focused tests for UI binding and save behavior, persistence or normalization, and the value returned by `getStateToPostToWebview()`, including true and false/unset cases when defaults could hide omissions.📄 CodeRabbit inference engine (AGENTS.md) Files:
Fix lint violations in new TypeScript code instead of suppressing them.📄 CodeRabbit inference engine (AGENTS.md) Files:
After editing a file, run ESLint with pruning and zero warnings for that relative file, and confirm its suppression count did not increase.📄 CodeRabbit inference engine (AGENTS.md) Files:
🔇 Additional comments (6)
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesNative tool-call streaming
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to The change isolates streamed tool-call state for normal tasks and prevents interrupted work from corrupting another task. A bounded residual risk remains for concurrent callers that omit the optional scope, which could still mix tool data; this is mergeable with explicit owner awareness and follow-up. Suggested reviewers: 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
Full details: Description checkExplanation The description explains the cause, implementation, regression test, linked issue, and impact. It does not include the template's detailed test procedure or completed checklist, but the core required information is present. Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Out of Scope Changes checkExplanation All changed files support issue Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6 files. Full details: Regression EvidenceExplanation The changed parser concurrency behavior has focused unit coverage in Full details: Trust And Persistence InvariantsExplanation PASS. The changed paths only isolate in-memory native tool-call state. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
src/api/providers/lm-studio.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/api/providers/openrouter.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). src/api/providers/qwen-code.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency).
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What changed
Why this change was made
An overlapping subtask E2E run combined a tool ID and name from one request with arguments from the next request, causing malformed tool execution and a 30-second timeout. The same commit passed on rerun, exposing a real production race behind the flaky timing.
Closes #1468.
Impact
Cancelling, abandoning, or draining one task no longer corrupts another task's streamed native tool call. Existing unscoped parser callers remain compatible, and provider tool completion timing is preserved.