Skip to content

fix(cli): preserve integer precision in jq output - #3991

Merged
lyingbug merged 1 commit into
Tencent:mainfrom
LeonSGP43:codex/weknora-jq-integer-precision-20261007
Oct 7, 2026
Merged

lyingbug merged 1 commit into
Tencent:mainfrom
LeonSGP43:codex/weknora-jq-integer-precision-20261007

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Description

auth status --jq '.data.tenant_id' changes tenant ID 9007199254740993 to 9007199254740992. The SDK decodes the field correctly as uint64, but the shared jq emitter unmarshals JSON into float64 before evaluating the expression. Decode jq input with UseNumber so gojq can preserve integer precision across projection and evaluation.

Type of Change

  • 🐛 Bug fix

Related Issue

No linked issue. Reproduced locally on the current target branch.

Testing

A regression calls the production auth-status path with the real SDK against an HTTP server returning a uint64 tenant ID. The target branch emits the wrong integer; the fix returns the exact original ID. Existing auth and format module tests also pass.

Go 1.26.8 on macOS arm64: CLI go test -race -count=1 -coverprofile=../jq-coverage.out -json ./... passes 1185 tests/subtests in 19.757s. golangci-lint run --new-from-rev=origin/main ./... (official v2.12.2), go vet ./..., go build ./..., skill-wire vocabulary and secret-token checks, and git diff --check origin/main...HEAD all pass with exit 0.

Windows/Linux runtime and unrelated backend/frontend checks were not run. The client module is unchanged.

Checklist

  • git diff --check origin/main...HEAD passes
  • Changed source files are formatted
  • Targeted tests for the changed packages/components pass
  • Diff-scoped lint passes where applicable
  • Full-repository checks were run, or any unrelated/environment-dependent failures are documented above
  • Self-reviewed the code
  • Added/updated tests covering the change
  • Updated related documentation
  • Breaking changes are clearly called out in the description above

Implemented with assistance from gpt-6.1-sol; the final diff was reviewed locally.

@lyingbug
lyingbug merged commit ff33184 into Tencent:main Oct 7, 2026
6 checks passed
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