Don't mix kcmc types and kittycad.rs types in CmdFileSnapshot#1479
Merged
adamchalmers merged 6 commits intomainfrom Feb 21, 2026
Merged
Don't mix kcmc types and kittycad.rs types in CmdFileSnapshot#1479adamchalmers merged 6 commits intomainfrom
adamchalmers merged 6 commits intomainfrom
Conversation
Most of `zoo file` subcommands use the generated API client types from the `kittycad` crate. The one exception is the `zoo file snapshot` subcommand, which needs to start a modeling session (WebSocket) and import the file, then take a 2D snapshot (JPG or PNG etc). This feature is only available via our WebSocket API, not the REST API. Problem is, the `kittycad` crate only works with our REST API. And the `kittycad-modeling-cmds` crate only works with our WebSocket API. So we have two very similar types, e.g. FileImportFormat, one for each of these libraries. To make this easier to work with, we implemented conversions between them via the From trait. But this causes problems upstream because it couples the `kittycad-modeling-cmds` crate to the `kittycad` crate, making it difficult to maintain. Solution is, don't mix-and-match kittycad and kcmc crates in the same command. Use exclusively kcmc for the file snapshot command, and exclusively kittycad.rs for the other file commands.
jessfraz
approved these changes
Feb 20, 2026
a3c9e03 to
fd7151f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1479 +/- ##
==========================================
- Coverage 69.60% 69.57% -0.04%
==========================================
Files 41 41
Lines 6840 6843 +3
==========================================
Hits 4761 4761
- Misses 2079 2082 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jtran
reviewed
Feb 20, 2026
adamchalmers
added a commit
to KittyCAD/modeling-api
that referenced
this pull request
Feb 21, 2026
CLI was using these conversion features, I've integrated this PR into CLI here: KittyCAD/cli#1479 --------- Co-authored-by: alteous <alteous@outlook.com>
fd7151f to
83f6276
Compare
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.
Most of
zoo filesubcommands use the generated API client types from thekittycadcrate. The one exception is thezoo file snapshotsubcommand, which needs to start a modeling session (WebSocket) and import the file, then take a 2D snapshot (JPG or PNG etc). This feature is only available via our WebSocket API, not the REST API.Problem is, the
kittycadcrate only works with our REST API. And thekittycad-modeling-cmdscrate only works with our WebSocket API. So we have two very similar types, e.g. FileImportFormat, one for each of these libraries.To make this easier to work with, we implemented conversions between them via the From trait. But this causes problems upstream because it couples the
kittycad-modeling-cmdscrate to thekittycadcrate, making it difficult to maintain.Solution is, don't mix-and-match kittycad and kcmc crates in the same command. Use exclusively kcmc for the file snapshot command, and exclusively kittycad.rs for the other file commands.
Uses this branch of kcmc: KittyCAD/modeling-api#1099