implemented escape shell feature #30
Conversation
wasn't supposed to be included in the PR in the first place.
yyovil
left a comment
There was a problem hiding this comment.
Implement suggested changes and your work will be accepted without any further review.
| session session.Session | ||
| textarea textarea.Model | ||
| attachments []message.Attachment | ||
| EscapeShellMode bool |
There was a problem hiding this comment.
adhere to naming convention if export isn't necessary which i guess is the case in here.
| }) | ||
|
|
||
| // Run the tool (reuse ExecuteCmd for execution) without shell wrapping | ||
| tool := tools.NewDockerCli().(*tools.Terminal) |
There was a problem hiding this comment.
We should use singleton instead of initializing new Docker CLI every time escapeShell is invoked
There was a problem hiding this comment.
We can reuse the tool used by the agents here
| }}, | ||
| }) | ||
|
|
||
| // If we had to create a new session locally, notify the rest of the app |
There was a problem hiding this comment.
We should let user decide whether or not the escape shell commands ran by the user should be included in the llm context
There was a problem hiding this comment.
Initially, it should be done via configuration file swarm.json and eventually it will be done using TUI as well.
There was a problem hiding this comment.
Do not render escape shell command message as a tool call, render it as a system message
Currently i've rendered the escape shell message as a tool call which also gets added to the chat session so that the agent has it in its context. refactored the
func (term *Terminal) Run(ctx context.Context, call ToolCall) (ToolResponse, error)method and broke it down into a reusable methodfunc (term *Terminal) ExecuteCmd(ctx context.Context, cmd []string) (string, error). reused it to escape shell.Closes #23