core: add extra metadata field to Thread struct - #29675
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ff937b820
ℹ️ 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".
| #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)] | ||
| #[serde(rename_all = "camelCase")] | ||
| #[ts(rename_all = "camelCase", export_to = "v2/")] | ||
| pub struct ThreadExtra {} |
There was a problem hiding this comment.
Model thread extra as a metadata map
If extra is meant to carry implementation-specific thread metadata, this empty struct loses that data: deserializing an object such as {"foo":"bar"} into ThreadExtra ignores the key, and serializing Some(ThreadExtra {}) can only emit {}. This makes any non-null metadata disappear on Rust round trips and the generated TypeScript type is Record<string, never> rather than an extensible metadata object; use an explicit metadata map/value or concrete fields instead.
Useful? React with 👍 / 👎.
909c511 to
5be7aff
Compare
5be7aff to
63d9772
Compare
63d9772 to
fb31ec9
Compare
Summary
Adds a field Thread.extras that can be used to hold arbitrary metadata specific to a given thread.