Skip to content

Integrate session checkpoint into Resume AI CLI flow#419

Open
tninja with Copilot wants to merge 8 commits into
mainfrom
copilot/chore-integrate-ai-session-checkpoint
Open

Integrate session checkpoint into Resume AI CLI flow#419
tninja with Copilot wants to merge 8 commits into
mainfrom
copilot/chore-integrate-ai-session-checkpoint

Conversation

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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

    • Route C-c a R through a small wrapper around ai-code-cli-resume
    • Preserve existing prefix-arg behavior for backend-specific resume flows
    • Prompt after resume: Print AI session checkpoint?
    • Reuse the existing ai-code-session-checkpoint implementation when the user confirms
  • Transient menu

    • Keep Resume AI CLI in the AI CLI session section
    • Remove the standalone AI session checkpoint entry from Other Tools
  • Targeted test updates

    • Cover resume-menu wiring to the new wrapper
    • Cover checkpoint prompt accept/decline behavior
    • Cover removal of the old transient entry
(defun ai-code-cli-resume-with-session-checkpoint (&optional arg prompt-for-checkpoint)
  (interactive (list current-prefix-arg t))
  (ai-code-cli-resume arg)
  (when (and prompt-for-checkpoint
             (y-or-n-p "Print AI session checkpoint? "))
    (ai-code-session-checkpoint)))

Copilot AI changed the title [WIP] Integrate AI session checkpoint feature with Resume AI CLI Integrate session checkpoint into Resume AI CLI flow Jul 6, 2026
Copilot finished work on behalf of tninja July 6, 2026 02:36
Copilot AI requested a review from tninja July 6, 2026 02:36
@tninja tninja marked this pull request as ready for review July 6, 2026 23:25
@tninja tninja requested a review from Copilot July 6, 2026 23:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 around ai-code-cli-resume that optionally prompts Print AI session checkpoint? and reuses ai-code-session-checkpoint.
  • Update the AI CLI session transient so R routes through the new wrapper, and remove the P “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.

Comment thread test/test_ai-code.el
Comment on lines 227 to +231
((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)))

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ai-code.el
Comment on lines +276 to +279
(ai-code-cli-resume arg)
(when (and prompt-for-checkpoint
(y-or-n-p "Print AI session checkpoint? "))
(ai-code-session-checkpoint)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chore: AI session checkpoint feature probably should be integrated with Resume AI CLI

3 participants