fix(autorun): resolve paused batch session for resume/skip/abort#726
fix(autorun): resolve paused batch session for resume/skip/abort#726pedramamini merged 3 commits intomainfrom
Conversation
Resolve merge conflict with main (consumeGroupChatAutoRun import). Also tighten resolveBatchSessionIdForPausedError to only return sessions that are actually error-paused, removing fallbacks to activeBatchSessionIds[0] or activeSessionId which could target sessions not paused on error.
Remove non-error-paused fallbacks from resolveBatchSessionIdForPausedError so skip/resume/abort only target sessions that are actually error-paused. Update tests to set errorPaused state in batchStore and verify the new behavior.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR refactors session ID resolution for batch error-paused handlers by introducing a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR fixes a longstanding Auto Run bug where Resume/Skip/Abort could operate on the wrong session by replacing the Confidence Score: 5/5Safe to merge — targeted fix with correct logic and good test coverage; only finding is a P2 test coverage gap for one handler. All three error-action handlers now use a strict errorPaused check. The logic is correct, the tests validate the key branches, and no existing behavior outside the error-pause path is changed. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["User triggers Resume / Skip / Abort"] --> B["Read batchRunStates from\nuseBatchStore.getState() at call time"]
B --> C{"activeSessionId is set AND\nbatchRunStates[activeSessionId]\n.errorPaused is true?"}
C -- Yes --> D["return activeSessionId"]
C -- No --> E["Object.keys(batchRunStates)\n.find(id => errorPaused)"]
E -- "found" --> F["return first errorPaused sessionId"]
E -- "not found" --> G["return undefined"]
D --> H["Call action handler\nresumeAfterError / skip / abort"]
F --> H
G --> I["bail — no-op"]
H --> J["handleClearAgentError clears error banner"]
|
Summary
Changes
src/renderer/hooks/batch/useBatchHandlers.ts— addresolveBatchSessionIdForPausedError()that readserrorPausedfrom batch store, replacing the oldactiveBatchSessionIds[0] || activeSessionIdfallbacksrc/__tests__/renderer/hooks/useBatchHandlers.test.ts— update tests to seterrorPausedin batch store state and verify the tightened resolution logicTest plan
Fixes #707
Summary by CodeRabbit
Bug Fixes
Tests