fix(formatter): classify unsupported feature errors#123
Conversation
3fbee55 to
17ed2ae
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17ed2ae5f7
ℹ️ 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".
| if normalized.contains("does not support") || normalized.contains("unsupported") { | ||
| if normalized.contains("does not support") | ||
| || normalized.contains("unsupported") | ||
| || normalized.contains("not yet supported") |
There was a problem hiding this comment.
Avoid attaching --force hint to generic "not yet supported" errors
Including "not yet supported" in the unsupported-feature matcher makes Formatter::error emit UNSUPPORTED_SUGGESTION for messages that do not have a force path, e.g. diff/mirror local-path rejections and cross-alias cp/mv (crates/cli/src/commands/diff.rs, mirror.rs, cp.rs, mv.rs), whose argument structs have no --force flag. In JSON mode this now returns a misleading recovery action (Retry with --force...) that users and clients cannot apply, whereas previously these cases had no incorrect hint.
Useful? React with 👍 / 👎.
Summary
This change closes a formatter regression in the phase-3 structured error work. The formatter already inferred
unsupported_featurefor messages containingunsupportedordoes not support, but one of the new command error strings uses the phrasenot yet supportedinstead. That path fell through togeneral_error, which meant JSON error output lost the expected error type and recovery hint.The fix keeps scope narrow. It adds focused regression tests for the message-based
conflictandunsupported_featureinference branches, then extends the unsupported-feature classifier to recognizenot yet supportedmessages. The new unsupported test failed before this change and now passes with the classifier update.Validation
I attempted to run
make pre-commit, but this repository does not define that target or aMakefile/justfile. I ran the equivalent required checks fromAGENTS.mdinstead:cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspace