feat: Add plan approval workflow with feedback loop + Docker Windows support#34
Open
mohd-talib0 wants to merge 2 commits intoTheAgenticAI:mainfrom
Open
feat: Add plan approval workflow with feedback loop + Docker Windows support#34mohd-talib0 wants to merge 2 commits intoTheAgenticAI:mainfrom
mohd-talib0 wants to merge 2 commits intoTheAgenticAI:mainfrom
Conversation
…ames - Replace network_mode: host with port mappings in docker-compose.yaml - Change localhost:8000 to agentic_browser:8000 in web_surfer.py and orchestrator_agent.py Fixes inter-container communication on Windows Docker Desktop.
Add comprehensive plan review system allowing users to control task execution
before agents begin work. Plans now require explicit user approval.
Plan Approval Features:
- Users can approve plans to start execution ("Approve & Run")
- Users can request modifications via text feedback ("Request Changes")
- Users can cancel plans gracefully ("Cancel Run")
- Feedback loop regenerates plan with AI incorporating user input
- Maximum 5 regeneration attempts to prevent infinite loops
- Plan display is read-only (modifications only via feedback)
Step-by-Step Approval:
- Optional checkbox: "Require approval before each web action"
- Optional checkbox: "Require approval before each coding step"
- Individual step approval/rejection with optional notes
Graceful Cancellation:
- Add UserCancellationError custom exception
- Display friendly message: "Task cancelled by user. No changes were made."
- No Python tracebacks shown to users
Backend Changes:
- orchestrator_agent.py:
- Add UserCancellationError exception class
- Extend orchestrator_deps with approval state fields
- Add _request_plan_approval() for plan approval handling
- Add _ensure_step_approval() for step-level approvals
- Modify plan_task with approval loop and retry logic
- Update system prompt with plan execution guidelines
- instructor.py:
- Import and handle UserCancellationError
- Return friendly cancellation message
- stream_response_format.py:
- Add metadata field for approval state
Frontend Changes:
- ChatList.tsx:
- Add PlanApprovalState and StepApprovalState types
- Add state variables for approval workflow
- Add handlePlanApprovalSubmit() for approve/cancel
- Add handlePlanFeedbackSubmit() for feedback submission
- Add handleStepApprovalDecision() for step approvals
- Add Plan Approval UI with buttons and checkboxes
- Add Step Approval UI with rejection notes
- Plan display uses read-only Markdown component
- chatTypes.ts:
- Add metadata field to SystemMessage interface
WebSocket Message Types:
- plan_approval: approve or cancel plan
- plan_feedback: request changes with feedback text
- step_approval: approve or reject individual steps
Infra:
- ta-browser/Dockerfile: Update base to python:3.11-bookworm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(orchestrator): implement plan approval workflow with feedback loop
Add comprehensive plan review system allowing users to control task execution
before agents begin work. Plans now require explicit user approval.
Plan Approval Features:
Step-by-Step Approval:
Graceful Cancellation:
Backend Changes:
Frontend Changes:
WebSocket Message Types:
Docker/Infra (Windows Support):