-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: add graceful wrap-up command for agents #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add a new "wrap up" feature that allows users to gracefully request an agent to finish its current work and report findings, instead of hard-stopping with ESC. Changes: - Add wrap_up_agent() function in agents_graph_actions.py that sends an urgent message instructing the agent to conclude within 3-5 iterations - Add WrapUpAgentScreen modal dialog in tui.py with amber/warning styling - Add 'W' keyboard binding to trigger wrap-up on selected agent - Update help screen to show new keybinding - Add CSS styles for the wrap-up dialog This provides a middle ground between letting an agent run indefinitely and hard-stopping it - the agent can summarize findings and properly report back to its parent via agent_finish or finish_scan.
Greptile SummaryThis PR implements a graceful wrap-up feature for agents, providing users with a middle ground between letting an agent run indefinitely (no action) and hard-stopping it (ESC key). The feature adds a new Key Changes:
Architecture & Integration:
Design Rationale: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant TUI as Textual UI
participant TUIApp as StrixTUIApp
participant AgentGraph as agents_graph_actions
participant AgentState as Agent State
participant Agent as Agent Loop
User->>TUI: Press W key
TUI->>TUIApp: action_wrap_up_selected_agent()
TUIApp->>TUIApp: _validate_agent_for_wrap_up()
TUIApp->>TUI: Show WrapUpAgentScreen Modal
User->>TUI: Click "Yes"
TUI->>TUIApp: action_confirm_wrap_up_agent(agent_id)
TUIApp->>AgentGraph: wrap_up_agent(agent_id)
rect rgb(100, 200, 100)
note right of AgentGraph: Check agent status
AgentGraph->>AgentGraph: Verify agent is running/waiting
end
rect rgb(100, 150, 200)
note right of AgentGraph: Send wrap-up message
AgentGraph->>AgentGraph: Create wrap-up XML message
AgentGraph->>AgentGraph: Append to _agent_messages[agent_id]
end
rect rgb(200, 150, 100)
note right of AgentGraph: Resume if waiting
AgentGraph->>AgentState: is_waiting_for_input()?
alt Agent is waiting
AgentGraph->>AgentState: resume_from_waiting()
end
end
AgentGraph-->>TUIApp: Return success status
TUIApp->>TUI: Log completion message
rect rgb(150, 150, 200)
note right of Agent: Agent processes wrap-up
Agent->>Agent: Next iteration starts
Agent->>Agent: _check_agent_messages()
Agent->>Agent: Finds wrap-up message
Agent->>Agent: Processes URGENT instruction
Agent->>Agent: Summarizes findings
Agent->>Agent: Calls agent_finish or finish_scan
end
|
Summary
Wkey) that gracefully requests an agent to finish its current work and report findingsESCagent_finishorfinish_scanChanges
agents_graph_actions.py: Addwrap_up_agent()function that sends an urgent wrap-up instructiontui.py: AddWrapUpAgentScreenmodal,Wkeybinding, and action handlerstui_styles.tcss: Add amber/warning styling for the wrap-up dialogTest plan
strix --target ./appand start a scanWto trigger wrap-up dialogF1to confirm help shows new keybinding