Skip to content

Merged upstream fork#2

Merged
davidwuchn merged 9 commits intomainfrom
merged-upstream-fork
Apr 6, 2026
Merged

Merged upstream fork#2
davidwuchn merged 9 commits intomainfrom
merged-upstream-fork

Conversation

@davidwuchn
Copy link
Copy Markdown
Owner

No description provided.

tninja and others added 9 commits April 4, 2026 15:58
* 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
Copilot AI review requested due to automatic review settings April 6, 2026 02:53
@davidwuchn davidwuchn merged commit 4ccdf13 into main Apr 6, 2026
2 of 4 checks passed
@davidwuchn davidwuchn deleted the merged-upstream-fork branch April 6, 2026 02:58
Copy link
Copy Markdown

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 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-type choices 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.

Comment thread ai-code-mcp-server.el
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)
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
(format "Error: Buffer not found: %s" buffer-name)
(error "Buffer not found: %s" buffer-name)

Copilot uses AI. Check for mistakes.

jobs:
build:
if: false
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
if: false

Copilot uses AI. Check for mistakes.
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.

3 participants