Skip to content

fix(calendar): reject invalid time windows before querying events - #1298

Merged
steipete merged 1 commit into
openclaw:mainfrom
remote-controlled-man:codex/prflow-cd4492496cae
Nov 5, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
remote-controlled-man:codex/prflow-cd4492496cae

Conversation

@remote-controlled-man

@remote-controlled-man remote-controlled-man commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Reject equal or reversed Calendar windows with a usage error before requesting events, and make a far-future search with only --from usable by ending it 90 days after that start. Successful historical --from-only searches retain their existing end at now + 90 days. Explicit time ranges and historical timezone offsets keep their intended instants.

Closes #1280.

Validation: synthetic Calendar HTTP regressions fail on the old implementation for far-future searches, invalid ranges, and historical offset seconds. The focused Calendar suite passes, including a compatibility regression for historical open-ended searches. No live Google Calendar data was used.

Full gate: make ci passed on the dedicated Linux Crabbox lease (run run_5b7894aafd5fe2d0f467bb6b930a7f50). Independent Codex P0–P2 final review is clean.

Co-authored-by: Steven Huang [email protected]

Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:29
@clawsweeper

clawsweeper Bot commented Nov 4, 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 4, 2026
@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR anchors open-ended searches to their explicit start, rejects invalid resolved windows, and preserves historical timezone instants in requests.

Example: Run gog calendar search meeting --from 2099-01-01T00:00:00Z.

  • Before: The implicit end is now plus 90 days, preceding the requested start and causing an API error.
  • After: The request spans 2099-01-01T00:00:00Z through 2099-04-01T00:00:00Z.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Concrete CLI comparison now supports the focused implementation; readiness remains capped by the unresolved default-behavior decision.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The updated body records the macOS arm64 v0.47.1 CLI and fd0f838 CLI against one isolated local Calendar API fake, showing exact request bounds, exit codes, rejection before Events.List, historical offset preservation, and unchanged no-flag behavior; this addresses the prior proof request.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Single-ended Calendar queries can produce inverted bounds and fail remotely instead of yielding a useful window or local usage error.
Reason: The repair has clear value, but changing the intentionally restored search default affects previously successful invocations.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR repairs a current Calendar bug without a definite implementation defect, but the changed default for successful past-start searches still needs an owner decision.

Priority: P2
Reviewed head: fd0f83879db876d3a9b0596bd93399e440ff1337
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should every explicit search --from anchor an omitted end 90 days later, including previously successful past-start searches?
  • Recommendation: Approve start-relative search windows: Accept a consistent 90-day window from every explicit start, as suggested by bug(calendar): --from or --to alone can produce an inverted window that fails as an API error #1280.
  • Why: History deliberately restored a now-relative end; the contributor documents the changed result, but no maintainer has approved that compatibility change.

Before merge

  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Agent review details

How this fits together

Calendar commands pass date flags through shared timezone-aware range resolution and formatting before querying Google Calendar and printing events or availability.

flowchart LR
  A[Calendar CLI flags] --> B[Calendar command]
  B --> C[Timezone and range resolver]
  C --> D[Request timestamp formatter]
  D --> E[Google Calendar API]
  E --> F[Events or availability output]
Loading

Technical review

Best possible solution:

Keep the shared range validation and instant-preserving formatter, and settle the explicit-start search default before landing.

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

Current-main source establishes both invalid-window paths, and the contributor supplies exact release-versus-head CLI request bounds and exit codes; this read-only review ran no target code.

Is this the best way to solve the issue?

The implementation uses existing owners and mechanisms with focused command regressions; its broader change to successful search windows is a product choice rather than a demonstrated code defect.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Search's omitted-end default changes intended behavior with a stated reason (006d02e: Restore now-relative search defaults; 184f085 subsequently preserved them in the shared resolver.)
  • Calendar request timestamp serialization changes intended behavior with a stated reason (0ca019d: Timezone-aware range support formatted bounds as RFC3339; team queries adopted direct formatting in f8b83e5. UTC conversion now preserves instants that minute-only offsets cannot represent.)
  • Existing window-flag semantics keeps the original intent (fix(calendar): honour --from when --days is given, reject ambiguous window flags #981: Honor explicit starts with --days and reject ambiguous flag combinations; this patch leaves those decisions intact.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 184f085 adds internal/cmd/time_helpers.go:57 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 184f085be51e; files: internal/cmd/time_helpers.go)
  • salmonumbrella: Raw commit 0ca019d adds internal/cmd/time_helpers.go:52 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0ca019dc8966; files: internal/cmd/time_helpers.go)
  • Frank: Raw commit 0d80885 adds internal/cmd/time_helpers.go:167 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0d8088534f09; files: internal/cmd/time_helpers.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: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on maintainer.

Label justifications:

  • P2: Specific Calendar query windows fail; explicit valid bounds remain available.
  • merge-risk: 🚨 compatibility: Successful past-start searches can return a different event interval after upgrading.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the Calendar owner's choice on the omitted end for explicit-start searches.

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-04T13:43:27.042Z sha fd0f838 :: needs real behavior proof before merge. :: none

Reviewed November 4, 2026, 10:56 PM ET / November 5, 2026, 03:56 UTC (Revision 2).

@remote-controlled-man

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 5, 2026
…arches

Reject equal or reversed Calendar windows with a usage error before requesting events, and make a far-future search with only --from usable by ending it 90 days after that start. Successful historical --from-only searches retain their existing end at now + 90 days. Explicit time ranges and historical timezone offsets keep their intended instants.

Closes openclaw#1280.

Validation: synthetic Calendar HTTP regressions fail on the old implementation for far-future searches, invalid ranges, and historical offset seconds. The focused Calendar suite passes, including a compatibility regression for historical open-ended searches. No live Google Calendar data was used.

Full gate: `make ci` passed on the dedicated Linux Crabbox lease (run `run_5b7894aafd5fe2d0f467bb6b930a7f50`). Independent Codex P0–P2 final review is clean.

Co-authored-by: Steven Huang <[email protected]>
@steipete
steipete force-pushed the codex/prflow-cd4492496cae branch from fd0f838 to efd1e0c Compare November 5, 2026 17:45
@steipete
steipete merged commit 9ed5c36 into openclaw:main Nov 5, 2026
11 of 12 checks passed
@steipete

steipete commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Landed in #1298 as 9ed5c36. Equal/reversed serialized windows now fail as usage errors before the Events request. Far-future --from-only searches get a valid default end, while successful historical searches retain their previous now + 90 days upper bound.

The regressions fail on the old implementation; focused synthetic Calendar tests, full make ci, independent P0–P2 review, and all exact-head CI checks passed: https://github.com/openclaw/gogcli/actions/runs/42077781990. No live Calendar data was used. Thanks @remote-controlled-man and @privatenumber.

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

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(calendar): --from or --to alone can produce an inverted window that fails as an API error

3 participants