Upstream sync: post-v1.0.0-beta.4 round 2 (#1299, #1315) + schema 1.0.49#108
Merged
Conversation
Ports the SessionFs SQLite support (upstream PR #1299) and bumps the
pinned schema version from 1.0.49-1 to 1.0.49.
### SessionFs SQLite (upstream PR #1299)
- New optional `:sqlite {:query :exists}` sub-provider for the
provider-style `createSessionFsHandler` factory. Low-level handlers
expose flat `:sqlite-query` / `:sqlite-exists` keys; the adapter
bridges between them.
- Clients advertise support via `:capabilities {:sqlite true}` under
`:session-fs`; the value is forwarded on `sessionFs.setProvider` and
validated at session creation (throws when capabilities.sqlite is
declared but the provider lacks :sqlite).
- `queryType` is coerced from the wire string to an idiomatic
keyword (`#{:exec :query :run}`) before reaching the handler.
- SQL bind-parameter map keys (e.g. `$userId`) bypass kebab-case
conversion via a new escape hatch in `protocol/normalize-incoming`.
- Result row column-name keys (e.g. `:user_id`, `:created_at`)
round-trip verbatim on the outgoing wire path via a new
`preserve-outgoing-opaque-fields` escape hatch in `protocol/`,
matching upstream Node.js semantics where provider rows are forwarded
untouched. (review feedback)
- SQLite handler exceptions propagate as JSON-RPC errors (not wrapped
as SessionFsError result maps), matching upstream Node behavior.
### Schema 1.0.49
- `.copilot-schema-version` advanced from `1.0.49-1` to `1.0.49`
- Additive only: new named enum types, format annotations, and the
new sessionFs.sqliteQuery / sessionFs.sqliteExists RPC methods
- Regenerated event_specs.clj reflects the new enums
- (upstream PRs #1305, #1307, #1327, #1333)
### Other
- Updated `examples/permission_bash.clj` from deprecated `:approved`
to current `:approve-once` (carried from upstream PR #1315)
- Added integration tests covering the SQLite adapter, RPC dispatch,
capability forwarding, validation throw, opaque param keys, and
the new snake_case column-name round-trip regression test
### Validation
- bb test: 269 tests / 1275 assertions pass
- bb validate-docs: 0 warnings
- ./run-all-examples.sh: all examples pass
- E2E: 2 pre-existing failures (test-e2e-connection ping timestamp,
test-e2e-blob-attachment timeout) due to local CLI 1.0.51-2 drift
from the pinned 1.0.49 schema; unrelated to these changes
### Multi-model code review
Parallel reviews via Claude Opus 4.7 and GPT-5.5 both flagged the same
HIGH severity bug: outgoing SQL row column names were being mangled by
recursive kebab→camelCase conversion (`util/clj->wire`). Fixed by
adding `preserve-outgoing-opaque-fields` in protocol.clj, mirroring the
existing incoming escape hatch for bind params. Regression test added.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Ports upstream SessionFs SQLite support (PR #1299), updates an example per upstream (PR #1315), and bumps pinned Copilot schema assets to 1.0.49 to keep the Clojure SDK wire layer aligned with upstream.
Changes:
- Add SessionFs SQLite RPC support (
sessionFs.sqliteQuery,sessionFs.sqliteExists) including capability advertisement and handler/provider adaptation. - Add protocol escape hatches to preserve opaque SQL bind-parameter keys on incoming requests and preserve row column keys on outgoing sqlite results.
- Bump pinned schema version to
1.0.49and regenerate generated event specs; updatepermission_bashexample and changelog/docs accordingly.
Show a summary per file
| File | Description |
|---|---|
| test/github/copilot_sdk/mock_server.clj | Mock server now responds to sessionFs.setProvider for new capability forwarding tests. |
| test/github/copilot_sdk/integration_test.clj | Adds integration tests covering sqlite adapter behavior, RPC dispatch, capability forwarding, and opaque key preservation. |
| src/github/copilot_sdk/specs.clj | Extends specs with session-fs capabilities, optional sqlite handler keys, and sqlite query type/result shapes. |
| src/github/copilot_sdk/session.clj | Implements sqlite adapter wiring, queryType coercion, and capability validation on handler installation. |
| src/github/copilot_sdk/protocol.clj | Adds incoming/outgoing opaque-field preservation for sqlite bind params and result row keys. |
| src/github/copilot_sdk/generated/event_specs.clj | Regenerated specs from updated schemas (enum tightening, etc.). |
| src/github/copilot_sdk/client.clj | Routes new sqlite RPC methods and forwards :session-fs.capabilities on sessionFs.setProvider. |
| schemas/session-events.schema.json | Upstream schema refresh (formats/enums/refs) as part of 1.0.49 bump. |
| schemas/api.schema.json | Upstream API schema refresh adding sqlite RPCs and related type refactors as part of 1.0.49 bump. |
| schemas/README.md | Updates pinned schema version text to 1.0.49. |
| .copilot-schema-version | Bumps pinned schema version to 1.0.49. |
| examples/permission_bash.clj | Updates permission decision kind to :approve-once. |
| doc/reference/API.md | Documents optional sqlite support for SessionFs providers/handlers. |
| CHANGELOG.md | Adds Unreleased entries for sqlite support + schema bump + example fix. |
Copilot's findings
- Files reviewed: 13/14 changed files
- Comments generated: 2
- session.clj: capabilities.sqlite validation now requires BOTH :sqlite-query
and :sqlite-exists (previously only :sqlite-query). A low-level handler
declaring only :sqlite-query would have passed validation but failed at
runtime with an opaque "Unknown sessionFs method" error when
sessionFs.sqliteExists arrived. The throw now reports which handler
keys are missing.
- doc/reference/API.md: clarify that the low-level handler map requires
the 10 core FS operations and the two :sqlite-* keys are optional
(only required when :capabilities {:sqlite true} is advertised).
- integration_test.clj: regression test that create-session throws when
capabilities.sqlite=true and the low-level handler has :sqlite-query
but not :sqlite-exists.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Ports the SessionFs SQLite support from upstream PR #1299, updates
examples/permission_bash.cljper upstream PR #1315, and bumps the pinned schema version from1.0.49-1to1.0.49.Changes
SessionFs SQLite support (upstream PR #1299)
:sqlite {:query :exists}sub-provider for the provider-stylecreateSessionFsHandlerfactory. Low-level handlers expose flat:sqlite-query/:sqlite-existskeys; the adapter bridges between them.:capabilities {:sqlite true}under:session-fs; the value is forwarded onsessionFs.setProviderand validated at session creation (throws whencapabilities.sqliteis declared but the provider lacks:sqlite).queryTypeis coerced from the wire string to an idiomatic keyword (#{:exec :query :run}) before reaching the handler.$userId) bypass kebab-case conversion via an escape hatch inprotocol/normalize-incoming.:user_id,:created_at) round-trip verbatim on the outgoing wire path via a newpreserve-outgoing-opaque-fieldsescape hatch inprotocol.clj, matching upstream Node.js semantics. (Found via multi-model code review.)Schema 1.0.49
.copilot-schema-versionadvanced from1.0.49-1to1.0.49formatannotations, and the new sqlite RPC methodsevent_specs.cljreflects the new enums (upstream PRs #1305, #1307, #1327, #1333)Examples
examples/permission_bash.cljfrom deprecated:approvedto current:approve-once(upstream PR #1315)Validation
bb testbb validate-docs./run-all-examples.shMulti-model code review
Parallel reviews via Claude Opus 4.7 and GPT-5.5 both independently identified a HIGH severity bug:
preserve-outgoing-opaque-fieldsescape hatch + regression testcapabilities.sqlitevalidation only checks:sqlite-querysession-fs-provider?already validates both arities; mirrors upstreamclient.ts:466await-session-fs-result::sqlite-rows/::sqlite-columnsused wrongseq?predicate(s/coll-of …)Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com