Skip to content

fix(tasks): send explicit empty title and notes in tasks update - #1313

Closed
saariuslystoned wants to merge 2 commits into
openclaw:mainfrom
saariuslystoned:fix/tasks-update-empty-clears
Closed

saariuslystoned wants to merge 2 commits into
openclaw:mainfrom
saariuslystoned:fix/tasks-update-empty-clears

Conversation

@saariuslystoned

@saariuslystoned saariuslystoned commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What problem this solves

gog tasks update documents "set empty to clear" for --title, --notes and --status. The plan copies the trimmed flag value into tasks.Task, whose Title, Notes and Status fields are tagged omitempty. An explicit empty value is therefore dropped from the request:

$ gog tasks update <list> <task> --notes ''    # PATCH body: {}   exit 0
$ gog tasks update <list> <task> --title ''    # PATCH body: {}   exit 0
$ gog tasks update <list> <task> --status ''   # PATCH body: {}   exit 0
$ gog tasks update <list> <task> --due ''      # PATCH body: {"due":null}

Nothing is cleared, and the command reports success. Only --due '' is special-cased, through NullFields.

Change

  • --title '' and --notes '' add the field to ForceSendFields, so the PATCH carries "title": "" or "notes": "". This is the approach calendar update already uses for explicitly empty summaries, descriptions and locations (Calendar update omits explicitly empty summary, location and attendees #1268, calendar_update_patch_plan.go).
  • The Tasks API defines status as either needsAction or completed, 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.md is regenerated.
  • Non-empty values and --due '' are unchanged.

Evidence

  • internal/cmd/tasks_update_clear_test.go drives TasksUpdateCmd against an httptest Tasks 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 on main (e8428c3), where --notes '' sends {} and --status '' is accepted. Both pass with this change, as do the existing Tasks tests.

  • A built bin/gog from main and from this branch was run against a local Tasks stand-in through GOG_GOOGLE_API_BASE_URL, with an empty GOG_HOME and the file keyring. The stand-in is not Google and logs each PATCH body:

    main:   --notes=  -> PATCH {}              exit 0
            --title=  -> PATCH {}              exit 0
            --status= -> PATCH {}              exit 0
            --due=    -> PATCH {"due":null}    exit 0
    branch: --notes=  -> PATCH {"notes":""}    exit 0
            --title=  -> PATCH {"title":""}    exit 0
            --status= -> no request, "invalid --status (expected needsAction or completed)", exit 2
            --due=    -> PATCH {"due":null}    exit 0
    
  • 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. main is gog built from e8428c3; the branch build contains this change:

    $ gog tasks update LIST TASK --notes ''
    main:   exit=0  readback notes='probe notes'      <- unchanged
    branch: exit=0  readback notes absent
    $ gog tasks update LIST TASK --title ''
    main:   exit=0  readback title='gog probe main'   <- unchanged
    branch: exit=0  readback title absent
    $ gog tasks update LIST TASK --status ''
    main:   exit=0
    branch: exit=2  invalid --status (expected needsAction or completed)
    
  • make ci passed locally (macOS arm64, go1.27.3).

Boundary: the live run above shows that Google Tasks accepts "" for both notes and title and clears them. Sending null through NullFields, as --due does, remains an alternative if you prefer it.

🤖 Generated with Claude Code

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>
@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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'.

  • Before: The CLI sends {} and reports success while the notes remain.
  • After: The CLI sends {"notes":""}, and Google Tasks readback shows the notes cleared.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused repair with shipped-CLI live readback, meaningful request-boundary regressions, and both earlier blockers resolved.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Contributor terminal output exercises the built Tasks CLI against live Google Tasks in a Workspace account, showing populated title and notes cleared on readback and empty status rejected; the previous live-readback request is satisfied.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users receive success when requesting documented title or notes clearing, but their task remains unchanged.
Reason: The change restores the existing clearing promise and corrects misleading status help without adding options or another update path.

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
Reviewed head: 5b0dd6ecffbb66bbffca90163e78ea0abc0107d6

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Tasks update serialization and validation changes intended behavior with a stated reason (a26447e: The commit extracted the existing update plan rather than introducing its behavior; earlier readable code already distinguishes supplied fields and the due-date repair explicitly preserves clearing.)
  • Tasks status help and generated command documentation changes intended behavior with a stated reason (4252ad5: The Kong migration carried the empty-clear help alongside validation permitting an empty status; the PR explains that Google Tasks has only needsAction and completed.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current-main defect: Main assigns empty title and notes without ForceSendFields and accepts empty status; the command sends the resulting task through Tasks.Patch. (internal/cmd/tasks_update_plan.go:56, e8428c36dd31)
  • Focused serialization repair: The introduced diff forces only explicitly empty title and notes into JSON, tightens status validation, and updates matching help, documentation, tests, and changelog. (internal/cmd/tasks_update_plan.go:58, 5b0dd6ecffbb)
  • Contributor live behavior proof: The updated PR body records built CLI runs against Google Tasks in a Workspace account: populated notes and titles remain on main but are absent after branch updates; empty status exits 2. The local transport trace also records rejection before any request. (5b0dd6ecffbb)
  • Previous finding resolved: The follow-up commit adds the PR reference to the Unreleased entry, which already credits the contributor. (CHANGELOG.md:5, 5b0dd6ecffbb)
  • Feature history and existing pattern: The update-plan extraction carried forward the earlier field-presence behavior; the April due-date repair already distinguishes an explicit clear. The merged Calendar repair at fix: preserve Calendar clears and bounded MCP continuation #1273 provides the analogous ForceSendFields pattern cited by this contributor. (internal/cmd/tasks_update_plan.go:42, a26447ec9af1)
  • History search limit: Scoped git log -S and git log --follow reached unavailable old blobs with lazy fetching disabled; readable refactor and due-clear commits establish the relevant design, but the original introduction remains unverified. (internal/cmd/tasks_items.go, e8428c36dd31)

Likely related people:

  • Peter Steinberger: Raw commit a26447e adds internal/cmd/tasks_update_plan.go:42 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a26447ec9af1; files: internal/cmd/tasks_update_plan.go)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Documented field clearing silently does nothing, with impact limited to explicit Tasks updates.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-08T14:55:44.643Z sha e48b6ce :: needs real behavior proof before merge. :: [P3] Add the PR reference to the Unreleased changelog entry

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>
@saariuslystoned

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 9, 2026
@steipete

Copy link
Copy Markdown
Collaborator

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 make ci gate, built-CLI checks for the new request-validation fixes, and exact-head GitHub CI passed. Closing this PR as superseded by the merged implementation in #1336.

@steipete steipete closed this Nov 14, 2026
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: 🦞 diamond lobster Very strong PR readiness with only minor 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.

2 participants