Repository navigation
fix(tools): only require a timezone where one is actually needed - #277
Open
marcelklehr wants to merge 1 commit into
Open
marcelklehr wants to merge 1 commit into
marcelklehr wants to merge 1 commit into
Conversation
Follow-up to #257: - update_scheduled_task sent the profile timezone on every update, silently moving tasks stored in another timezone, and failed for users without a profile timezone. It now only sends a timezone when one is given explicitly. - create_scheduled_task failed for users without a profile timezone even when no starts_at was given. A timezone is now only required to interpret a starts_at without UTC offset. - update_task resolved the timezone inside a bare except, so an invalid or missing timezone was swallowed and reported as "task not found". It is now resolved before the loop. - The starts_at docs no longer show a UTC example, which made the model send local times with a Z suffix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
WSHAPER
approved these changes
Oct 20, 2026
WSHAPER
left a comment
Contributor
There was a problem hiding this comment.
LGTM, however one judgment call to confirm: empty-string timezone now raises where main fell back to the profile. I think the raise is right per the documented contract, but it's a small behavior change beyond the fixes and has no test. Wdyt?
Member
Author
i agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #257, from a post-merge review.
Fixes
update_scheduled_taskoverwrote the task's timezone. Every update senttimezone(falling back to the profile timezone), so a prompt-only edit of a task stored inAsia/Tokyosilently moved it to the user's profile zone. For users without a profile timezone, every update raised. It now sends a timezone only when one is passed explicitly, as before fix(tools): require timezone on time tools, inject user timezone into the prompt #257. A naivestarts_atis still interpreted in the explicit timezone, or the profile timezone otherwise.create_scheduled_taskfailed for users without a profile timezone, even whenstarts_atwas omitted.starts_at_timestampnow only resolves a timezone for astarts_atwithout a UTC offset, so the error only fires when a timezone is actually needed.update_taskswallowed the new timezone error.get_timezone()was called inside the bareexcept: continue, so an invalid or missing timezone came back asFalse("task not found"). The timezone is now resolved before the loop.starts_atdocs still used the example2025-01-01T09:00:00Zafter fix(tools): require timezone on time tools, inject user timezone into the prompt #257 removed "use the user's timezone". Since offset-aware values ignoretimezone, this pushed the model to send local times as UTC. The example is now naive local time.Tests
tests/test_timezone_resolution.py, which runs standalone or under pytest. 5 of its 11 tests fail on currentmainand all pass here.tests/test_schedule_event_payload.pystill passes.Other findings from the review, not addressed here
user_timezone_asynccaches a failed lookup (None) per user for 300s (lib/tz.py).schedule_eventwrites the organizer asmailto:(calendar.py).end_date + 1, which adds a day for callers that already pass an exclusive end date.schedule_event_syncfetches/cloud/usertwice per event. The first fetch has no retry.agent.py,datetime_info.py,calendar.py).tests/test_schedule_event_payload.pyreplacescal.NextcloudAppwithout restoring it, and has an unused_FakeNcclass.assignments.pyhas an unusedpytzimport.🤖 Generated with Claude Code