Skip to content

feat: time awareness for agent #63#187

Merged
ypldan merged 14 commits intodevelopmentfrom
feat/63-current-timestamp-as-a-tool
Mar 27, 2026
Merged

feat: time awareness for agent #63#187
ypldan merged 14 commits intodevelopmentfrom
feat/63-current-timestamp-as-a-tool

Conversation

@ypldan
Copy link
Copy Markdown
Collaborator

@ypldan ypldan commented Mar 24, 2026

Applicable issues

Description of changes

Gives the agent a sense of time through four cooperating mechanisms:

  1. Auto-injection — every user turn gets a synthetic current_timestamp tool-call/result appended to the message list, so the agent always knows "now" without an explicit tool call. Historical timestamps survive the state round-trip with their original times, giving the agent temporal progression across turns.
  2. Explicit timezone tool — the agent can call current_timestamp with an IANA timezone parameter (e.g. Asia/Tokyo) for authoritative server-side conversion, avoiding LLM arithmetic on DST and offset rules.
  3. Tool response metadata — every tool result is stamped with its production time after execution. A per-invocation annotation transformer appends a human-readable [Timestamp: ...] line to tool messages before each LLM call, so the agent can reason about data freshness. Annotations are transient — they never leak into the persisted message history.
  4. Two-tier transformer pipeline — introduces PreInvocationTransformer (runs before every LLM call, selective deep-copies) alongside the existing MessagesTransformer (runs once at setup, mutates canonical history). _AttachmentFilter is refactored into this new tier. A CompletionResultEnricher ABC is added for post-execution enrichment in ToolExecutor.

The entire feature is preview-gated (@preview_module + PreviewField) under ENABLE_PREVIEW_FEATURES. The features.timestamp config field defaults to enabled when preview is active, and can be explicitly set to null to disable per-app.

Checklist

  • Title of the pull request follows Conventional Commits specification
  • Design documented is updated/created and approved by the team (if applicable)
  • Documentation is updated/created (if applicable)
  • Changes are tested on review environment
  • App schema changes are backward compatible, or breaking changes are documented with a migration guide
  • Integration tests pass

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ypldan ypldan linked an issue Mar 24, 2026 that may be closed by this pull request
@ypldan ypldan self-assigned this Mar 24, 2026
@ypldan ypldan force-pushed the feat/63-current-timestamp-as-a-tool branch from 7715dc5 to 67b8483 Compare March 25, 2026 09:58
@ypldan ypldan force-pushed the feat/63-current-timestamp-as-a-tool branch from 1a9ffb1 to 11a21fd Compare March 25, 2026 15:26
@ypldan ypldan changed the title feat: timestamp awareness #63 feat: time awareness for agent #63 Mar 26, 2026
@ypldan ypldan marked this pull request as ready for review March 26, 2026 16:52
@ypldan
Copy link
Copy Markdown
Collaborator Author

ypldan commented Mar 26, 2026

/deploy-review

GitHub actions run: 23607631093

Stage Status
deploy-review Success ✅
matrix.application Skipped ➖

@ypldan ypldan requested review from VinShurik and korotaav48 March 26, 2026 17:08
@ypldan ypldan merged commit 41d249f into development Mar 27, 2026
8 checks passed
@ypldan ypldan deleted the feat/63-current-timestamp-as-a-tool branch March 27, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Time awareness for agent

3 participants