Repository navigation
Description
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 --jsonOn 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.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Nov 21, 2026
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
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:
Codex review notes: model internal, reasoning medium; reviewed against ae8dbb2eef93.
Label changes
Label changes:
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.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.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:
internal/cmd/drive_upload.go:395, ae8dbb2eef93)internal/cmd/drive_upload_replace_test.go:420, ae8dbb2eef93)internal/cmd/drive_upload.go:360, 1b261244fc26)internal/cmd/drive.go, c39d731a5c06)AGENTS.md, ae8dbb2eef93)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 21, 2026, 5:05 PM ET / 22:05 UTC.