Skip to content

Conversation

@owenlin0
Copy link
Contributor

@owenlin0 owenlin0 commented Nov 13, 2025

A partner is consuming our generated JSON schema bundle for app-server and identified a few issues:

  • not all polymorphic / one-of types have a type descriminator
  • "$ref": "#/definitions/v2/SandboxPolicy" is missing
  • "Option<>" is an invalid schema name, and also unnecessary

This PR:

  • adds the type descriminator to the various types that are missing it except for SessionSource and SubAgentSource because they are serialized to disk (adding this would break backwards compat for resume), and they should not be necessary to consume for an integration with app-server.
  • removes the special handling in export.rs of various types like SandboxPolicy, which turned out to be unnecessary and incorrect
  • filters out Option<> which was auto-generated for request params that don't need a body

For context, we currently pull in wayyy more types than we need through the EventMsg god object which we are not planning to expose in API v2 (this is how I suspect SessionSource and SubAgentSource are being pulled in). But until we have all the necessary v2 notifications in place that will allow us to remove EventMsg, we will keep exporting it for now.

@owenlin0 owenlin0 force-pushed the owen/fix_type_exports branch from 2007447 to d37e5f9 Compare November 13, 2025 18:33
@owenlin0 owenlin0 changed the title [app-server] add type discriminator to all exported one-of objects [app-server] fix: implement small fixes for JSON schema export and one-of types Nov 13, 2025
@owenlin0 owenlin0 changed the title [app-server] fix: implement small fixes for JSON schema export and one-of types [app-server] fix: small fixes for JSON schema export and one-of types Nov 13, 2025
@owenlin0 owenlin0 changed the title [app-server] fix: small fixes for JSON schema export and one-of types [app-server] small fixes for JSON schema export and one-of types Nov 13, 2025
@owenlin0 owenlin0 marked this pull request as ready for review November 13, 2025 19:12
@owenlin0 owenlin0 requested a review from celia-oai November 13, 2025 19:12
serde_json::Value::String(aggregated),
);
}
} else if ty == "patch_apply_begin" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needed since we now have a type descriminator on FileChange. note we don't actually persist EventMsg::PatchApplyBegin so adding the type descriminator is safe

Copy link
Contributor

@celia-oai celia-oai left a comment

Choose a reason for hiding this comment

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

thanks for fixing this!

@owenlin0 owenlin0 merged commit db2aa57 into main Nov 14, 2025
25 checks passed
@owenlin0 owenlin0 deleted the owen/fix_type_exports branch November 14, 2025 00:25
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants