feat: add graceful wrap-up command for agents#221
Open
wtfsayo wants to merge 1 commit intousestrix:mainfrom
Open
feat: add graceful wrap-up command for agents#221wtfsayo wants to merge 1 commit intousestrix:mainfrom
wtfsayo wants to merge 1 commit intousestrix:mainfrom
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.
Contributor
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
|
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.
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