Skip to content

Add terminal and _meta capability support to initialize request - #15

Closed
timvisher-dd wants to merge 4 commits into
xenodium:mainfrom
timvisher-dd:support-terminal-and-meta-caps
Closed

Add terminal and _meta capability support to initialize request#15
timvisher-dd wants to merge 4 commits into
xenodium:mainfrom
timvisher-dd:support-terminal-and-meta-caps

Conversation

@timvisher-dd

@timvisher-dd timvisher-dd commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Fixes xenodium/agent-shell#342

See that issue for the full problem description and perf measurements.

Checklist

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've added tests where applicable.

Implementation

acp-make-initialize-request gains two new optional keyword arguments:

  • :terminal-capability — boolean (or :false) controlling whether terminal appears in clientCapabilities. When nil (the default) it is omitted entirely, preserving backward compatibility.

  • :meta-capabilities — an alist sent under the _meta key in clientCapabilities. This is where clients advertise support for extensions like terminal_output. When nil, _meta is omitted.

The existing :read-text-file-capability and :write-text-file-capability arguments are unchanged.

Example

(acp-make-initialize-request
 :protocol-version 1
 :client-info '((name . "agent-shell") (version . "1.0"))
 :read-text-file-capability t
 :write-text-file-capability t
 :terminal-capability t
 :meta-capabilities '((terminal_output . t)))

Produces JSON with:

{
  "clientCapabilities": {
    "fs": { "readTextFile": true, "writeTextFile": true },
    "terminal": true,
    "_meta": { "terminal_output": true }
  }
}

Tests

4 new tests in tests/acp-test.el:

  • test-acp-make-initialize-request-omits-terminal-and-meta-when-nil — verifies backward compat: no terminal or _meta keys when args are nil.
  • test-acp-make-initialize-request-terminal-trueterminal: true when :terminal-capability t.
  • test-acp-make-initialize-request-terminal-falseterminal: false when :terminal-capability :false.
  • test-acp-make-initialize-request-meta-capabilities — arbitrary alist is passed through under _meta.

@timvisher-dd timvisher-dd changed the title # Add terminal and _meta capability support to initialize request Add terminal and _meta capability support to initialize request Feb 26, 2026
Co-authored-by: Codex <codex@openai.com>
@timvisher-dd
timvisher-dd force-pushed the support-terminal-and-meta-caps branch from 2b8029d to 5f66c7f Compare March 14, 2026 16:46
@timvisher-dd
timvisher-dd marked this pull request as ready for review March 14, 2026 21:01
@timvisher-dd

Copy link
Copy Markdown
Contributor Author

This has been thoroughly battle tested at this point. Whether agent-shell chooses to land proper support for terminal and meta caps I see no reason why acp.el shouldn't allow clients to declare it. WDYT? :)

timvisher-dd and others added 3 commits March 15, 2026 16:40
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bin/test runs byte-compilation, ERT tests, and checks that README.org
is updated when code changes. GitHub Actions CI mirrors this on every
push and PR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timvisher-dd

Copy link
Copy Markdown
Contributor Author

Closed by timvisher-dd#1

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.

Support streaming tool output and deduplication

1 participant