Skip to content

fix(agent): tell the model today's date - #10764

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/agent-current-date
Dec 4, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/agent-current-date

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Agent block never told the model the date, so models fell back to their training-cutoff year (gpt-4o wrote "2023" into Exa queries and set startPublishedDate to 2023-01-01)
  • buildMessages now appends Current date: YYYY-MM-DD. (UTC, date only) to the first system message, or adds a system message when there is none; shares one appendToSystemMessage helper with the skills step
  • Date line is runtime-only: never written to memory; model fallbacks (incl. sim-auto backups and stripAutoPreamble) reuse the built messages
  • Exa search: query description says plain words, no year unless the user asked for a specific time, use the published-date filters instead; startPublishedDate/endPublishedDate drop the stale "2024-01-01" example for a YYYY-MM-DD note
  • Regenerated tool-metadata.ts and the Exa docs page

Measured on gpt-4o (10 topics x 5 runs), share of open-topic queries containing a stale year: baseline 40%, date line 0%, new Exa descriptions only 22%, both 0%. Explicit user years ("...in 2024") kept 10/10 in every arm.

Type of Change

  • Bug fix

Testing

  • executor/handlers/agent/ + tools/exa/ vitest: 187 passed; existing exact-message expectations updated with the clock pinned via fake Date
  • New regression test asserts the date system message reaches the provider and no memory write contains it; red with the fix reverted, and red with a mutation that leaks the date into the stored user turn
  • bun run lint, check:tool-metadata, check:docs, check:integration-catalog, check:docs-manifest

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

- Agent block appends "Current date: YYYY-MM-DD." (UTC) to the first system
  message, or adds one; never written to memory; fallbacks reuse it
- Exa search query/date param descriptions steer models to the published-date
  filters instead of baking a (stale) year into the query
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 4, 2026 4:00pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

Greptile was unavailable during this review, so merging on green CI on HEAD, a clean cubic review of HEAD (8011f70), and zero unresolved threads.

@waleedlatif1
waleedlatif1 merged commit 22b5058 into staging Dec 4, 2026
86 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/agent-current-date branch December 4, 2026 22:31

This branch was previously deployed

1 inactive deployment
Preview — 8011f707 Deployed Dec 4, 2026 by vercel[bot]
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.

1 participant