Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(chat): clear pending plan review on decision event

Steven Enamakel93236840ad8b
diff --git a/app/src/providers/ChatRuntimeProvider.tsx b/app/src/providers/ChatRuntimeProvider.tsx
index 1f35750a8d..7496c82665 100644
--- a/app/src/providers/ChatRuntimeProvider.tsx
+++ b/app/src/providers/ChatRuntimeProvider.tsx
@@ -56,6 +56,7 @@ import {
clearPendingApprovalForThread,
clearPendingApprovalIfRequest,
clearPendingPlanReviewForThread,
+ clearPendingPlanReviewIfRequest,
clearProcessingForThread,
clearStreamingAssistantForThread,
clearTurnApprovalForThread,
@@ -1569,6 +1570,19 @@ const ChatRuntimeProvider = ({ children }: { children: React.ReactNode }) => {
})
);
},
+ onPlanReviewDecided: event => {
+ rtLog('plan_review_decided', {
+ thread: event.thread_id,
+ request: event.request_id,
+ resolution: event.resolution,
+ });
+ dispatch(
+ clearPendingPlanReviewIfRequest({
+ threadId: event.thread_id,
+ requestId: event.request_id,
+ })
+ );
+ },
onThreadTodosChanged: (event: ChatThreadTodosChangedEvent) => {
rtLog('thread_todos_changed', {
thread: event.thread_id,
diff --git a/app/src/store/chatRuntimeSlice.ts b/app/src/store/chatRuntimeSlice.ts
index 24bb9460f5..e681368ff7 100644
--- a/app/src/store/chatRuntimeSlice.ts
+++ b/app/src/store/chatRuntimeSlice.ts
@@ -2561,6 +2561,17 @@ const chatRuntimeSlice = createSlice({
clearPendingPlanReviewForThread: (state, action: PayloadAction<{ threadId: string }>) => {
delete state.pendingPlanReviewByThread[action.payload.threadId];
},
+ clearPendingPlanReviewIfRequest: (
+ state,
+ action: PayloadAction<{ threadId: string; requestId: string }>
+ ) => {
+ if (
+ state.pendingPlanReviewByThread[action.payload.threadId]?.requestId ===
+ action.payload.requestId
+ ) {
+ delete state.pendingPlanReviewByThread[action.payload.threadId];
+ }
+ },
setWorkflowProposalForThread: (
state,
action: PayloadAction<{ threadId: string; proposal: WorkflowProposal }>
@@ -3294,6 +3305,7 @@ export const {
resolvePendingApprovalForThread,
setPendingPlanReviewForThread,
clearPendingPlanReviewForThread,
+ clearPendingPlanReviewIfRequest,
setWorkflowProposalForThread,
clearWorkflowProposalForThread,
markWorkflowProposalCompleted,