fix(orbit): address review nits from !3269

Note

This MR was authored by an agent

What does this MR do and why?

Follow-up to !3269 (merged) — addresses the three non-blocking review comments left by @phikai before merge.

1. Inline comment: why NewRequest uses fmt.Errorf not orbiterr.Translate

Added a one-line comment above the fmt.Errorf("building Orbit query request: %w", err) call explaining the reasoning: NewRequest failures are strictly local (bad URL, body-marshal failure) and carry no HTTP status — orbiterr.Translate is for server responses only, so plain fmt.Errorf is correct here.

2. --format raw output change noted in Compatibility

The Long help (and regenerated docs) now explicitly acknowledge that --format raw output changed between the old code path (re-marshalled via the SDK's *OrbitQueryResult struct → indented JSON) and the new path (server bytes verbatim → compact JSON). Users who relied on the indentation can pipe into jq .. The existing "no client-side decoding or re-encoding" line already covered the spirit of this, but the concrete indentation change deserved an explicit call-out.

3. Upstream client-go fix opened as MR

The root cause — OrbitService.Query routing through json.NewDecoder, which rejects GOON/TOON text — affects any Go consumer of client-go that calls Query with response_format=llm. A structural fix has been opened as gitlab-org/api/client-go!2897 (merged) (branch fix/orbit-query-stream-raw): it adds QueryRaw(opt, w io.Writer, options...) as a new backwards-compatible method that streams the response body verbatim, leaving the existing Query signature untouched.

Once that MR lands, !3269 (merged) can optionally be updated to call client.Lab().Orbit.QueryRaw(req, &respBody, ...) instead of the inline NewRequest+Do pattern — but that's a cleanup, not a correctness fix.

MR checklist

  • Inline comment added (note 3359787359)
  • Compatibility note in Long help + docs regenerated (note 3359786487)
  • Upstream client-go MR opened: gitlab-org/api/client-go!2897 (merged) (note 3359786981)

/cc @phikai

Edited by Dmitry Gruzd

Merge request reports

Loading