Skip to content

fix: conform to acp-tck across stdio and Streamable HTTP - #6

Merged
phil65 merged 2 commits into
mainfrom
feat/acp-tck-conformance
Nov 28, 2026
Merged

phil65 merged 2 commits into
mainfrom
feat/acp-tck-conformance

Conversation

@phil65

@phil65 phil65 commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes Streamable HTTP and v2 initialize conformance issues caught by the official acp-tck:
    • http_server.py: forward initialize requests that include Acp-Connection-Id to the existing connection instead of rejecting with HTTP 400, allowing v2 idempotent repeats (ACP-INIT-212) and post-request -32600 (ACP-INIT-215).
    • http_transport.py: return -32600 (INVALID_REQUEST) for requests before initialize (ACP-ERROR-005), deliver HTTP 200 JSON-RPC initialize errors verbatim while keeping the transport open for retry (ACP-INIT-211), and reject JSON-RPC batch arrays with -32600 (ACP-BATCH-209, ACP-JSONRPC-005).
    • router.py & v2/agent.py: enforce protocolVersion <= 65535 (uint16, ACP-INIT-206) and leniently ignore unparseable fields (e.g. capabilities) on initialize requests for newer protocol versions (ACP-INIT-214).
  • Adds an opt-in acp-tck conformance suite (tests/tck_agent.py, tests/test_acp_tck.py, tck duty in duties.py) and a path-filtered CI workflow (.github/workflows/acp-tck.yml) running [email protected] for v1 and v2 over both stdio and Streamable HTTP.
  • Adds targeted unit tests in tests/test_http_transport.py, tests/test_http_server.py, and tests/v2/test_runtime.py.

Test plan

  • uv run ruff check ., uv run ruff format --check ., uv run ty check
  • uv run pytest -q (253 passed, 4 opt-in TCK skipped)
  • ACP_TCK=1 uv run pytest tests/test_acp_tck.py -v (4/4 CONFORMANT: stdio[v1], stdio[v2], streamable_http[v1], streamable_http[v2])

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.10%. Comparing base (c9114da) to head (45368f6).

Files with missing lines Patch % Lines
src/aclientp/http_transport.py 76.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #6      +/-   ##
==========================================
+ Coverage   79.98%   80.10%   +0.12%     
==========================================
  Files         107      107              
  Lines        8494     8516      +22     
==========================================
+ Hits         6794     6822      +28     
+ Misses       1700     1694       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@phil65
phil65 force-pushed the feat/acp-tck-conformance branch from 3629737 to a4aad49 Compare November 28, 2026 00:03
…ize fallback

- is_protocol_version() in schema.lenient, used by the router and v2 parse_initialize
  (one MAX_PROTOCOL_VERSION instead of two).
- parse_initialize: back to the info-only fallback. capabilities is DefaultOnError in
  the schema, so malformed capabilities were already dropped; the full-request
  fallback also discarded valid fields. Old and new behave the same on every case
  tested, and acp-tck v0.5.0 stays conformant (4/4).
- test_acp_tck: fail with acp-tck's output when it writes no report.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@phil65
phil65 merged commit 0c04ca6 into main Nov 28, 2026
18 of 24 checks passed
@phil65
phil65 deleted the feat/acp-tck-conformance branch November 28, 2026 09:52
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