When I send a region longer than 5 lines (e.g. via agent-shell-send-region), the inserted preview is capped and followed by an Expand... button (agent-shell.el:6113-6135, max-preview-lines 5). If I press RET to submit without first clicking the button, the agent receives the truncated preview plus the literal string Expand... — the full text never reaches it.
Cause: the full text is captured only inside the button's action closure. shell-maker-submit → comint-send-input reads the prompt with buffer-substring-no-properties, so the closure is never consulted.
Possible fixes:
- Auto-expand any collapsed
agent-shell-region-id regions in the input area before submission.
- Store the full text on a text property (or invisible overlay) that submission can substitute back in, so the visible preview stays compact but the agent receives the full content.
- At minimum, expose
max-preview-lines as a defcustom so users can disable the cap.
Repro:
- Open a buffer with > 5 lines of text, mark a region spanning all of them.
M-x agent-shell-send-region.
- Press
RET without clicking Expand....
- Observe that the agent sees
…\nExpand... instead of the full region.
Checklist
-- Thanks a lot for your consideration! Andrea
When I send a region longer than 5 lines (e.g. via
agent-shell-send-region), the inserted preview is capped and followed by anExpand...button (agent-shell.el:6113-6135,max-preview-lines 5). If I pressRETto submit without first clicking the button, the agent receives the truncated preview plus the literal stringExpand...— the full text never reaches it.Cause: the full text is captured only inside the button's action closure.
shell-maker-submit→comint-send-inputreads the prompt withbuffer-substring-no-properties, so the closure is never consulted.Possible fixes:
agent-shell-region-idregions in the input area before submission.max-preview-linesas a defcustom so users can disable the cap.Repro:
M-x agent-shell-send-region.RETwithout clickingExpand....…\nExpand...instead of the full region.Checklist
67babec(2026-05-16, merge of Add Hermes Agent Support #583)03099fa(2026-05-03, merge of Add support for devcontainer #18)agent-shell-opencode.el, bundled with agent-shell)opencode0.0.0-integrated-202605150926(personal fork with--attachsupport; see config below)-- Thanks a lot for your consideration! Andrea