Skip to content

feat(oxlint): add agent output mode#21955

Open
JoviDeCroock wants to merge 4 commits intooxc-project:mainfrom
JoviDeCroock:feat/minimal-agent-output
Open

feat(oxlint): add agent output mode#21955
JoviDeCroock wants to merge 4 commits intooxc-project:mainfrom
JoviDeCroock:feat/minimal-agent-output

Conversation

@JoviDeCroock
Copy link
Copy Markdown
Contributor

@JoviDeCroock JoviDeCroock commented Apr 29, 2026

Summary

  • add an oxlint agent formatter with one-line diagnostics and no summary
  • include diagnostic help text inline when available
  • keep the scope to explicit --format agent support only

This comes in handy when running oxlint from an agent so we can reduce the tokens used.

Tests

  • INSTA_UPDATE=always cargo test -p oxlint output_formatter::test::test_output_formatter_diagnostic_formats -- --nocapture
  • cargo test -p oxlint agent -- --nocapture
  • cargo test -p website_linter --all-features
  • cargo test -p website_formatter --all-features

AI disclosure

Reviewed and opened with assistance from an AI coding agent.

@JoviDeCroock JoviDeCroock force-pushed the feat/minimal-agent-output branch 2 times, most recently from e8fb15f to 5b53011 Compare April 29, 2026 18:54
@camchenry
Copy link
Copy Markdown
Member

Thanks for working on this! We have discussed this here: #20514.

I think we should rename the formatter to "agent" so that it's clear this is not intended for human eyes. Maybe we'll add a true minimal output in the future too. What do you think?

We can also skip the auto enable discussed in that issue for now too.

@JoviDeCroock JoviDeCroock force-pushed the feat/minimal-agent-output branch from 5b53011 to 43bd6b2 Compare April 29, 2026 19:13
@JoviDeCroock JoviDeCroock changed the title feat(cli): add minimal agent output mode feat(cli): add agent output mode Apr 29, 2026
@JoviDeCroock
Copy link
Copy Markdown
Contributor Author

I was planning on doing the auto-detection as a follow-up 😅 I did not initially see that issue will give that a read, thank you for surfacing it.

I applied your feedback, hope this works for you, thank you so much for getting to this so quickly!

Copy link
Copy Markdown
Member

@Sysix Sysix Apr 29, 2026

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that's ok personally, since this allows agent to be more flexible if we think of a way to reduce tokens in the future

Copy link
Copy Markdown
Member

@leaysgur leaysgur left a comment

Choose a reason for hiding this comment

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

For now, could you please narrow down the scope of this PR to just oxlint?

I think that will make it easier to proceed (, and since oxfmt is not interactive like linter, already outputs minimal information and the code itself seems to have room for improvement.)

@camchenry
Copy link
Copy Markdown
Member

For now, could you please narrow down the scope of this PR to just oxlint?

I think that will make it easier to proceed (, and since oxfmt is not interactive like linter, already outputs minimal information and the code itself seems to have room for improvement.)

yeah, I think this makes sense. let's drop the --agent option now for too, as I think --format agent should be sufficient (plus, we'll hopefully auto-enable this for everyone at some point so you don't even need a --agent flag)

@JoviDeCroock JoviDeCroock force-pushed the feat/minimal-agent-output branch from c48eb07 to 82dee84 Compare April 30, 2026 05:49
@JoviDeCroock JoviDeCroock requested review from Sysix and leaysgur April 30, 2026 13:05
@leaysgur leaysgur changed the title feat(cli): add agent output mode feat(oxlint): add agent output mode Apr 30, 2026
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.

4 participants