Repository navigation
Description
sheets append --values-json decodes numbers through float64 before serializing its request. An integer that JSON can represent exactly is changed before it reaches the API. For example, 9007199254740993 becomes 9007199254740992 even with --input=RAW.
Reproduced at current main e8428c36dd31db13eecba55fcef6f4ee75951188 (after v0.48.0). SheetsAppendCmd.Run uses sheetsvalues.Decode, which calls json.Unmarshal into interface values. The same package already has DecodeStrict, using json.Decoder.UseNumber.
Credential-free reproduction from that checkout, with Go dependencies available. The test calls the production CLI dispatcher and captures the request at a loopback fake service; it never contacts Google:
cat > internal/cmd/sheets_append_precision_probe_test.go <<'GO'
package cmd
import (
"io"
"net/http"
"net/http/httptest"
"strings"
"testing"
)
func TestSheetsAppendJSONPrecisionProbe(t *testing.T) {
var body string
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
data, _ := io.ReadAll(r.Body)
body = string(data)
w.Header().Set("Content-Type", "application/json")
io.WriteString(w, `{"updates":{"updatedRows":1}}`)
}))
defer srv.Close()
svc := newSheetsServiceFromServer(t, srv)
result := executeWithSheetsTestService(t, []string{
"--home=" + t.TempDir(), "--account=synthetic@example.invalid", "--json",
"sheets", "append", "--input=RAW", "--values-json=[[9007199254740993]]",
"--", "synthetic-sheet", "A:A",
}, svc)
if result.err != nil { t.Fatal(result.err) }
if !strings.Contains(body, "9007199254740993") {
t.Fatalf("input number changed in request: %s", body)
}
}
GO
DBUS_SESSION_BUS_ADDRESS=disabled: GOG_KEYRING_BACKEND=file go test -vet=off -count=1 ./internal/cmd -run '^TestSheetsAppendJSONPrecisionProbe$' -v
rm internal/cmd/sheets_append_precision_probe_test.goObserved:
input number changed in request: {"values":[[9007199254740992]]}
--- FAIL: TestSheetsAppendJSONPrecisionProbe
Expected: preserve 9007199254740993 in the outgoing JSON. This is separate from whatever numeric precision the Google Sheets server supports; no server storage claim is made by this reproduction.
Would you like a small fix using the existing number-preserving decoder for append, with a request-payload regression? A downstream callsite change passes this case.
Investigated and reproduced with AI assistance (the Astrarch agent team); the reproduction was verified on a real host.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Nov 11, 2026
Codex review: this still needs some work.
Summary
This issue establishes a current client-side precision bug: append rounds numeric JSON input before constructing its API request.
Reproducibility: Current source establishes the float64 conversion and direct request handoff, corroborating the reporter's captured payload; this read-only review did not execute the reproduction.
Next step
Fix append's numeric decoding after establishing a failing dispatcher-level regression that captures 9007199254740993 exactly in the outgoing RAW request.
Review details
Best possible solution:
Use the existing number-preserving decoder for append and verify exact numeric tokens in outgoing requests.
Do we have a high-confidence way to reproduce the issue?
Current source establishes the float64 conversion and direct request handoff, corroborating the reporter's captured payload; this read-only review did not execute the reproduction.
Is this the best way to solve the issue?
Switching append to DecodeStrict is a focused repair that follows update's existing approach without changing shared Decode semantics for other callers.
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning medium; reviewed against e8428c36dd31.
Label changes
Label changes:
P2: A bounded numeric-input bug silently changes append payloads, with no evidence of an urgent widespread regression.impact:data-loss: Numeric user data is silently corrupted before transmission, independently of server-side storage precision.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P2: A bounded numeric-input bug silently changes append payloads, with no evidence of an urgent widespread regression.impact:data-loss: Numeric user data is silently corrupted before transmission, independently of server-side storage precision.Evidence reviewed
Acceptance criteria:
What I checked:
internal/cmd/sheets.go:562, e8428c36dd31)internal/sheetsvalues/values.go:19, e8428c36dd31)internal/sheetsvalues/values.go:37, 47cb3c6b3058)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed November 11, 2026, 3:02 PM ET / 20:02 UTC.
fix: preserve workspace request and output contracts
steipete commentedon Nov 14, 2026
Fixed in #1336. Sheets append now preserves numeric JSON tokens, including integers above 2^53 and long fractional values, using the existing strict decoder.
The regression failed against the previous main and passes with the fix. Full
make ci, independent P0–P2 review, and exact-head GitHub CI passed. A built CLI also verified the outgoing request against a synthetic HTTP endpoint.