Repository navigation
fix(tasks): send explicit empty title and notes in tasks update - #1313
saariuslystoned wants to merge 2 commits into
Conversation
The Tasks API struct tags Title and Notes omitempty, so tasks update
--notes '' and --title '' sent PATCH {} and changed nothing, although
their help says "set empty to clear". Force the empty values into the
PATCH, as calendar update does for summaries and descriptions. A task
is always needsAction or completed, so --status '' is now a usage
error and its help no longer offers to clear it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR makes explicitly empty task titles and notes clear their fields and rejects an empty status before sending a request. Example: Run gog tasks update l1 t1 --notes '' on a task containing notes 'probe notes'.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a documented Tasks behavior still broken on main; the earlier changelog finding and live-proof request are resolved, with no remaining actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Tasks update command converts explicitly supplied CLI flags into a Google Tasks PATCH request and prints the returned task. flowchart LR
A[CLI flags] --> B[Tasks update command]
B --> C[Update plan and validation]
C --> D[Google API serializer]
D --> E[Google Tasks PATCH]
E --> F[Task output]
Technical reviewBest possible solution: Land the focused repair in the existing update-plan owner with its regression coverage and Unreleased changelog entry. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the omitted-empty-field path, and contributor CLI traces show the before/after behavior; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch repairs serialization at its existing owner using the established Calendar pattern and gives an actionable error for an invalid status. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8428c36dd31. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 8, 2026, 9:39 PM ET / November 9, 2026, 02:39 UTC (Revision 2). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thank you for the fix. I reproduced the claim and consolidated sending explicit empty task titles and notes and rejecting empty status into #1336, with regression coverage and your coauthor credit retained. The full |
What problem this solves
gog tasks updatedocuments "set empty to clear" for--title,--notesand--status. The plan copies the trimmed flag value intotasks.Task, whoseTitle,NotesandStatusfields are taggedomitempty. An explicit empty value is therefore dropped from the request:Nothing is cleared, and the command reports success. Only
--due ''is special-cased, throughNullFields.Change
--title ''and--notes ''add the field toForceSendFields, so the PATCH carries"title": ""or"notes": "". This is the approachcalendar updatealready uses for explicitly empty summaries, descriptions and locations (Calendar update omits explicitly empty summary, location and attendees #1268,calendar_update_patch_plan.go).statusas eitherneedsActionorcompleted, so there is no empty status to set.--status ''is now a usage error (invalid --status (expected needsAction or completed)) raised before any request, and its help no longer says "set empty to clear".docs/commands/gog-tasks-update.mdis regenerated.--due ''are unchanged.Evidence
internal/cmd/tasks_update_clear_test.godrivesTasksUpdateCmdagainst anhttptestTasks server and checks the PATCH body for--notes '',--title '',--due ''(control) and--notes keep(control). A second test checks that--status ''fails with exit 2 and sends nothing. Both fail onmain(e8428c3), where--notes ''sends{}and--status ''is accepted. Both pass with this change, as do the existing Tasks tests.A built
bin/gogfrommainand from this branch was run against a local Tasks stand-in throughGOG_GOOGLE_API_BASE_URL, with an emptyGOG_HOMEand the file keyring. The stand-in is not Google and logs each PATCH body:Live Google Tasks run in a Workspace account: one throwaway task per binary in the default list, created with a title and notes and read back from Google after each step, then deleted.
mainisgogbuilt from e8428c3; the branch build contains this change:make cipassed locally (macOS arm64, go1.27.3).Boundary: the live run above shows that Google Tasks accepts
""for bothnotesandtitleand clears them. SendingnullthroughNullFields, as--duedoes, remains an alternative if you prefer it.🤖 Generated with Claude Code