Merged upstream fork#2
Conversation
* Limit auto-test modes to Ask and Off * Honor legacy auto test persistent modes
…pport (tninja#277) * Add buffer and project query tools and xref support * update author * add README * add screenshot * addressing feedbacks * add HISTORY
* Add SPDX header and commentary tests for autoloads * Disable melpazoid workflow and add unit-tests CI * add missing package * update HISTORY
Merged fork changes including: - Defensive buffer checks with better docstrings - Helper function extractions (ai-code--read-file-contents, ai-code--with-behaviors-repo) - Bug fixes and refactors - Startup guards and validation improvements Resolved conflict in ai-code-backends-infra.el by combining: - Defensive buffer validation from fork - fit-side-window-body-width function from upstream
There was a problem hiding this comment.
Pull request overview
This PR updates ai-code-interface.el to incorporate upstream changes: tightening the persistent auto-test UX, expanding the built-in Emacs MCP toolset (buffer/project/xref utilities), and improving packaging/CI hygiene.
Changes:
- Add new MCP server tools (
buffer_query, project file/buffer listing, xref definitions-at-point) and update MCP output formatting/path display behavior. - Restrict persistent
ai-code-auto-test-typechoices to Ask every time / Off while still honoring legacy values at send time; update tests accordingly. - Add CI ERT workflow and new tests to enforce autoload file SPDX/commentary headers; update docs/history and add a screenshot.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
ai-code.el |
Limits persistent auto-test modes; refactors send-time resolution; updates transient reader defaults. |
ai-code-mcp-server.el |
Adds new MCP tools (buffer/project/xref) and adjusts path formatting + result formatting. |
ai-code-backends-infra.el |
Resizes side windows to match configured body width via a new helper. |
ai-code-autoloads.el |
Updates generated autoload header to include SPDX + Commentary. |
test/test_ai-code.el |
Updates/reshapes auto-test behavior tests and adds coverage for new defcustom constraints. |
test/test_ai-code-mcp-server.el |
Updates tool lists and adds extensive tests for new MCP tools and path formatting. |
test/test_ai-code-backends-infra.el |
Adds a test for side-window body-width sizing behavior. |
test/test_ai-code-package-hygiene.el |
New tests ensuring autoload header includes SPDX + Commentary. |
.github/workflows/unit-tests.yml |
Adds an Ubuntu CI job to install deps and run ERT test suite. |
.github/workflows/melpazoid.yml |
Switches to manual trigger, but currently forces job skip via if: false. |
README.org |
Rewords positioning section and adds MCP tools screenshot reference. |
HISTORY.org |
Documents the merged changes and bumps release notes. |
emacs_mcp_tools.png |
Adds screenshot asset referenced by README. |
| When START-LINE and NUM-LINES are non-nil, return only that line range." | ||
| (let ((buffer (get-buffer buffer-name))) | ||
| (if (not buffer) | ||
| (format "Error: Buffer not found: %s" buffer-name) |
There was a problem hiding this comment.
ai-code-mcp-buffer-query returns an "Error: ..." string when the buffer is missing. Since the MCP dispatcher doesn’t wrap tool execution in a condition-case here, this creates an inconsistent error signaling style vs other tools (which call error) and can make callers treat failures as successful tool output. Prefer signaling an error (or adopting a single, consistent error-return convention across all tools).
| (format "Error: Buffer not found: %s" buffer-name) | |
| (error "Buffer not found: %s" buffer-name) |
|
|
||
| jobs: | ||
| build: | ||
| if: false |
There was a problem hiding this comment.
The workflow is described as runnable manually via workflow_dispatch, but the only job has if: false, so it will never execute (even when manually triggered). Remove the always-false condition, or replace it with a condition that matches the intended enable/disable mechanism.
| if: false |
No description provided.