fix(acp): answer initialize with version 1 instead of rejecting newer protocol versions

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

@yallhasuji-hash is already working on this.

Since Oct 17, 2026.

  • #73 by @yallhasuji-hash — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
20/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Read _initialize in runtimes/common/agentkit_serve_common/acp.py and the related tests in runtimes/common/tests/test_acp_protocol.py; an open linked pull request (#73) indicates work is already underway. The issue specifies valid and invalid version cases; done means the tests pass and initialize returns protocol version 1 for valid requests while rejecting invalid values.

Written by the indexing model from the issue text.

Description

area/acp bug good first issue

Problem

When a client connects to AgentKit's ACP mode, the first message is initialize. It carries protocolVersion, the newest ACP version the client can speak. The ACP spec says how the agent must answer:

If the Agent supports the requested version, it MUST respond with the same version. Otherwise, the Agent MUST respond with the latest version it supports.

The client then decides whether it can work with that version.

AgentKit doesn't follow this. In runtimes/common/agentkit_serve_common/acp.py, _initialize rejects any version other than 1 with an "invalid params" error, around line 577:

if type(version) is not int or version != ACP_PROTOCOL_VERSION:
    raise ACPProtocolError(_INVALID_PARAMS, f"protocolVersion must be {ACP_PROTOCOL_VERSION}")

ACP version 2 is now published as a draft, and clients are starting to ask for it. A client that sends protocolVersion: 2 gets an error from AgentKit instead of the answer "1", which the client could have accepted.

What

Answer initialize with version 1 whenever the client asks for any valid version, so the client can decide. Keep rejecting values that aren't a valid version number.

Out of scope:

  • Supporting ACP version 2. This change only makes AgentKit answer correctly for the version it supports.

Why

  • It follows the ACP spec.
  • Clients that try version 2 first, then fall back to 1, keep working with AgentKit.
  • Orka plans to ask newer agents for version 2 one day, see orka-agents/orka#749. AgentKit shouldn't break when that happens.

How

  1. In _initialize, accept any integer from 0 to 65535, the range ACP version numbers use. Always reply with "protocolVersion": ACP_PROTOCOL_VERSION. Keep the "invalid params" error for anything else: a missing value, a string, a float, a boolean, or a number outside that range. Python treats True as an integer, which the existing type(version) is not int check already rejects. Keep that check.
  2. Add tests in runtimes/common/tests/test_acp_protocol.py:
    • Requests for 1, 2 and 65535 all get protocolVersion: 1 back, and the session works afterwards.
    • Requests for 0 get 1 back.
    • A missing value, "1", 1.0, true, -1 and 65536 get "invalid params".
  3. Run uv run --directory runtimes/common --extra dev pytest -q.

Done when

  • initialize with any valid version returns protocolVersion: 1.
  • Values that aren't valid versions still return "invalid params".
  • The tests above pass.
Dominant language
Python
Stars
7
Forks
5
Avg merge
3h 39m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from orka-agents/agentkit

All issues in orka-agents/agentkit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.