Skip to content

fix: inject CURRENT_DATETIME into all spawn templates (#960) - #961

Merged
tamirdresher merged 3 commits into
devfrom
fix/960-inject-current-date
Apr 12, 2026
Merged

tamirdresher merged 3 commits into
devfrom
fix/960-inject-current-date

Conversation

@tamirdresher

@tamirdresher tamirdresher commented Apr 12, 2026 •

Copy link
Copy Markdown
Collaborator

What

Injects CURRENT_DATETIME into every spawn template so sub-agents know the real date/time.

Why

Closes #960 — agents spawned by the coordinator get a fresh LLM session with no date context. The platform injects <current_datetime>\ into the coordinator session, but this was never forwarded to sub-agents. Result: agents hallucinate dates.

Changes

  1. All spawn templates — added \CURRENT_DATETIME: {current_datetime}\ (lightweight, full, scribe, explore)
  2. Coordinator instruction — explicit 'pass current datetime' in 'On every session start' block
  3. Usage guard — agents told to use CURRENT_DATETIME, never infer dates
  4. Scribe charter — updated from {today}\ to {CURRENT_DATETIME}\ for decision headings
  5. Template sync — all 5 squad.agent.md copies + 4 scribe-charter copies synced

Files (9 total)

  • squad.agent.md (5 copies)
  • scribe-charter.md (4 copies)

Prompt-only change — zero runtime code impact.

Agents spawned by the coordinator get a fresh LLM session with no
date context. The platform injects <current_datetime> into the
coordinator's session, but this was never forwarded to sub-agents.

Adds CURRENT_DATE: {current_datetime} to:
- Lightweight spawn template
- Full spawn template
- Scribe spawn template
- Explore agent inline prompt

Closes #960

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 12, 2026 08:49

Copilot AI 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.

Pull request overview

Updates the Squad coordinator spawn prompt instructions to include a CURRENT_DATE field so spawned sub-agents can reference “today” from the prompt context instead of inferring it.

Changes:

  • Added CURRENT_DATE: {current_datetime} to the Lightweight spawn template.
  • Added CURRENT_DATE: {current_datetime} to the general “Template for any agent”.
  • Added CURRENT_DATE: {current_datetime} to the Scribe spawn template and updated the explore-agent one-liner to include it.

Comment on lines 330 to 334
prompt: |
You are {Name}, the {Role} on this project.
TEAM ROOT: {team_root}
CURRENT_DATE: {current_datetime}
WORKTREE_PATH: {worktree_path}
Comment thread .github/agents/squad.agent.md Outdated
prompt: |
You are {Name}, the {Role} on this project.
TEAM ROOT: {team_root}
CURRENT_DATE: {current_datetime}
Comment on lines 351 to 353

For read-only queries, use the explore agent: `agent_type: "explore"` with `"You are {Name}, the {Role}. {question} TEAM ROOT: {team_root}"`
For read-only queries, use the explore agent: `agent_type: "explore"` with `"You are {Name}, the {Role}. CURRENT_DATE: {current_datetime}. {question} TEAM ROOT: {team_root}"`

Comment thread .github/agents/squad.agent.md Outdated
{paste contents of .squad/agents/{name}/charter.md here}

TEAM ROOT: {team_root}
CURRENT_DATE: {current_datetime}
Comment thread .github/agents/squad.agent.md Outdated
prompt: |
You are the Scribe. Read .squad/agents/scribe/charter.md.
TEAM ROOT: {team_root}
CURRENT_DATE: {current_datetime}
Copilot and others added 2 commits April 12, 2026 12:06
Addresses review feedback from copilot-pull-request-reviewer:
1. Renamed CURRENT_DATE to CURRENT_DATETIME (value is full ISO timestamp)
2. Fixed explore inline trailing punctuation
3. Synced canonical .squad-templates/ and all 3 .template copies
4. Verified byte-for-byte parity across all 5 files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e guard

Q found 3 gaps in the CURRENT_DATETIME fix:

1. Added explicit 'pass current datetime' instruction to coordinator's
   'On every session start' block (line 107), parallel to team_root
2. Updated scribe-charter.md to use CURRENT_DATETIME instead of
   'today's date' / '{today}' for decision consolidation headings
3. Added DATES warning to full spawn template: agents must use
   CURRENT_DATETIME, never infer or guess dates

All 9 affected files synced via sync-templates.mjs.
Zero leftover CURRENT_DATE references (verified by grep).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tamirdresher tamirdresher changed the title fix: inject CURRENT_DATE into all spawn templates (#960) fix: inject CURRENT_DATETIME into all spawn templates (#960) Apr 12, 2026
@tamirdresher
tamirdresher merged commit 3579a23 into dev Apr 12, 2026
@tamirdresher
tamirdresher deleted the fix/960-inject-current-date branch April 12, 2026 10:10
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.

Agents hallucinate incorrect dates — CURRENT_DATE not injected into spawn prompts

2 participants