From 8a98ea587b53e9725c2aa6c4b4fc108ebe25c98f Mon Sep 17 00:00:00 2001 From: "Rai (Michael Pokorny)" Date: Tue, 24 Jun 2025 16:37:23 -0700 Subject: [PATCH] agentydragon(tasks): add task 23 interactive container command affordance hotkey --- ...nteractive-container-command-affordance.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 agentydragon/tasks/23-interactive-container-command-affordance.md diff --git a/agentydragon/tasks/23-interactive-container-command-affordance.md b/agentydragon/tasks/23-interactive-container-command-affordance.md new file mode 100644 index 0000000000..e6dd40fd5c --- /dev/null +++ b/agentydragon/tasks/23-interactive-container-command-affordance.md @@ -0,0 +1,29 @@ +--- +id: 23 +title: Interactive Container Command Affordance via Hotkey +status: Not started # one of: Not started, Started, Needs manual review, Done, Cancelled +summary: Provide a keybinding to run arbitrary shell commands in the agent’s container and display output inline. +goal: | + Add a user-facing affordance (e.g. a hotkey) to invoke arbitrary shell commands within the agent's container during a session for on-demand inspection and debugging. The typed command should be captured as a chat turn, executed via the existing shell tool, and its output rendered inline in the chat UI. + +## Acceptance Criteria + +- Bind a hotkey (e.g. Ctrl+M) that opens a prompt for the user to type any shell command. +- When the user submits, capture the command as if entered in the chat input, and invoke the shell tool with the command in the agent’s container. +- Display the command invocation and its stdout/stderr output inline in the chat window, respecting formatting rules (e.g. compact rendering settings). +- Support chaining multiple commands in separate turns; history should show these command turns normally. +- Provide unit or integration tests simulating a user hotkey press, command input, and verifying the shell tool is called and output is displayed. + +## Implementation + +**How it was implemented** +- Define a new keybinding (configurable, default Ctrl+M) in the TUI to trigger a `ShellCommandPrompt` overlay. +- In the overlay, accept arbitrary user input and dispatch it as a `ToolInvocation(ShellTool, command)` event in the agent’s event loop. +- Leverage the existing shell tool backend to execute the command in the container and capture its output. +- Render the command invocation and result inline in the chat UI using the command-rendering logic (honoring compact mode and spacing options). +- Add integration tests to simulate the hotkey, input prompt, and verify the shell tool call and inline rendering. + +## Notes + +- This feature aids debugging and inspection without leaving the agent workflow. +- Ensure that security policies (e.g. sandbox restrictions) still apply to these commands.