Skip to content

fix(output): unwrap nested error objects; fix --result-type docs; agent-help name-vs-UUID examples - #88

Merged
ernestoongaro merged 2 commits into
mainfrom
fix/error-unwrap-and-docs
Aug 28, 2026
Merged

fix(output): unwrap nested error objects; fix --result-type docs; agent-help name-vs-UUID examples#88
ernestoongaro merged 2 commits into
mainfrom
fix/error-unwrap-and-docs

Conversation

@ernestoongaro

Copy link
Copy Markdown
Collaborator

Three small things from a full sweep of the CLI against a playground instance.

  1. Nested error bodies. {"error":{"code":403,"message":"Invalid bearer token"}} (what a bad token returns) was surfaced as the whole object re-serialised into "error". extractErrorDetail now descends one level into an object-valued detail/message/error key. Before/after:

    "error": "{\"error\":{\"code\":403,\"message\":\"Invalid bearer token\"}}"
    "error": "Invalid bearer token"
    

    Test added; fallback to the raw body is unchanged when no message is found.

  2. Docs. CLAUDE.md and an output.go comment referred to a --result-type flag that doesn't exist — CSV/XLSX come from query run's resultType body field.

  3. agent-help. The existing "some positionals take a NAME, not a UUID" note gains the other cases that tripped a scripted sweep (delete-branch, labels get, documents add-label, users get-model-roles <membership-id>). The spec and --help already describe each correctly; this is reinforcement only, easy to drop if unwanted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ei8UYaG1bW5PJhk93EaqzA

…sult-type docs

Auth failures come back as {"error":{"code":403,"message":"Invalid bearer
token"}}. extractErrorDetail only accepted string values for detail/message/
error, so the whole object was re-serialised into the "error" field:
"error": "{\"error\":{\"code\":403,\"message\":\"Invalid bearer token\"}}".
Descend one level into an object-valued key and take its message/detail.

CLAUDE.md and a comment in output.go referred to a --result-type flag that
does not exist; CSV/XLSX come from query run's "resultType" body field.

agent-help's "some positionals take a NAME" note gains the other cases that
tripped a scripted sweep: delete-branch, labels, document labels, and the
membership-ID argument of users get-model-roles. The spec and --help already
describe each of these correctly; this is a cross-cutting reminder only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ei8UYaG1bW5PJhk93EaqzA
@ernestoongaro
ernestoongaro requested a review from dspangen August 28, 2026 13:16

@dspangen dspangen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex says:

One minor documentation issue; no functional defects found.

[P3] Remove the remaining obsolete flag reference

cmd/omni/output_test.go:188 still says XLSX is selected with --result-type, although this PR establishes that the flag does not exist. Please update it to reference the query run body’s resultType field so the cleanup is complete.

The nested error extraction itself looks correct and preserves existing fallback behavior. GitHub CI reports both lint and test passing.

@ernestoongaro

Copy link
Copy Markdown
Collaborator Author

Fixed in f926995output_test.go:188 was the last --result-type reference in the repo (grep is now clean); it now reads as the resultType body field like the others.

@ernestoongaro
ernestoongaro merged commit 43fe1a7 into main Aug 28, 2026
2 checks passed
@ernestoongaro
ernestoongaro deleted the fix/error-unwrap-and-docs branch August 28, 2026 14:17
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.

2 participants