Skip to content

feat(unstable): scaffold session/delete behind unstable_session_delete#1222

Closed
chazcb wants to merge 3 commits into
agentclientprotocol:mainfrom
chazcb:chazcb/session-delete-unstable
Closed

feat(unstable): scaffold session/delete behind unstable_session_delete#1222
chazcb wants to merge 3 commits into
agentclientprotocol:mainfrom
chazcb:chazcb/session-delete-unstable

Conversation

@chazcb
Copy link
Copy Markdown
Contributor

@chazcb chazcb commented May 17, 2026

Summary

Scaffolds session/delete as the unstable schema feature unstable_session_delete, mirroring how session/list (#226) and session/fork (#311) first landed. The session-delete RFD was moved to Draft; this is the implementation step.

  • New unstable_session_delete feature flag (in the unstable umbrella).
  • DeleteSessionRequest (carries sessionId: SessionId) / DeleteSessionResponse, mirrored in v1 and v2.
  • SessionDeleteCapabilities and sessionCapabilities.delete builder.
  • Method-name constant, AgentMethodNames.session_delete, ClientRequest/AgentResponse variants, generate.rs routing.
  • v1↔v2 conversion impls + SessionCapabilities arms.
  • Two round-trip serialization tests.
  • Regenerated schemas + draft mdx.
  • RFD revision-history entry.

Question for reviewers

session/list updated docs/protocol/initialization.mdx Session Capabilities when it landed unstable; session/fork did not. Should this PR add a paragraph to initialization.mdx for delete now, or defer until the Preview move? Happy either way.

Test plan

  • cargo build — no-features / unstable_session_delete / unstable / unstable+unstable_protocol_v2 / --all-features
  • cargo clippy --all-features
  • cargo test --all-features
  • npm run generate
  • npx prettier --check .
  • ./scripts/spellcheck.sh

🤖 Generated with Claude Code

chazcb and others added 3 commits May 12, 2026 14:52
Adds the `session/delete` method as an unstable schema feature, mirroring
how session/list (agentclientprotocol#226) and session/fork (agentclientprotocol#311) first landed.

- New `unstable_session_delete` feature flag (Cargo.toml).
- `DeleteSessionRequest`/`DeleteSessionResponse` structs in v1 and v2
  (currently empty aside from `_meta` — fields TBD).
- `SessionDeleteCapabilities` and `sessionCapabilities.delete`.
- `session/delete` method name, AgentMethodNames entry, ClientRequest
  /AgentResponse variants, generate.rs routing.
- v2 conversion impls + SessionCapabilities arm.
- RFD revision-history entry.

Schema regeneration (npm run generate) and field choices to follow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- DeleteSessionRequest now carries `session_id: SessionId` (v1, v2);
  constructor takes the id, matching CloseSessionRequest.
- v2 conversion threads session_id through.
- Add round-trip serialization test and capabilities builder test.
- Fix `session.delete` -> `sessionCapabilities.delete` in variant docs.
- Bump RFD revision-history date.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Output of `npm run generate`:
- schema/schema.unstable.json
- schema/schema.v2.unstable.json
- schema/meta.unstable.json
- schema/meta.v2.unstable.json
- docs/protocol/draft/schema.mdx
- docs/protocol/draft/schema-v2.mdx

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chazcb chazcb requested a review from a team as a code owner May 17, 2026 16:32
@benbrandt
Copy link
Copy Markdown
Member

Hmm i think I beat you to it last night? With #1216?
Unless I missed something that isn't working for you?

@benbrandt benbrandt closed this May 17, 2026
@chazcb
Copy link
Copy Markdown
Contributor Author

chazcb commented May 17, 2026

Hmm i think I beat you to it last night? With #1216?
Unless I missed something that isn't working for you?

You beat me to it!! Ty @benbrandt

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.

2 participants