Skip to content

feat: advertise authMethods for ACP registry compatibility#8

Merged
william0wang merged 1 commit into
mainfrom
feat/acp-registry-support
Jul 5, 2026
Merged

feat: advertise authMethods for ACP registry compatibility#8
william0wang merged 1 commit into
mainfrom
feat/acp-registry-support

Conversation

@william0wang

Copy link
Copy Markdown
Owner

Summary

Prepares zcode-acp-server for submission to the ACP Registry by advertising the correct authMethods at initialize time and adding the registry submission assets.

Background

The ACP registry CI (verify_agents.py --auth-check) rejects agents that return authMethods: []. The validation requires at least one method with type ∈ {`"agent"`, `"terminal"`} (type omitted defaults to `"agent"`). Our previous empty array would fail with `"No authMethods in response"`.

Our authentication model is agent-managed: the GLM API key is read from `~/.zcode/v2/config.json` by the ZCode backend subprocess — the editor never supplies credentials. This maps to ACP's `AuthMethodAgent` (the same pattern used by `glm-acp-agent`, our closest analog).

Changes

1. `src/server.ts` — correct `authMethods`

```diff

  •  authMethods: [],
    
  •  authMethods: [
    
  •    {
    
  •      id: "zcode-credentials",
    
  •      name: "ZCode built-in credentials",
    
  •      description: "Reads the GLM API key from ~/.zcode/v2/config.json ...",
    
  •    },
    
  •  ],
    

```
Also removed the meaningless `agentCapabilities.auth: {}` (empty object).

2. `tests/server.test.ts` (new) — 6 tests covering registry gates

  • `authMethods` is non-empty (CI gate: rejects `[]`)
  • ≥1 method recognisable as `"agent"` type (CI gate: type validation)
  • Each method has required `id` + `name` fields
  • `initialize` does NOT spawn the backend (CI runs in an isolated HOME with no `config.json` — `initialize` must succeed without credentials)

3. `registry/zcode-acp-server/` — submission assets

  • `agent.json` — modelled on `glm-acp-agent`: id/name/version/description/repository/license/distribution.npx
  • `icon.svg` — 16×16 monochrome `"Z"` mark, `fill="currentColor"` only (per icon guidelines)

4. `README.md` / `README.zh-CN.md` — "ACP Registry" section

Documents the auth model and points at the submission assets.

Verification

  • `pnpm build` — clean
  • `pnpm test` — 100/100 passing (94 → 100; +6 new initialize tests)
  • `authMethods` JSON shape matches `AuthMethodAgent` in the SDK schema
  • `initialize` confirmed not to read credentials (backend is lazy-spawned on first `session/new`, not during handshake)

Subsequent steps (not in this PR)

  1. `npm publish` — the `distribution.npx.package` in `agent.json` (`zcode-acp-server@0.1.0`) must match a published npm version. `package.json` already has `bin`/`files`/`main` configured.
  2. PR to `agentclientprotocol/registry` — copy `registry/zcode-acp-server/` into a fork of the registry repo and open a PR; CI will validate schema + icon + auth.
  3. CI isolated-env smoke test — `python3 .github/workflows/verify_agents.py --auth-check` in the registry repo.

Design note

The `AuthMethodAgent` variant intentionally omits the `type` field — per the registry validator (`client.py:parse_auth_methods`), omitted type defaults to `"agent"`. This is the canonical shape for "agent self-handles auth" and matches every CLI-wrapping agent in the registry (`gemini`, `claude-acp`, `codex-acp`, `glm-acp-agent`, etc.).

The ACP registry CI rejects agents with empty authMethods. Declare a
single agent-type method (ZCode reads the GLM API key from
~/.zcode/v2/config.json itself — no editor-side credentials needed),
matching the glm-acp-agent precedent. Adds registry submission assets
(agent.json + icon.svg) and 6 initialize-shape tests covering the
registry's validation gates.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds compatibility with the ACP Registry by introducing registry submission assets (agent.json and icon.svg), updating the initialize response in src/server.ts to advertise a built-in agent-type authentication method, documenting these changes in the READMEs, and adding a comprehensive test suite in tests/server.test.ts to verify the initialization response shape. The reviewer suggested updating the repository and website URLs in agent.json to point to the official repository instead of a personal fork.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread registry/zcode-acp-server/agent.json
@william0wang william0wang merged commit 453ee8d into main Jul 5, 2026
1 check passed
@william0wang william0wang deleted the feat/acp-registry-support branch July 5, 2026 14:01
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.

1 participant