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

Abierto
#41 0 comentarios 0 reacciones 0 asignados Ver en GitHub

@yallhasuji-hash ya está trabajando en esto.

Desde el 17/10/2026.

  • #73 de @yallhasuji-hash — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
20/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Python
Estrellas
7
Forks
5
Merge medio
3 h 39 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de orka-agents/agentkit

Todos los issues de orka-agents/agentkit

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.