fix(acp): answer initialize with version 1 instead of rejecting newer protocol versions
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 20/100
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
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
- 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 treatsTrueas an integer, which the existingtype(version) is not intcheck already rejects. Keep that check. - Add tests in
runtimes/common/tests/test_acp_protocol.py:- Requests for 1, 2 and 65535 all get
protocolVersion: 1back, and the session works afterwards. - Requests for 0 get 1 back.
- A missing value,
"1",1.0,true, -1 and 65536 get "invalid params".
- Requests for 1, 2 and 65535 all get
- Run
uv run --directory runtimes/common --extra dev pytest -q.
Done when
initializewith any valid version returnsprotocolVersion: 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
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de orka-agents/agentkit
-
fix(pydantic-ai): CI fails with newest pydantic-ai (unexpected 'history' argument)Posiblemente ocupada @gambtho la tomó hace 30 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
orka-agents/agentkit#77 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
orka-agents/agentkit#76 · 3 comentarios ·
-
area/build area/orka area/runtime blocked enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
orka-agents/agentkit#69 ·
-
area/build area/orka area/runtime enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
orka-agents/agentkit#68 ·
-
area/build enhancement testing
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
orka-agents/agentkit#65 ·
Todos los issues de orka-agents/agentkit
Issues similares
-
bot-triaged module: correctness (silent) module: fft triage review
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Remove Python pin in recipeAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
conda-forge/zarpaint-feedstock#8 · 1 comentario · 1 reacción ·
-
plot_prediction colorbar shows a 0-1 range instead of the data rangePosiblemente ocupada @nikhil3495 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mllam/neural-lam#902 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
didi/helixharness#28 ·
Los mantenedores suelen responder en 1 día
-
【文档错误】创建镜像空间步骤中的截图标注与文字描述不一致Abiertoenhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
DaoCloud/DaoCloud-docs#7839 ·
Los mantenedores suelen responder en 1 día