Skip to content

Conversation

@ThomasK33
Copy link
Member

@ThomasK33 ThomasK33 commented Nov 2, 2025

Replace SanitizeComment with FormatDocComment to maintain the original structure of JSON schema descriptions.
The new approach preserves paragraph breaks and line-by-line formatting instead of collapsing multi-line descriptions into single lines.

Added emitDocComment and appendDocComments helper functions to standardize doc comment emission across the code generator.
Deprecated SanitizeComment in favor of the new formatting function.

This improves the readability of the generated API documentation by maintaining the intended structure of schema descriptions.

@ThomasK33 ThomasK33 changed the title thomask33/11 02 preserve multiline doc comments refactor: preserve multi-line formatting in generated doc comments Nov 2, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33 ThomasK33 force-pushed the thomask33/11-02-preserve_multiline_doc_comments branch from 65388d0 to ce1c521 Compare November 3, 2025 01:36
@ThomasK33
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Updates the ACP schema from v0.4.9 to v0.6.2, incorporating latest
protocol changes and type definitions. Enhances code generation with
smart nested type naming that applies multiple heuristics to create
idiomatic Go type names while preventing collisions.

Key improvements:
- Implements word-boundary deduplication for nested types
- Strips RPC suffixes (Request/Response/Notification) when generating
  nested type names for cleaner identifiers
- Adds defensive programming with panic-based collision detection to
  catch codegen bugs early
- Generates proper nested structs for inline object properties

Breaking changes:
- Renames ToolCallUpdate to RequestPermissionToolCall in permission
  request contexts for schema consistency
- Renames SessionUpdateToolCallUpdate to SessionToolCallUpdate
- Changes EmbeddedResource.Resource field to direct
  EmbeddedResourceResource type
Adds discriminator properties to ContentBlock, MCPServerConfig,
RequestPermissionOutcome, SessionUpdate, and ToolCallContent for
improved type discrimination in the JSON schema.

Updates ContentBlockText description to clarify Markdown support,
indicating that clients SHOULD render text as Markdown.
Replace SanitizeComment with FormatDocComment to maintain the
original structure of JSON schema descriptions. The new approach
preserves paragraph breaks and line-by-line formatting instead of
collapsing multi-line descriptions into single lines.

Added emitDocComment and appendDocComments helper functions to
standardize doc comment emission across the code generator.
Deprecated SanitizeComment in favor of the new formatting function.

This improves readability of generated API documentation by
maintaining the intended structure of schema descriptions.
@ThomasK33 ThomasK33 force-pushed the thomask33/11-02-preserve_multiline_doc_comments branch from ce1c521 to c86d96e Compare November 3, 2025 01:55
Adds support for JSON Schema discriminator metadata to improve
generated union field names. The generator now:

1. Reads discriminator.propertyName from the schema
2. Uses discriminator const values as primary source for field names
3. Falls back to title or type name if discriminator is unavailable
4. Produces more ergonomic names like "Stdio" instead of
   "McpServerStdio"

This change makes the generated API more idiomatic and easier to use
while maintaining backward compatibility through the fallback chain.
The discriminator-aware naming produces cleaner field names that match
user expectations based on the schema's semantic intent.
@ThomasK33
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Changes extension types from defined types to type aliases
(`type Foo = json.RawMessage` instead of `type Foo json.RawMessage`).

The defined type approach created distinct types that did not inherit
json.RawMessage's MarshalJSON and UnmarshalJSON methods, breaking
JSON serialization. Type aliases preserve these critical methods
while maintaining the intended extensibility semantics.

Affects: AgentExtNotification, AgentExtMethodRequest,
AgentExtMethodResponse, ClientExtNotification,
ClientExtMethodRequest, ClientExtMethodResponse.
@ThomasK33
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33 ThomasK33 merged commit cc23bb6 into main Nov 3, 2025
1 check passed
@ThomasK33 ThomasK33 deleted the thomask33/11-02-preserve_multiline_doc_comments branch November 3, 2025 16:47
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