Probe capability-gated session/close in the protocol matrix - #495
Open
sweetu12 wants to merge 3 commits into
Open
Probe capability-gated session/close in the protocol matrix#495sweetu12 wants to merge 3 commits into
sweetu12 wants to merge 3 commits into
Conversation
sweetu12
marked this pull request as ready for review
August 12, 2026 17:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session/stopcapability, probe, JSON, Markdown, and summary fields withsession/closesessionCapabilities.closeadvertisement and a successfully created real session IDprobeSchemaVersion: 2and reject reuse of every unversioned or non-v2 snapshotBehavior
session/newwith IDnot_applicablenot_probedsession/close, last, with the returned ID; preserve actual resultA successful close must contain an object result and no simultaneous JSON-RPC error.
{}and an object with valid reserved_metaare accepted.invalid_params,resource_not_found, malformed or ambiguous responses, and other errors remain visible and do not increment the close-supported summary count. Ambiguoussession/newresponses 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 -vuv run --with pytest pytest tests/ -vuv run --with ruff ruff check .uv run --with ruff ruff format --check .Local Windows evidence:
resultanderrorwas killed by the malformed-response regression testsession/newresult and scheduled close was killed by the production-path regression testThe 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.