Skip to content

fix: give the agent the current date and time on every task - #2107

Merged
Douglasymlai merged 6 commits into
mainfrom
fix/agent-current-time
Oct 26, 2026
Merged

Douglasymlai merged 6 commits into
mainfrom
fix/agent-current-time

Conversation

@Douglasymlai

@Douglasymlai Douglasymlai commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Related Issue

N/A — maintainer-directed repair; no linked issue required for this PR.

Description

Problem

Agent prompts reused the hour the backend started, so an app left open overnight could give the wrong date to new tasks and Automations.

Change

Capture the current hour and explicit time zone in each attempt's RunContext. New tasks and Resume send the renderer's IANA time zone. All seven agent factories and Workforce prompts use this snapshot; missing or invalid zones fall back to Brain-local time. Refresh the retained Single Agent prompt at a new Run boundary without discarding compatible runtime resources. Workforce follow-ups build their workers and planning prompts with the follow-up's time.

Testing Evidence (REQUIRED)

  • 213 backend tests passed, 4 skipped, including clock advancement after import, London/New York DST, midnight conversion, invalid zones, context isolation, factory construction, retained prompt refresh, and controller propagation.
  • 247 chatStore tests passed, including time-zone transport for new tasks and Resume.
  • Type checking, focused ESLint/Prettier, repository-configured Ruff, and git diff --check passed.
  • Expanded backend suite used a temporary application home and journal. Existing mock/deprecation warnings remain.
  • No paid model task or overnight packaged-app check was run. No server deployment is needed.
  • Follow-up: Workforce follow-ups now create workers and planning prompts with the follow-up's time. The Single Agent refresh uses only CAMEL's public API (update_system_message + reset); a test checks the model context after a new Run. 215 related backend tests pass, 4 skipped.
  • Known limit: the Workforce question agent, which keeps its conversation across Runs in an open session, keeps the date it was created with. Updating it without clearing its conversation needs a change in CAMEL.

Automated checks only; manual app testing is pending.

  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@Douglasymlai
Douglasymlai marked this pull request as ready for review October 25, 2026 17:07
@Douglasymlai Douglasymlai self-assigned this Oct 25, 2026
claude[bot]

This comment was marked as outdated.

@Douglasymlai
Douglasymlai merged commit 4ed2619 into main Oct 26, 2026
10 checks passed
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