Repository navigation
Conversation
…server's Time-related tools treated the timezone parameter as optional and silently dropped it when the model omitted it, so "tomorrow at noon" resolved against server-local or UTC time. The system prompt tried to compensate by asking the model to discover the user's timezone through a find_details_of_current_user tool call first — that costs an extra agent round trip and still leaves the tools unvalidated, so any model that skipped the discovery step produced events at the wrong wall-clock time. Making the timezone a required, pytz-validated parameter on every tool that interprets a date moves the failure to the tool boundary, where a missing or invalid IANA name returns an actionable error to the model instead of silently scheduling six hours off. Injecting the requesting user's actual timezone (OCS /cloud/user) into the system prompt gives the model the correct value up front, keeping the tool-based lookup only as a fallback for profiles without a timezone set. Naive datetime.utcnow() in the free-slot search was replaced with timezone-aware UTC because mixing naive and aware comparisons produced wrong free/busy windows at DST boundaries. Verified end to end against a CEST server with the user's timezone set to America/New_York: the system prompt logs the current time in NY and "tomorrow at noon" is stored as DTSTART:20261007T160000Z (12:00 EDT). Assisted-by: opencode:zai/glm-5.3 Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
…g to UTC schedule_event built VEVENTs with the ics library, which serializes any aware datetime to UTC. The stored event kept the right instant but lost the timezone it was created in: edits across DST boundaries and anyone reading the raw ICS lost the anchor (issue nextcloud#231, same class as nextcloud#3 — correct data, wrong localization contract). Building the event with icalendar, already a dependency, keeps DTSTART/DTEND as DTSTART;TZID=… exactly as supplied. The organizer's email is optional in the user profile, so the mailto value must tolerate None the way the previous Organizer constructor did. Verified end to end: 'tomorrow at noon' from an America/New_York profile on a CEST server stores as DTSTART;TZID=America/New_York:…T120000. Assisted-by: opencode:zai/glm-5.3 Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
WSHAPER
force-pushed
the
fix/timezone-handling
branch
from
October 7, 2026 10:55
45f2db4 to
5b0730a
Compare
kyteinsky
reviewed
Oct 7, 2026
kyteinsky
reviewed
Oct 7, 2026
…f requiring it Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
kyteinsky
reviewed
Oct 7, 2026
…pper-level tz check Review round 2: the tz helpers move to all_tools/lib/tz.py (get_timezone, user_timezone, starts_at_timestamp) so calendar and assignments share one implementation, with type hints. Optional parameters carry explicit None defaults everywhere the agent can omit them. The async wrappers for schedule_event/add_task/update_task called the validation on the raw parameter, before the profile-timezone fallback in the sync bodies, so an omitted timezone errored even when the profile had one; the wrappers now only delegate. The scheduled-task starts_at docstring drops the stale find_details_of_current_user hint since the timezone defaults to the profile. Assisted-by: opencode:zai/glm-5.3 Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
kyteinsky
reviewed
Oct 12, 2026
Assisted-by: opencode:zai/glm-5.3 Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
Assisted-by: opencode:zai/glm-5.3 Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
Assisted-by: opencode:zai/glm-5.3 Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
Author
|
round 3 @kyteinsky
|
kyteinsky
reviewed
Oct 14, 2026
Author
|
@kyteinsky Thanks again for the review! FYI: I've opened another can of worms that surfaced after inspecting what would be optimal for conversation branching:
In light of that, we'd need to discuss how we'd like to proceed. |
Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
kyteinsky
approved these changes
Oct 15, 2026
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.
Fixes #3
Fixes #231
timezoneis now a required,pytz-validated parameter onschedule_event/add_task/update_taskand the scheduled-task tools; a missing or invalid IANA name returns an actionable error to the model instead of silently resolving the time in server/UTC. The system prompt now carries the requesting user's actual timezone (OCS/cloud/user) plus the current time in that tz.The
find_details_of_current_userinstruction stays as a fallback for profiles without a timezone.freebusy_finder's naiveutcnow()became tz-aware UTC.For #231, schedule_event now builds the event with
icalendarinstead of theicslibrary (which serializes any aware datetime to UTC): DTSTART/DTEND keep the supplied timezone asDTSTART;TZID=…. The organizer's mailto tolerates profiles without an email, as before.Heads-up: tool callers (incl. MCP) that omitted
timezonepreviously got a silently mis-timezoned event; they now get an explicit error, which should be the canonical behavior, in my opinion.Verified on stable35 / context_agent 2.9.1, user tz America/New_York on a CEST server: "tomorrow at noon" stores as 12:00 America/New_York (DTSTART:...T160000Z).