Skip to content

[upstream-sync] Port disconnect! from upstream PR #599#42

Closed
github-actions[bot] wants to merge 1 commit intomainfrom
upstream-sync/2026-03-06-4e0e7c7baab8674a
Closed

[upstream-sync] Port disconnect! from upstream PR #599#42
github-actions[bot] wants to merge 1 commit intomainfrom
upstream-sync/2026-03-06-4e0e7c7baab8674a

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 6, 2026

Summary

Ports upstream PR #599: adds disconnect! as the preferred method for closing sessions, deprecating destroy!.

Upstream Changes

The upstream Node.js SDK added disconnect() as the new preferred way to close a session, with destroy() deprecated to delegate to disconnect(). The wire protocol remains unchanged — both methods still send session.destroy on the wire.

Changes

  • session/disconnect! — new preferred function for closing a session. Same semantics as destroy!: sends session.destroy RPC, clears all handlers, closes the event channel. Session disk state is preserved for resumption.
  • session/destroy! — deprecated; now delegates to disconnect!. Kept for backward compatibility.
  • github.copilot-sdk/disconnect! — re-exported at top-level namespace.
  • github.copilot-sdk/destroy! — re-exported, now delegates to disconnect!, deprecated in docstring.
  • with-session and with-client-session macros — updated to call disconnect! in their finally cleanup forms.
  • client/stop! — internally calls session/disconnect! instead of session/destroy!.
  • instrument.clj — added disconnect! fdef (same spec as destroy!); added to both instrument-all! and unstrument-all! lists.
  • doc/reference/API.md — added disconnect! section, marked destroy! as deprecated.
  • CHANGELOG.md — updated [Unreleased] section.

Upstream PRs Skipped

All other upstream commits since last sync (2026-03-05):

PR Reason skipped
Various dep bumps (#649–#657) CI/CD tooling only
#643 .NET SDK only
#631 .NET and Go only
#673 Dependabot config
#670, #671 Go/Python only; get_last_session_id already ported
#675 Docs only
#659, #665 Test infrastructure only
#681 Python only
#684, #685 Go type conflict fix — not applicable to Clojure

Testing

  • Documentation validated with bb validate-docs — passed (0 warnings)
  • Network unavailable in sandbox, so bb test could not run; changes are straightforward refactoring with no behavioral change to existing callers (destroy! still works, just delegates)

Generated by Upstream Sync Agent

  • expires on Mar 13, 2026, 1:55 PM UTC

…stroy!

Port upstream PR #599: add disconnect() as the preferred method for
closing sessions across all SDKs, with destroy() deprecated to delegate
to disconnect().

Changes:
- Add session/disconnect! with same semantics as destroy! (sends
  session.destroy RPC, clears handlers, closes event channel)
- Deprecate session/destroy! to delegate to disconnect!
- Add disconnect! to github.copilot-sdk top-level namespace
- Update with-session and with-client-session macros to use disconnect!
- Update client stop! to call session/disconnect! internally
- Add disconnect! to both instrument-all! and unstrument-all! lists
- Document disconnect! in API reference, mark destroy! as deprecated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant