Skip to content

Conversation

@ileixe
Copy link
Contributor

@ileixe ileixe commented Sep 24, 2025

Hi, I want to use codex resume so added the feature. Please take a look.

@tninja tninja requested a review from Copilot September 24, 2025 13:57
Copy link
Contributor

Copilot AI left a comment

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 adds resume functionality for CLI sessions across backends, allowing users to continue previously started AI CLI sessions. The feature is implemented with backend-specific support and provides a unified interface through the codex resume command.

  • Adds a new ai-code-cli-resume command with backend-specific resume implementations
  • Updates the AI Code Commands menu to include a "Resume AI CLI" option
  • Implements resume support for codex backend with proper session restoration

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
ai-code-interface.el Adds "Resume AI CLI" menu item to the AI Code Commands interface
ai-code-codex-cli.el Implements codex-cli-resume function for the codex backend with session restoration
ai-code-backends.el Adds resume functionality infrastructure with backend configuration and fallback handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

(claude-code-program-switches nil))
(claude-code--start arg '("resume") nil t)
(claude-code--term-send-string claude-code-terminal-backend "")
(goto-char (point-min))))
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The goto-char (point-min) call will move to the beginning of the current buffer, but after calling claude-code--start with force-switch-to-buffer set to t, the current buffer may not be the terminal buffer. This could result in moving the cursor in an unrelated buffer instead of the CLI session buffer.

Suggested change
(goto-char (point-min))))
(with-current-buffer claude-code-terminal-backend
(goto-char (point-min))))))

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

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

@ileixe let me know if this AI suggested buffer specification make sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it makes sense. Changed

Comment on lines 131 to 136
(let ((resume resume))
(fset 'ai-code-cli-resume
(lambda (&optional arg)
(interactive "P")
(let ((current-prefix-arg arg))
(call-interactively resume)))))
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The variable shadowing (let ((resume resume))) is unnecessary and confusing. The outer resume variable is already lexically scoped and can be used directly in the lambda closure without this redundant binding.

Suggested change
(let ((resume resume))
(fset 'ai-code-cli-resume
(lambda (&optional arg)
(interactive "P")
(let ((current-prefix-arg arg))
(call-interactively resume)))))
(fset 'ai-code-cli-resume
(lambda (&optional arg)
(interactive "P")
(let ((current-prefix-arg arg))
(call-interactively resume))))

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

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

@ileixe should we remove this let binding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

@tninja
Copy link
Owner

tninja commented Sep 24, 2025

Thanks @ileixe for the contribution! It is useful feature. Would you mind help take a look at the review feedback and see if it make sense?

@ileixe
Copy link
Contributor Author

ileixe commented Sep 25, 2025

Thanks @ileixe for the contribution! It is useful feature. Would you mind help take a look at the review feedback and see if it make sense?

Thanks for review. Updated.

@tninja tninja merged commit 68cea86 into tninja:main Sep 25, 2025
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.

2 participants