Skip to content

fix(formatter): classify unsupported feature errors#123

Merged
overtrue merged 1 commit intomainfrom
codex/formatter-inference-gap
Apr 19, 2026
Merged

fix(formatter): classify unsupported feature errors#123
overtrue merged 1 commit intomainfrom
codex/formatter-inference-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This change closes a formatter regression in the phase-3 structured error work. The formatter already inferred unsupported_feature for messages containing unsupported or does not support, but one of the new command error strings uses the phrase not yet supported instead. That path fell through to general_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 conflict and unsupported_feature inference branches, then extends the unsupported-feature classifier to recognize not yet supported messages. 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 a Makefile/justfile. I ran the equivalent required checks from AGENTS.md instead:

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

@overtrue overtrue force-pushed the codex/formatter-inference-gap branch from 3fbee55 to 17ed2ae Compare April 19, 2026 15:13
@overtrue overtrue marked this pull request as ready for review April 19, 2026 15:14
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@overtrue overtrue merged commit 1ac7e3b into main Apr 19, 2026
15 checks passed
@overtrue overtrue deleted the codex/formatter-inference-gap branch April 19, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant