Skip to content

feat(server): add formatter status API - #53771

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
v2-formatter-status-api
Open

opencode-agent[bot] wants to merge 1 commit into
v2from
v2-formatter-status-api

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Ports the v1 formatter status API (GET /formatter, formatter.status) to V2. V2 already formats files after edits; this adds the read side so clients can show which formatters are configured and runnable for a location.

  • Schema: Formatter.Status with the same fields as v1's FormatterStatus: name, extensions, enabled.
  • Core: Formatter.status() lists every registered formatter and resolves whether it has a runnable command. Disabled formatters are omitted, and formatter: false returns an empty list. This is the method refactor(core): remove unused formatter methods #40684 removed while it had no callers.
  • Protocol/Server: GET /api/formatter (formatter.status), location-scoped with the standard { location, data } response. The handler waits for plugin activation first; otherwise a cold location returns an empty list because the config plugin registers the formatters.
  • Client: regenerated, so it now has client.formatter.status({ location }) on both the Promise and Effect clients, plus a FormatterApi type export.

packages/protocol/openapi.json was already out of date on v2, and regenerating it would add about 950 unrelated lines. This PR adds only the new path, schema and tag to it, then syncs services/www.

Not included: the v1 rule where disabling ruff also disables uv, and any TUI or app UI that uses this endpoint.

Testing:

  • packages/core: bun test test/formatter.test.ts (29 pass, including 3 new status tests)
  • packages/server: bun test test/formatter.test.ts (new HTTP test; it fails without the activation wait)
  • packages/client: bun run check:generated; bun test shows the same 4 failures as clean v2 and no new ones
  • services/www: bun script/generate-openapi.ts --check
  • bun typecheck passes in schema, protocol, server, client, core, sdk, tui, app and cli

Requested by: @Brendonovich (Brendan via Slack)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant