Integrate session checkpoint into Resume AI CLI flow#419
Conversation
There was a problem hiding this comment.
Pull request overview
This PR integrates session checkpoint capture into the “Resume AI CLI” workflow, so resuming a backend session can immediately prompt the user to request a checkpoint, and removes the now-redundant standalone checkpoint menu entry.
Changes:
- Add
ai-code-cli-resume-with-session-checkpoint, an interactive wrapper aroundai-code-cli-resumethat optionally promptsPrint AI session checkpoint?and reusesai-code-session-checkpoint. - Update the AI CLI session transient so
Rroutes through the new wrapper, and remove theP“AI session checkpoint” entry from Other Tools. - Expand ERT coverage for menu wiring, prompt accept/decline behavior, and removal of the old transient entry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ai-code.el | Adds checkpoint-aware resume wrapper; updates transient bindings to use it; removes standalone checkpoint entry. |
| test/test_ai-code.el | Adds/updates tests for the new resume flow and transient menu changes. |
| ((symbol-function 'buffer-substring-no-properties) | ||
| (lambda (_beg _end) | ||
| "(define-key test-map (kbd \"C-c x\") #'broken-command)")) | ||
| (if t | ||
| "(define-key test-map (kbd \"C-c x\") #'broken-command)" | ||
| nil))) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a603f60622
ℹ️ 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".
| (ai-code-cli-resume arg) | ||
| (when (and prompt-for-checkpoint | ||
| (y-or-n-p "Print AI session checkpoint? ")) | ||
| (ai-code-session-checkpoint))) |
There was a problem hiding this comment.
Delay checkpoint until resume picker finishes
For picker-based resume flows, confirming here sends the checkpoint before the session has actually been chosen. For example, ai-code-opencode-resume documents that the CLI presents an interactive list of past sessions and then calls ai-code-backends-infra--cli-show-resume-picker (ai-code-opencode.el lines 85-100), and GitHub Copilot does the same picker poke (ai-code-github-copilot-cli.el lines 119-122). Because this wrapper asks immediately after ai-code-cli-resume returns, the checkpoint prompt is typed into the terminal picker instead of an active resumed AI prompt, so the new integrated checkpoint flow fails for those backends.
Useful? React with 👍 / 👎.
Resuming an AI CLI session now offers an immediate checkpoint prompt instead of requiring a separate transient action. This folds checkpoint capture into the resume workflow and removes the extra dedicated menu entry.
Resume flow
C-c a Rthrough a small wrapper aroundai-code-cli-resumePrint AI session checkpoint?ai-code-session-checkpointimplementation when the user confirmsTransient menu
Resume AI CLIin the AI CLI session sectionAI session checkpointentry fromOther ToolsTargeted test updates