My use case is that I have a shell running and am actively reviewing code, maybe using xref to follow a few definitions and/or running some test commands in a vterm buffer in the same project. Then when something is up, I would like to bring this context of what I "recently" did into the agent-shell automatically.
E.g., I looked at a change the agent did, I ran a test command, something breaks, I just want to prompt: "wat?" and my transform function will consult e.g. gptel to know that this prompt lacks context and I add some xref history and the last few lines of my vterm.
I don't think the patch is very big, I can provide it unless you think it's a dumb idea.
I think it would be basically just be a defvar agent-shell-prompt-transform-functions and each function would receive the prompt and the agent-shell buffer and has to return a string to actually send as prompt. The buffer should be useful for gathering context in my scenario above. Then agent-shell--send-command just transforms the prompt through the agent-shell-prompt-transform-functions
Checklist
My use case is that I have a shell running and am actively reviewing code, maybe using xref to follow a few definitions and/or running some test commands in a vterm buffer in the same project. Then when something is up, I would like to bring this context of what I "recently" did into the agent-shell automatically.
E.g., I looked at a change the agent did, I ran a test command, something breaks, I just want to prompt: "wat?" and my transform function will consult e.g. gptel to know that this prompt lacks context and I add some xref history and the last few lines of my vterm.
I don't think the patch is very big, I can provide it unless you think it's a dumb idea.
I think it would be basically just be a
defvar agent-shell-prompt-transform-functionsand each function would receive the prompt and the agent-shell buffer and has to return a string to actually send as prompt. The buffer should be useful for gathering context in my scenario above. Thenagent-shell--send-commandjust transforms the prompt through theagent-shell-prompt-transform-functionsChecklist