feat(agent): inject dynamic system reminders for time and project AGENTS.md #75

Merged
ph merged 1 commit from feat/system-reminders into master 2026-06-12 08:33:17 +00:00
Owner

Split the monolithic system prompt into a static part and a dynamic system-reminder layer.

Changes

  • New type: — rendered as <system-reminder> tags in the OpenAI wire format
  • Split AGENTS.md loading: global/config stays in static system prompt; project-level injected as reminders
  • Session reminder system: ReminderBuilder called on each AddUser/AddUserParts to inject fresh reminders
  • Time moved to reminder: no longer in static envBlock, now injected per-turn so it's always current
  • Tool preference guideline: added "prefer dedicated tools over bash" to system prompt

How it works

Every user message now gets system reminders prepended as parts:

<system-reminder>
Current time: 2026-06-12 15:30:00 CST
</system-reminder>

<system-reminder>
<agent_instructions>
  <instructions scope="project">...</instructions>
</agent_instructions>
</system-reminder>

[user's actual message]

Closes #71

Split the monolithic system prompt into a static part and a dynamic system-reminder layer. ## Changes - **New type**: — rendered as `<system-reminder>` tags in the OpenAI wire format - **Split AGENTS.md loading**: global/config stays in static system prompt; project-level injected as reminders - **Session reminder system**: `ReminderBuilder` called on each `AddUser`/`AddUserParts` to inject fresh reminders - **Time moved to reminder**: no longer in static `envBlock`, now injected per-turn so it's always current - **Tool preference guideline**: added "prefer dedicated tools over bash" to system prompt ## How it works Every user message now gets system reminders prepended as parts: ``` <system-reminder> Current time: 2026-06-12 15:30:00 CST </system-reminder> <system-reminder> <agent_instructions> <instructions scope="project">...</instructions> </agent_instructions> </system-reminder> [user's actual message] ``` Closes #71
Split the monolithic system prompt into a static part and a dynamic
system-reminder layer. Time and project-level AGENTS.md are now injected
as <system-reminder> tags on each user message, so they stay fresh
across turns without rebuilding the entire system prompt.

- Add UserSystemReminderPart type (rendered as <system-reminder> tags)
- Split loadAgentsMD into global/config (static prompt) and project-level (reminders)
- Add ReminderBuilder to Session, called on AddUser/AddUserParts
- Remove time from static envBlock, add guideline to prefer dedicated tools over bash
- Update context_test.go for new function signatures

Closes #71
ph merged commit cd0598df77 into master 2026-06-12 08:33:17 +00:00
ph deleted branch feat/system-reminders 2026-06-12 08:33:17 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ph/agentic!75
No description provided.