Skip to content

Return the committed revision in a guarded Drive content replacement #1345

Open

Description

@nomadonwheels196

What happens

An automation can replace a non-Google Workspace file with gog drive upload --replace --if-version and keep its file ID and sharing settings. The JSON response identifies the file, but omits the revision and content checksum returned by the update. A later read can see another writer’s revision by then, so it cannot establish which revision this command committed.

Reproduction

Use a disposable Drive file with ordinary uploaded content. Read its current version and substitute that version and the file ID below.

gog drive get '<file-id>' --fields id,version --json
gog drive upload ./replacement.txt --replace '<file-id>' --if-version 42 --json

On v0.43.0 and current main, the conditional media update asks for ID, title, MIME type, size and link. Its JSON output has no file.headRevisionId or file.sha256Checksum from the write response.

Requested behavior

Add an opt-in --include-committed-revision flag for --replace --if-version. With --json, include the update response’s file.headRevisionId, file.sha256Checksum and file.md5Checksum when Drive supplies them. Keep the version and ETag checks, one guarded upload attempt, and the current default output. A successful update with missing receipt fields should leave them absent so callers can reconcile it. Drive v2 files.update · Drive v2 File fields.

Activity

  1. added
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    P2Normal priority bug or improvement with limited blast radius.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    and removed
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    on Nov 21, 2026
  2. clawsweeper commented on Nov 21, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep this issue open: current main lacks the requested write receipt, and the same author’s open PR #1346 owns the proposed implementation.

    Reproducibility: Current source conclusively shows the omitted fields in both the update field mask and output mapping; no live upload or tests were run.

    Maintainer decision needed

    • Question: Should guarded Drive replacements expose committed revision metadata through the proposed opt-in flag?
    • Recommendation: Accept the opt-in receipt: Continue review of the linked PR with the existing output and guarded-write guarantees preserved.
    • Why: The omission is source-confirmed, but the existing contract does not promise a write receipt and the new CLI option requires acceptance.

    Next step
    Review #1346 for the opt-in output contract and same-response receipt evidence before resolving this issue.

    Review details

    Best possible solution:

    Return available revision and checksum fields from the guarded update itself while preserving default output and existing write safeguards.

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

    Current source conclusively shows the omitted fields in both the update field mask and output mapping; no live upload or tests were run.

    Is this the best way to solve the issue?

    Using the same update response avoids the later-read race, and an opt-in extension respects the output compatibility promised by the original conditional replacement work.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The linked PR reports fixture coverage but no live Drive validation of the requested receipt fields.

    Codex review notes: model internal, reasoning medium; reviewed against ae8dbb2eef93.

    Label changes

    Label changes:

    • add P2: A bounded automation improvement enables identification of a committed write without establishing an urgent failure of existing behavior.
    • add impact:other: Concurrent-write reconciliation lacks the exact revision and checksums from the successful update response.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.

    Label justifications:

    • P2: A bounded automation improvement enables identification of a committed write without establishing an urgent failure of existing behavior.
    • impact:other: Concurrent-write reconciliation lacks the exact revision and checksums from the successful update response.
    Evidence reviewed

    What I checked:

    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; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 21, 2026, 5:05 PM ET / 22:05 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions