Repository navigation
feat(sync_env_clock): an optional timezone reads virtual_time in the zone and tells every synced server (FD-5003) - #442
Merged
Merged
Conversation
…zone and tells every synced server (FD-5003) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
earakely-scale
approved these changes
Nov 2, 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.
sync_env_clockcan only arm the gateway at an instant, so a task cannot say "12:00 on Jan 1 in New York" and have its servers answer in that zone (FD-5003). This adds an optional IANAtimezoneto the step. Unset, the step is unchanged: same task JSON, same gateway and sync request bodies.virtual_timeis local time in it (12:00 America/New_York on Jan 1 arms the gateway at 17:00Z). An offset invirtual_timethat disagrees with the zone at that instant fails when the step is built, naming both; one that agrees is accepted. A time that does not exist (spring-forward gap) is refused; an ambiguous one takes the earlier occurrence.tzdataso a worker image without system zone files can still rebuild a zoned task.sync_time. A server whose card does not declaretimezonein thesync_timerequest schema fails the step, whatevertolerate_missing_sync_timesays (that flag still governs servers without clock/v1). Detection reads the stored card, no extra HTTP call.clock_configurationsrecordstimezoneandarmed_atonly when a zone is set.armed_virtual_timeis public so the Harbor exporter can replay the instant.Rollout
timezonedefaults to None, absent fromto_dict). An older agent-env given a task with a wall-clockvirtual_timeplustimezonedrops the zone, and the gateway rejects the naive time, so the step fails loudly. It is silent only whenvirtual_timecarries an offset (the zone is dropped, the instant is right). Bump the hub worker pin after release.executeand metadata, a rebase may be needed.timezonefrom task JSON.Not in this PR
agent-env-hub-backend/agent_env_hub/qc/inputs.py:379-385dropstimezoneandarmed_atfromclock_configurations.Validation (head
3e546131, local)tst/unit/task_step/sync_env_clock_test.py: 35 passed (new tests fail on main: notimezoneargument). Covers round trip, byte-identical unzoned body to old and new cards, 17:00Z arming, strict failure on a card lackingtimezone, DST gap and offset disagreement.tst/unit/task_steppluspackages/agentenv-protocol/tests: 3185 passed, 2 failed (test_mcp_cli_builder,clicknot installed locally, unrelated).ruff check: clean.test_runtime_dependencies_are_importednow importstzdataexplicitly (it failed CI at 093717b). The zone check catchesZoneInfoNotFoundError,ValueErrorandOSError(a directory name likeEuropeor a 5000-character name raisesOSError), covered by the invalid-zone cases.

Confidence Score: 5/5
The PR appears safe to merge; no new blocking issues were found.Summary
Adds optional timezone support to
sync_env_clock. Zoned wall-clock times become UTC instants, and each synced server receives the zone.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Task time and optional zone] --> B[Resolve UTC instant] B --> C[Arm gateway clock] C --> D[Check each server's stored card] D --> E[Send clock URL and optional zone] E --> F[Record clock configuration]Reviews (4) · Last reviewed commit: "address review round 3: a directory-name..." · Reviewed by Greptile