Skip to content

feat(sheets): add --inherit-from-before to sheets insert#658

Merged
steipete merged 2 commits into
openclaw:mainfrom
chrischall:feat/sheets-insert-inherit-from-before
May 30, 2026
Merged

feat(sheets): add --inherit-from-before to sheets insert#658
steipete merged 2 commits into
openclaw:mainfrom
chrischall:feat/sheets-insert-inherit-from-before

Conversation

@chrischall

@chrischall chrischall commented May 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #655.

Problem

gog sheets insert always derived InsertDimensionRequest.inheritFromBefore from --after:

inheritFromBefore := c.After

So there was no way to insert rows/columns with plain formatting next to a formatted neighbour — the reported case: plain 0–100 score columns inserted immediately after a currency-formatted column rendered as currency until the format was manually cleared.

Change

Add a tri-state --inherit-from-before flag (*bool):

  • omitted — unchanged behaviour: inherit only when --after is set;
  • --inherit-from-before=false — force plain formatting (the reported need);
  • --inherit-from-before — force inheritance even on a before-insert.

Maps straight through to InsertDimensionRequest.inheritFromBefore. Command reference regenerated via make docs-commands.

Real-behavior proof (built from this branch)

gog sheets insert --help:

      --inherit-from-before    Inherit number format / styling from the adjacent
                               row/column. Defaults to true with --after, false
                               otherwise; set to false to insert with plain formatting.

--dry-run shows the flag controlling inherit_from_before (no API call):

# default with --after  → inherits
$ gog sheets insert SHEET_ID Sheet1 rows 2 --after --dry-run --json
  → inherit_from_before: true

# explicit override: --after but DON'T inherit
$ gog sheets insert SHEET_ID Sheet1 rows 2 --after --inherit-from-before=false --dry-run --json
  → inherit_from_before: false

# explicit override: force inherit on a before-insert
$ gog sheets insert SHEET_ID Sheet1 rows 2 --inherit-from-before --dry-run --json
  → inherit_from_before: true

Review follow-ups addressed

  • proof — added above (help + dry-run output showing the tri-state behaviour).
  • generated docs — ran make docs-commands; docs/commands/gog-sheets-insert.md now lists the flag.
  • CHANGELOG — no CHANGELOG edit in this PR (release notes are release-owned).

Tests: added two subtests over the existing httptest Sheets stub asserting wire-level InheritFromBefore for both override directions. make fmt + make lint + go test ./internal/cmd/ green.

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 1:57 PM ET / 17:57 UTC.

Summary
The PR adds a tri-state --inherit-from-before flag to gog sheets insert, wires it into dry-run and the Sheets API insert request, updates generated command docs and tests, and adds a release-note line.

Reproducibility: yes. for the source-level behavior: current main only derives inheritFromBefore from --after, so the reported missing override is clear from the command implementation. I did not run a live Google Sheets formatting scenario in this read-only review.

Review metrics: 2 noteworthy metrics.

  • Changed files: 4 files affected. The surface spans CLI behavior, request tests, generated command docs, and one release-note line that maintainers should notice before merge.
  • New coverage: 3 subtests added. The tests cover both explicit override directions and the first-row validation path.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] The PR body proof shows CLI help plus dry-run/request-path output, not a live Google Sheet before/after formatting run; maintainers may still decide whether VISION.md requires live provider proof for this API-visible behavior.
  • [P1] The branch includes a CHANGELOG.md line; that may be fine for maintainer landing, but release-note ownership should be intentional before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused flag and validation after maintainer review, with release-note handling kept intentional and live Sheets proof requested only if maintainers want provider-visible confirmation beyond dry-run output and request-level tests.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] The branch already contains the focused implementation, tests, docs, and proof, so the remaining action is maintainer review rather than an automated repair lane.

Security
Cleared: The diff adds a CLI flag, generated docs, tests, and a changelog line; it does not touch credentials, dependencies, workflows, publishing, or other security-sensitive execution paths.

Review details

Best possible solution:

Land the focused flag and validation after maintainer review, with release-note handling kept intentional and live Sheets proof requested only if maintainers want provider-visible confirmation beyond dry-run output and request-level tests.

Do we have a high-confidence way to reproduce the issue?

Yes for the source-level behavior: current main only derives inheritFromBefore from --after, so the reported missing override is clear from the command implementation. I did not run a live Google Sheets formatting scenario in this read-only review.

Is this the best way to solve the issue?

Yes, the pointer bool flag is a narrow maintainable fit because omitted preserves the current default while explicit true/false maps directly to the Sheets API field. The remaining questions are proof depth and release-note handling, not the core implementation shape.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 28e29cdfd0df.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal Sheets CLI capability improvement with limited blast radius and focused coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal-style proof for the new help text and dry-run JSON behavior, which proves the CLI/request path even though it is not live Sheets formatting proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal-style proof for the new help text and dry-run JSON behavior, which proves the CLI/request path even though it is not live Sheets formatting proof.
Evidence reviewed

Acceptance criteria:

  • [P1] make fmt.
  • [P1] make lint.
  • [P1] go test ./internal/cmd/.

What I checked:

Likely related people:

  • steipete: The current sheets insert implementation and default inheritance behavior trace to the v0.19.0 import commit, and the latest PR head contains a validation commit by the same author. (role: introduced behavior and recent adjacent contributor; confidence: high; commits: b25a3c029b37, d1da0e673c34; files: internal/cmd/sheets_insert.go, internal/cmd/sheets_insert_test.go, docs/commands/gog-sheets-insert.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels May 30, 2026
@chrischall chrischall closed this May 30, 2026
@chrischall
chrischall force-pushed the feat/sheets-insert-inherit-from-before branch from 7fbb0a1 to 929e26b Compare May 30, 2026 12:17
@chrischall chrischall reopened this May 30, 2026
@chrischall
chrischall force-pushed the feat/sheets-insert-inherit-from-before branch 2 times, most recently from 73aa8c9 to d9695c4 Compare May 30, 2026 14:38
@chrischall

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — reopened with real-behavior proof (help + dry-run showing the tri-state inherit_from_before) added to the PR body, regenerated the command reference via make docs-commands, and removed the CHANGELOG edit.

@clawsweeper

clawsweeper Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 30, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 30, 2026
chrischall and others added 2 commits May 30, 2026 18:45
`gog sheets insert` always derived InsertDimensionRequest.inheritFromBefore
from --after, so there was no way to insert columns/rows with plain formatting
next to a formatted neighbour (the reported case: plain 0–100 score columns
inserted beside a currency column first rendered as currency).

Add a tri-state `--inherit-from-before` flag (*bool): omitted keeps the prior
default (inherit only with --after), `--inherit-from-before=false` forces plain
formatting, and `--inherit-from-before` forces inheritance on a before-insert.
Regenerate the command reference (make docs-commands) so the flag is documented.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@steipete
steipete force-pushed the feat/sheets-insert-inherit-from-before branch from d9695c4 to d1da0e6 Compare May 30, 2026 17:52
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels May 30, 2026
@steipete
steipete merged commit 8a9a908 into openclaw:main May 30, 2026
5 checks passed
chrischall added a commit to chrischall/gogcli-mcp that referenced this pull request Jun 1, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sheets insert: add a flag to control number-format inheritance (inheritFromBefore)

2 participants