feat(sheets): add copy-paste (fill) command mapping to CopyPasteRequest#663
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 4:00 PM ET / 20:00 UTC. Summary Reproducibility: not applicable. This PR implements a new command rather than fixing broken existing behavior. Source inspection confirms current main only exposes spreadsheet copy, read-only raw, and values batch-update rather than range-level Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow command after normal maintainer review and CI, preserving the existing Sheets helper patterns and adding live disposable-spreadsheet proof only if maintainers want extra API confidence. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR implements a new command rather than fixing broken existing behavior. Source inspection confirms current main only exposes spreadsheet copy, read-only raw, and values batch-update rather than range-level Is this the best way to solve the issue? Yes; mapping the command to Sheets API AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 5e4daadbc929. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was no way to copy a range's values/formulas/format to another range — `sheets copy` is sheet-level, `sheets raw` is read-only, and `sheets batch-update` only writes value ranges. Filling per-row formulas down a column meant inlining every fully-spelled-out formula via large value writes (high-token, error-prone). Add `gog sheets copy-paste <spreadsheetId> <source> <dest> [--type=...] [--transpose]` (aliases: fill, copy-range), mapping to the Sheets API's CopyPasteRequest. A destination larger than the source tiles it, so `copy-paste Sheet1!A2:H71 Sheet1!A2:H120 --type=FORMULA` fills the formulas down with relative references adjusted — one call instead of hundreds of inlined formulas. Regenerated the command reference (make docs-commands). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@clawsweeper re-review — restored |
61b4b67 to
6b2a0df
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
# Conflicts: # docs/commands/README.md
…il (#72) Catch up the MCP wrappers to **gogcli v0.20.0**. Raises `MIN_GOG_VERSION` `0.19.0` → `0.20.0` (hence the `gogcli-bump` label →⚠️ Required gogcli version section). ## New tools | Tool | Package | What | |------|---------|------| | `gog_sheets_copy_paste` | sheets | Range `CopyPasteRequest` fill of values/formulas/format; a larger destination tiles the source to fill down/across (aliases fill, copy-range). Wraps our own [#663](openclaw/gogcli#663). | | `gog_docs_cell_update` | docs | Non-destructive table-cell content replace/append, addressed by table/row/col | | `gog_docs_cell_style` | docs | Table-cell background color + inline text styling (bold/italic/underline/colors), with row/col spans | | `gog_docs_insert_image` | docs | Upload a local PNG/JPEG/GIF and insert it (temp-share → insert → revoke) | | `gog_docs_insert_person` | docs | Native person smart chip for an email | | `gog_docs_insert_date_chip` | docs | Native date smart chip | ## New params on existing tools - `gog_sheets_insert` → `inheritFromBefore` (our [#658](openclaw/gogcli#658)) - `gog_docs_update` → `replaceRange`, `markdown` - `gog_docs_page_layout` → `pageSize`, `pageWidth`/`pageHeight`, all four margins - `gog_gmail_search` → `fromContact` (our [#657](openclaw/gogcli#657)) ## Verification - Full suite green across all 9 packages at the 100% coverage gate; typecheck + build clean. - **Live-verified against `gog v0.20.0`** on throwaway artifacts (created, exercised, then trashed): - docs: insert-table → cell-update → cell-style → insert-person → insert-date-chip → update `--markdown` → page-layout A4 — all returned success. - sheets copy-paste FORMULA fill: `=B1*10` in A1 filled down `A1:A5`, relative refs adjusted → computed `[10,20,30,40,50]`. - gmail `--from-contact`: live read-only search resolved + executed. - Every new/changed flag also parse-validated directly against the v0.20.0 binary. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Closes #66 (gog_sheets_copy_paste / fill). Closes #60 (--inherit-from-before on gog_sheets_insert). --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
Fixes #661.
Problem
There's no primitive to copy a range's formulas/format down or across with relative-reference adjustment.
sheets copyis sheet-level,sheets rawis read-only (Spreadsheets.Get), andsheets batch-updateonly writes value ranges. Filling per-row formulas down a column currently means inlining every fully-spelled-out formula via large value writes — high-token and error-prone.Change
gog sheets copy-paste <spreadsheetId> <source> <dest> [--type=NORMAL|VALUES|FORMAT|FORMULA|NO_BORDERS|DATA_VALIDATION|CONDITIONAL_FORMATTING] [--transpose](aliasesfill,copy-range), mapping tospreadsheets.batchUpdateCopyPasteRequest. A destination larger than the source tiles it, so a fill-down is one call. Built on the existingparseSheetRange/gridRangeFromMap/runSheetsMutation/applySheetsBatchUpdatehelpers (same shape assheets merge). Command reference regenerated viamake docs-commands; no CHANGELOG edit (release-owned).Real-behavior proof (built from this branch)
gog sheets copy-paste --help:--dry-run(fill formulas down a buffer):Tests
internal/cmd/sheets_copy_paste_test.goover the existinghttptestSheets stub: asserts the wire-levelCopyPasteRequest(paste type incl.PASTE_FORMULA, transpose →TRANSPOSEorientation, source/dest GridRanges with a taller destination for fill-down), invalid-type rejection, and empty-range guards.make fmt+make lint(0 issues) +go test ./internal/cmd/green.