Skip to content

Probe capability-gated session/close in the protocol matrix - #495

Open
sweetu12 wants to merge 3 commits into
agentclientprotocol:mainfrom
sweetu12:codex/registry-session-close-probe
Open

Probe capability-gated session/close in the protocol matrix#495
sweetu12 wants to merge 3 commits into
agentclientprotocol:mainfrom
sweetu12:codex/registry-session-close-probe

Conversation

@sweetu12

@sweetu12 sweetu12 commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • replace the stale session/stop capability, probe, JSON, Markdown, and summary fields with session/close
  • gate close on a present object-valued sessionCapabilities.close advertisement and a successfully created real session ID
  • execute close once and last, preserving unsuccessful JSON-RPC results instead of treating parameter or missing-resource errors as support
  • emit probeSchemaVersion: 2 and reject reuse of every unversioned or non-v2 snapshot
  • add deterministic standard-library tests and run them before the nightly production matrix step

Behavior

Negotiated close Successful session/new with ID Matrix action/result
omitted or null either no close request; not_applicable
advertised object no no close request; not_probed
advertised object yes one session/close, last, with the returned ID; preserve actual result

A successful close must contain an object result and no simultaneous JSON-RPC error. {} and an object with valid reserved _meta are accepted. invalid_params, resource_not_found, malformed or ambiguous responses, and other errors remain visible and do not increment the close-supported summary count. Ambiguous session/new responses likewise cannot supply a trusted session ID or schedule close.

Schema 2 is deliberately not backward-reused. With --changed-only, an existing unversioned/schema-1 or mismatched snapshot is discarded as a reuse source and every selected agent is probed again. Historical committed snapshots are not rewritten by this patch.

Test plan

  • python3 -m unittest tests.test_protocol_matrix_close -v
  • uv run --with pytest pytest tests/ -v
  • uv run --with ruff ruff check .
  • uv run --with ruff ruff format --check .

Local Windows evidence:

  • focused standard-library suite: 18 tests passed
  • Windows-compatible repository suite: 134 passed, 2 skipped, 4 Unix-only tests deselected
  • Ruff lint and format checks passed
  • Python syntax compilation passed
  • an in-memory mutant that probed close despite omitted/null capability was killed by both negative subcases
  • an in-memory mutant that accepted a response containing both result and error was killed by the malformed-response regression test
  • an in-memory mutant that trusted an ambiguous session/new result and scheduled close was killed by the production-path regression test

The complete unfiltered suite was also run on Windows. Its only four failures were existing Unix assumptions: two POSIX executable-bit assertions and two select()-on-pipe tests. No live matrix, credentials, external agents, or model execution were used. Linux process-I/O behavior should be confirmed by normal upstream CI; this change leaves those Unix mechanics unchanged.

Migration and scope

The first scheduled run after merge emits a new schema-2 snapshot and fully re-probes selected agents. There is no stop-to-close row translation. This PR does not claim ACP conformance, modify agent metadata, rewrite historical generated snapshots, or add authentication/model-dependent lifecycle flows.

@sweetu12
sweetu12 marked this pull request as ready for review August 12, 2026 17:27
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