Add agent-shell-restore-context defcustom#605
Conversation
xenodium
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Left a couple of minor comments.
The more significant request I'd ask is that you commit to landing the feature, if that's ok with you? If there are related bugs raised, I'd cc ya for visibility.
| 'agent-shell-restore-context | ||
| "agent-shell 0.52") | ||
|
|
||
| (defcustom agent-shell-restore-context 'minimal |
There was a problem hiding this comment.
How about naming this agent-shell-session-restore-strategy, it's its more about restoring sessions than context-centric?
| `minimal': Show only the session title (default). Uses | ||
| `session/resume' when supported (no message replay), | ||
| so restore is fast and quiet. | ||
| `summary': Use `session/load' and, when the replay completes, |
There was a problem hiding this comment.
Can we reserve summary for a different feature please?
I've been contemplating pairing resume request with an automaric prompt sent to agent asking to summarize the resumed session.
Maybe name it 'first-last?
| :state state | ||
| :namespace-id "bootstrapping" | ||
| :block-id "restore_summary_first_user" | ||
| :label-left (propertize "Initial prompt" 'font-lock-face 'font-lock-doc-markup-face) |
There was a problem hiding this comment.
nit: search "Initial prompt", replace with "First prompt".
|
Thanks for the review. Just pushed the suggested fixes.
Yes, I'm quite happy to tackle any related bugs and own the feature 😅 |
Currently when restoring a session you can choose a minimal resume or a full load via
agent-shell-prefer-session-resume.This PR adds a
summaryoption via a new agent-shell-restore-contextdefcustom. The options are:minimal: Equivalent toagent-shell-prefer-session-resume: tfull: Equivalent toagent-shell-prefer-session-resume: nilsummary: Loads the full session (when available), but renders only the first prompt and last text response.The idea is that summary gives you enough context about the session, without needing to restore the entire conversation and tool calls.
Here's an example:
Checklist
M-x checkdocandM-x byte-compile-file.