fix: storage CRUD follow-up — schema placeholders, metadata, unknown item types#45
Merged
Merged
Conversation
…item types - Add migration 0002 with tenant_id, metadata, and raw_tokens placeholder columns to avoid future schema migrations - Add metadata field to Conversation model and ConversationData domain type - Add Unknown variant to InputItem and OutputItem enums so unrecognized item types are caught by serde instead of silently failing deserialization - Add tracing::warn in as_inout() when items cannot be deserialized, trying both InputItem and OutputItem before falling back Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
maralbahari
reviewed
Jun 3, 2026
| self.as_input() | ||
| .map(InOutItem::Input) | ||
| .or_else(|| self.as_output().map(InOutItem::Output)) | ||
| if let Some(input) = self.as_input() { |
Collaborator
There was a problem hiding this comment.
it would be cleaner to just use a single match expression rather than if then match.
| pub id: String, | ||
|
|
||
| /// Optional metadata as JSON string. | ||
| pub metadata: Option<String>, |
Collaborator
There was a problem hiding this comment.
@franciscojavierarceo is this metadata different than the one stored in response table? if not I think we dont need it here cause the information already exist in response table
Collaborator
Author
There was a problem hiding this comment.
it is part of OpenAI spec: https://developers.openai.com/api/reference/resources/conversations/methods/create
Simplifies the if-let chain into a single match as suggested in review. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
Collaborator
Author
|
@maralbahari Good call on the match — refactored the if-let chain into a single match expression in 3a2caf6. |
leseb
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #33 addressing outstanding review feedback:
0002addstenant_id,metadata, andraw_tokenscolumns to avoid future schema migrations when multi-tenancy, conversation metadata, and token pass-through landmetadata: Option<String>added toConversationmodel andConversationDatadomain type withFromimpl coverage#[serde(other)] Unknownvariant onInputItemandOutputItemso unrecognized item types (web search, MCP, reasoning, compaction, etc.) don't silently fail deserializationtracing::warn!inas_inout()when items can't be deserialized — triesInputItemfirst, thenOutputItem, only warns if both produceUnknownTest Plan
cargo test)cargo clippy --all-targets -- -D warningscleancargo fmt -- --checkclean🤖 Generated with Claude Code