Skip to content

fix(app-server-protocol): serialize ThreadItem tool/image nullable fields as explicit null#164

Open
andrei-hasna wants to merge 3 commits into
mainfrom
openloops/open-codewith/8df786e1-63d0-444d-adc7-ee52f490511e-6507d973
Open

fix(app-server-protocol): serialize ThreadItem tool/image nullable fields as explicit null#164
andrei-hasna wants to merge 3 commits into
mainfrom
openloops/open-codewith/8df786e1-63d0-444d-adc7-ee52f490511e-6507d973

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

Aligns v2 ThreadItem tool/image nullable fields with the explicit-null payload contract.

  • Remove #[serde(default, skip_serializing_if = "Option::is_none")] + #[ts(optional)] from ThreadItem::McpToolCall.mcp_app_resource_uri and ThreadItem::ImageGeneration.saved_path, so they serialize as present null like neighboring nullable fields (pluginId, result, error, durationMs, revisedPrompt).
  • Regenerate TypeScript fixtures: mcpAppResourceUri: string | null, savedPath: AbsolutePathBuf | null. JSON schema fixtures were already nullable/consistent (regeneration is idempotent).
  • Add focused serialization tests asserting absent values emit explicit null.

Acceptance criteria

  • McpToolCall with mcp_app_resource_uri: None emits mcpAppResourceUri: null
  • ImageGeneration with saved_path: None emits savedPath: null
  • TypeScript/JSON schema fixtures present-nullable, not optional
  • Focused tests cover absent-value shape
  • TUI resume/replay/redaction unchanged (30 history_replay tests pass)
  • No unrelated protocol cleanup

Validation

  • just write-app-server-schema — idempotent, no unexpected diffs
  • just test-fast -p codex-app-server-protocol (new + existing) — pass
  • just test-fast -p codex-app-server --test all mcp_tool — 5 pass
  • just test-fast -p codex-tui history_replay — 30 pass
  • just fmt clean, just fix -p codex-app-server-protocol clippy clean

🤖 Generated with Claude Code

andrei-hasna and others added 3 commits July 6, 2026 22:40
…elds as explicit null

Remove skip_serializing_if/ts(optional) from ThreadItem::McpToolCall.mcp_app_resource_uri
and ThreadItem::ImageGeneration.saved_path so they serialize as present null like
neighboring nullable fields, aligning Rust, TypeScript, and JSON schema with the v2
explicit-null payload contract. Regenerate TypeScript fixtures and add focused
absent-value serialization tests.

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