Skip to content

Feature request: Pass the shell-buffer into any functions registered as agent-shell-context-sources #479

@timfel

Description

@timfel

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

  • I agree to communicate with the author myself (not AI-generated).
  • I've read the README's Filing issues section.
  • I'm running the latest versions (fill in below).
    • agent-shell version: 20260329.1008
    • acp.el version: 0.11.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions