Skip to content

fix(app-server-protocol): align v2 skills response nullability#166

Open
andrei-hasna wants to merge 1 commit into
mainfrom
openloops/open-codewith/7e09d1a9-b251-4262-9c11-71fcb8f61555-f4b46e6b
Open

fix(app-server-protocol): align v2 skills response nullability#166
andrei-hasna wants to merge 1 commit into
mainfrom
openloops/open-codewith/7e09d1a9-b251-4262-9c11-71fcb8f61555-f4b46e6b

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

Align the v2 skills-list response metadata types with the v2 explicit-null response contract.

SkillMetadata and SkillToolDependency are nested response payloads returned through SkillsListEntry.skills, but several optional fields used #[serde(default, skip_serializing_if = "Option::is_none")] and #[ts(optional)]. That omitted absent values from the wire and generated TypeScript that exposed them as optional (shortDescription?: string, description?: string), diverging from the v2 contract that response-side nullable fields serialize as present null.

This matches the already-established ThreadGoalUpdatedNotification.turn_id: Option<String> pattern.

Changes

  • plugin.rs: remove #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] from SkillMetadata.{short_description, interface, dependencies} and SkillToolDependency.{description, transport, command, url}, leaving plain Option<T>.
  • Regenerated TS fixtures (SkillMetadata.ts, SkillToolDependency.ts): fields flip from ?: T to T | null. JSON schema already emitted nullable types (matches the reference pattern), so SkillsListResponse.json is unchanged.
  • Added focused serialization tests for the no-metadata and no-dependency-details cases asserting present-null output.

Scoped strictly to skills-list response metadata; no request-param or MCP schema changes.

Validation

  • just write-app-server-schema (fixtures regenerated, in sync)
  • just test-fast -p codex-app-server-protocol — 258 passed, incl. 2 new tests and generated_ts_optional_nullable_fields_only_in_params
  • just fmt, just fix -p codex-app-server-protocol — clean
  • Independent adversarial verifier: PASS

🤖 Generated with Claude Code

SkillMetadata and SkillToolDependency are nested v2 response payloads
returned through SkillsListEntry.skills, but their optional fields used
`#[serde(default, skip_serializing_if = "Option::is_none")]` and
`#[ts(optional)]`, so absent values were omitted from the wire and
generated TypeScript exposed them as optional (`shortDescription?: string`).
That diverges from the v2 explicit-null response contract.

Drop the response-side skip/default/ts(optional) attributes so these
fields serialize as present `null` and render as `T | null` in TypeScript,
matching the established `ThreadGoalUpdatedNotification.turn_id` pattern.
Regenerate the TS schema fixtures (JSON schema already emitted nullable
types) and add focused serialization coverage for the no-metadata and
no-dependency-details cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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