Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a7edc371c
ℹ️ 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".
test/test_ai-code-git.el
Outdated
| (should (member "PR title (optional, leave empty for AI to generate): " | ||
| captured-read-prompts)) |
There was a problem hiding this comment.
Mock
read-string for PR-title path in this ERT
This new assertion assumes the PR title prompt is captured through ai-code-read-string, but ai-code--pull-or-review-pr-with-source now reads the title with read-string (ai-code-git.el, PR-title branch). In non-interactive ERT runs, that means this prompt is never recorded in captured-read-prompts (so this assertion fails) and can also try to read from stdin if read-string is not stubbed. The test should stub read-string (or capture via a separate list) for the title prompt path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR improves a few interactive Emacs workflows in ai-code-interface.el, focusing on smoother PR creation prompts, enhanced task-file handling, and expanded backend “skills” management.
Changes:
- Adds an optional PR title prompt (with minibuffer history) to the “send current branch PR” flow and updates the generated prompt instructions accordingly.
- Extends
ai-code-create-or-open-task-filewith aC-uflow to ask the AI to search.orgfile contents under a chosen directory (with dedicated directory history + confirmation). - Expands backend skills management to support uninstall as a first-class action, with fallback prompt generation and validation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
ai-code.el |
Updates transient menu labels to reflect new “(Un)Install skills” and task-file search prefix behavior. |
ai-code-prompt-mode.el |
Implements task-file search prompt flow, adds directory history var, and extends ai-code-create-or-open-task-file to accept prefix arg. |
ai-code-git.el |
Adds optional PR title prompting/history and updates PR creation prompt construction. |
ai-code-backends.el |
Adds install/uninstall action selection and a unified fallback helper; routes Claude skills to fallback by clearing :install-skills. |
test/test_ai-code-prompt-mode.el |
Adds ERT coverage for the new task-file search prefix flow. |
test/test_ai-code-git.el |
Updates ERT coverage for the optional PR title prompt behavior. |
test/test_ai-code-backends.el |
Adds ERT coverage for uninstall and invalid-action validation; updates install tests to account for action selection. |
| ((symbol-function 'ai-code-read-string) | ||
| (lambda (prompt &optional initial-input _candidate-list) | ||
| (push prompt captured-read-prompts) | ||
| (cond | ||
| ((string= prompt "Target branch to merge into: ") | ||
| (or initial-input "main")) | ||
| ((string= prompt "PR title (optional, leave empty for AI to generate): ") | ||
| "") | ||
| ((string= prompt "Enter PR creation prompt: ") |
| :agent-file "CLAUDE.md" | ||
| :upgrade "npm install -g @anthropic-ai/claude-code@latest" | ||
| :install-skills ai-code-claude-code-install-skills | ||
| :install-skills nil |
ai-code-backends.el
Outdated
| @@ -606,15 +622,25 @@ | |||
| - symbol: call the function. | |||
| Otherwise fall back to prompting the AI session to install from a | |||
| skills repository URL." | |||
ai-code-prompt-mode.el
Outdated
| (target-dir (expand-file-name (if (string-empty-p input) | ||
| ai-code-files-dir | ||
| input)))) |
ai-code-prompt-mode.el
Outdated
| (ai-code--open-or-create-task-file task-file confirmed-filename task-name task-url))))))) | ||
| using GPTel, and creates the task file. | ||
| With prefix ARG, prompt AI to search org file content under a target directory." | ||
| ;; DONE: when C-u pressed, let AI search content inside ai-code-files-dir given search target description. User firstly confirm the target dir to search (it support dedicate history entered), by default it is ai-code-files-dir, then input search description, it will build up prompt to search .org files inside target directory, and user confirm with ai-code-read-string. After that, the prompt will be sent to ai coding session to perform search. |
This reverts commit 19ecfc0.
This updates a few editor workflows that were still a bit rough around the edges, especially around sending out PRs and working with task files.
The PR creation flow now asks for an optional title and reuses minibuffer history so it is faster to iterate on follow-up PRs. If no title is provided, the generated prompt now explicitly tells the AI to come up with a concise PR title. I also updated the prompt text so the final response includes the exact title and description that were used.
On the task-file side,
ai-code-create-or-open-task-filenow supports aC-upath that asks AI to search.orgfile contents under a chosen directory, with dedicated history for the search directory and a confirmation step before sending the prompt. In parallel, backend skill management now supports uninstall as a first-class action, routes Claude to the fallback flow, and adds clearer validation around unsupported actions.For verification, I added ERT coverage for the optional PR-title prompt, the new task-file search prompt flow, and the install/uninstall backend-skills branches. Per request, I did not run tests for this PR creation step.