[fix] Prevent approval resume after Stop - #6579
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@coderabbitai review — Codex |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (5)
Disabled knowledge base sources:
📝 SummarySummary by CodeRabbit
WalkthroughChangesThe chat flow now invalidates pending approval resumes before stop or stream-error handling. The conversation hook exposes Pending resume cancellation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Stopping a chat now reliably prevents a delayed approval response from starting a new execution, including when cancellation cannot be sent. The updated behavior is covered by targeted session and delayed-resume tests, with no remaining merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Team
Run ID: df547a00-d4d9-4520-9636-d0480d1d8bdf
📒 Files selected for processing (5)
web/mobile/src/features/chat/LiveConversation.tsxweb/oss/src/components/AgentChatSlice/hooks/useAgentChatSession.test.tsweb/oss/src/components/AgentChatSlice/hooks/useAgentChatSession.tsweb/packages/agenta-chat/src/hooks/useAgentConversation.tsweb/packages/agenta-chat/tests/unit/hooks/useAgentConversation.test.ts
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.
|
|
005d111 to
139da66
Compare
|
@coderabbitai review — Codex |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Team
Run ID: 3bb1f1af-0b3d-4801-b349-1ba63c33cb10
📒 Files selected for processing (3)
web/mobile/src/features/chat/LiveConversation.tsxweb/oss/src/components/AgentChatSlice/hooks/useAgentChatSession.tsweb/packages/agenta-chat/src/hooks/useAgentConversation.ts
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.
|
|
139da66 to
df97b83
Compare
|
@coderabbitai review — Codex |
|
@coderabbitai review Final-head re-review requested for — Codex |
|
|
|
Tip For best results, initiate chat on the files or code changes.
You are interacting with an AI system. |
Context
On mobile, approving a tool and immediately pressing Stop could still start the approved command. The Stop request fenced and cancelled the parked execution, but the approval response could release its automatic resume while that cancel request was in flight, creating a new execution after the user had stopped.
Changes
The mobile Stop path now voids any pending approval resume synchronously before it sends the durable cancel request. The shared conversation hook exposes that marker-only action separately from aborting the local stream, so the UI can preserve its server-first cancellation flow.
Both conversation hosts also preserve an explicitly consumed or voided approval marker when a stream errors. This prevents an error update from making an already stopped approval eligible for automatic resume again.
Tests
pnpm lint-fix(24 tasks passed across the full web lint graph)pnpm --filter @agenta/chat exec vitest run tests/unit/hooks/useAgentConversation.test.ts(12 passed)pnpm --filter @agenta/oss exec vitest run src/components/AgentChatSlice/hooks/useAgentChatSession.test.ts(8 passed)What to QA