Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/registry/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def mutate(
Returns:
A new ProgramConfig with this program as parent
"""
# NOTE: do NOT call .with_timestamp() here. A wall-clock timestamp
# on every child program would byte-change program.yaml on each
# iteration and bust the run-cache (which keys on the workspace's
# git tree SHA). Git's commit timestamp already records iteration
# ordering. See src/cache/run_cache.py:_get_tree_hash and the
# parallel comment in src/registry/sdk_utils.py.
return ProgramConfig(
name=name,
parent=f"program/{self.name}",
Expand All @@ -90,4 +96,4 @@ def mutate(
allowed_tools=allowed_tools or self.allowed_tools,
output_format=output_format if output_format is not None else self.output_format,
metadata=metadata or {},
).with_timestamp()
)
9 changes: 8 additions & 1 deletion src/registry/sdk_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ def options_to_config(
Returns:
ProgramConfig ready for git storage
"""
base_metadata = {"created_at": datetime.now().isoformat()}
# NOTE: deliberately do NOT include `created_at` here. The timestamp
# would byte-change program.yaml on every --fresh launch, which in turn
# changes the workspace's git tree SHA and busts the run-cache key (see
# src/cache/run_cache.py:_get_tree_hash). Git's commit timestamp already
# records when the program was created, so the metadata field is
# redundant and only serves to defeat caching across re-runs of the
# same content.
base_metadata: dict[str, Any] = {}
if metadata:
base_metadata.update(metadata)

Expand Down