[API-203] Handle unknown agent types gracefully in CLI#55
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded an Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Add #[serde(other)] Unknown variant to AgentType enum so that unrecognized model_type values from the API (e.g. MODEL_TYPE_DAILY, legacy types, experimental types) don't crash deserialization of the entire agents list response. Unknown types display as UNKNOWN in table output and are excluded from CLI create/update value selection via #[value(skip)].
50ba64e to
8f33358
Compare
kobicovaldev
approved these changes
Apr 2, 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
#[serde(other)] Unknownvariant toAgentTypeenum so unrecognizedmodel_typevalues from the API (e.g.MODEL_TYPE_DAILY, legacy types, experimental types) don't crash deserialization of the entire agents list responseUNKNOWNin table output#[value(skip)]excludes the variant from CLI create/update value selection so users can't accidentally create agents with an unknown typeContext
The CLI
AgentTypeenum only has 5 types but the API has 14+ (including legacy read-only types). When the API returned an agent withMODEL_TYPE_DAILY(pipecat), serde deserialization failed andcoval agents listbroke entirely withError: Invalid request: Invalid request parameter.Companion backend PR: coval-ai/backend#3373
Test plan
cargo check— compiles cleancargo test— all 32 tests passcoval agents listagainst an org with mixed agent typesSummary by CodeRabbit