Skip to content

fix(schema): mark SessionInfo.additionalDirectories as default-on-null - #2571

Merged
benbrandt merged 1 commit into
mainfrom
fix/session-info-default-on-null-hint
Oct 28, 2026
Merged

benbrandt merged 1 commit into
mainfrom
fix/session-info-default-on-null-hint

Conversation

@benbrandt

Copy link
Copy Markdown
Member

#2567 made v2 SessionInfo.additionalDirectories parse null as empty (DefaultOnNull). It landed after #2569 added the x-deserialize-default-on-null hint to every DefaultOnNull field, so this one field never got the hint.

The TypeScript SDK reads the hint to decide whether null means empty. Without it, a listed session with additionalDirectories: null fails validation. session/list skips invalid entries, so that session drops out of the list instead of showing with no extra roots, as it does in Rust.

  • Add the hint to SessionInfo.additionalDirectories, which updates schema/v2/schema.json and schema/v2/schema.unstable.json.
  • Add source_default_on_null_fields_are_schema_annotated to the schema generator, mirroring the existing DefaultOnError check, so a DefaultOnNull field without the hint fails CI. It catches this field when the fix is reverted.

Found while updating the SDKs to schema-v1.27.0 / v2.0.0-alpha.10. This needs a schema patch release before the SDKs can pick it up.

npm run check passes.

#2567 made v2 SessionInfo.additionalDirectories parse null as empty but
landed after #2569 added the x-deserialize-default-on-null hint, so the
field missed it. Generated parsers that read the hint (the TypeScript SDK)
then reject null there, and because session/list skips invalid entries, the
whole session drops out of the list instead of listing with no roots.

Add the hint and a schema-generator test, like the existing DefaultOnError
one, that fails when a DefaultOnNull field has no hint.

Co-Authored-By: Claude <noreply@anthropic.com>
@benbrandt
benbrandt requested a review from a team as a code owner October 27, 2026 22:48
@benbrandt
benbrandt merged commit 212870d into main Oct 28, 2026
13 checks passed
@benbrandt
benbrandt deleted the fix/session-info-default-on-null-hint branch October 28, 2026 07:28
@acp-release-bot acp-release-bot Bot mentioned this pull request Oct 28, 2026
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