Add AI session checkpoint command to Other Tools menu#354
Conversation
Agent-Logs-Url: https://github.com/tninja/ai-code-interface.el/sessions/bf5be08d-5d7c-40fc-b969-3efad02c3f01 Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated “session checkpoint” utility to help resume long-idle AI sessions by sending a fixed “stop and summarize” prompt, and exposes it via the Other Tools transient menu group.
Changes:
- Introduces
ai-code-session-checkpointand a fixedai-code-session-checkpoint-promptconstant. - Wires the command into
ai-code--menu-other-toolson keyP. - Adds ERT coverage for the prompt payload and the menu entry wiring.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
ai-code.el |
Adds the checkpoint prompt constant + interactive command; registers it in the “Other Tools” transient group. |
test/test_ai-code.el |
Adds tests asserting the exact prompt sent and verifying the transient menu entry/keybinding. |
| (lambda (command) | ||
| (setq sent-command command))) |
| (let* ((suffix (transient-get-suffix 'ai-code--menu-other-tools "P")) | ||
| (definition (if (keywordp (car-safe (cdr suffix))) | ||
| (cdr suffix) | ||
| (nth 2 suffix)))) | ||
| (should suffix) | ||
| (should (eq (plist-get definition :command) | ||
| 'ai-code-session-checkpoint)) | ||
| (should (equal (plist-get definition :description) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd46847f60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (defun ai-code-session-checkpoint () | ||
| "Ask the active AI session to summarize its current state and stop editing." | ||
| (interactive) | ||
| (ai-code-cli-send-command ai-code-session-checkpoint-prompt) |
There was a problem hiding this comment.
Route checkpoint prompt through session-aware prompt sender
ai-code-session-checkpoint sends directly via ai-code-cli-send-command, which only resolves sessions for the current project context, so this command errors in cases where users have a visible AI session from another directory. Other prompt flows use ai-code--send-prompt (via ai-code--insert-prompt) to detect and target the visible session buffer first, which is exactly the long-idle resume scenario this feature is meant to support. In practice, invoking checkpoint from a buffer without a matching project session can fail with “No … session for this project” instead of checkpointing the active visible session.
Useful? React with 👍 / 👎.
|
@copilot carefully review the feedbacks, identify ones make sense and address them. |
Agent-Logs-Url: https://github.com/tninja/ai-code-interface.el/sessions/c8c71c39-5fbe-4a2f-8d5f-ea34c98541a7 Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
Addressed the two review points that made sense in |
Long-idle AI sessions are hard to resume because there is no quick way to ask the agent for a compact state summary before continuing. This change adds a dedicated checkpoint command that sends a fixed “stop and summarize” prompt and places it in the Other Tools menu where session-inspection utilities belong.
New checkpoint command
ai-code-session-checkpoint, an interactive command that sends a fixed checkpoint prompt to the active AI session.Menu wiring
ai-code--menu-other-tools.Coverage
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dl.google.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https(dns block)elpa.gnu.org/usr/bin/emacs emacs -Q -batch -l /tmp/install-ai-code-deps.el(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)/usr/bin/python python -(dns block)elpa.nongnu.org/usr/bin/emacs emacs -Q -batch -l /tmp/install-ai-code-deps.el(dns block)melpa.org/usr/bin/emacs emacs -Q -batch -l /tmp/install-ai-code-deps.el(dns block)/usr/bin/python python -(dns block)If you need me to access, download, or install something from one of these locations, you can either: