Repository navigation
Description
Summary
System reminders today are hard-coded to exactly two: one periodic reminder fired every interval turns, and one wrap-up reminder near max_turns - both injected at a single point (before streaming). This generalizes the mechanism into a configurable list of reminders, each with its own trigger and injection point, so multiple distinct reminders can fire as the agent progresses.
Continues #79 (Dynamic system reminders) and #628 (Near-max-turns wrap-up system reminder).
Motivation
- Only one periodic reminder text is possible; you cannot nudge about, say, memory updates and todo hygiene independently.
- Reminders only fire pre-stream. Other moments are useful: after tool execution, at session start, near completion.
- The companion "Persistent agent memory" feature wants a "record/update memory" reminder without hard-coding another special case.
Current state
- Schema:
PromptsAgentRemindersConfig(config/prompts.go:138) =enabled,interval,reminder_text,wrap_up_text,wrap_up_threshold. - Logic:
shouldInjectSystemReminder/getSystemReminderMessage/injectSystemReminderIfDue(internal/agent/agent_utils.go:745-836), hard-coded periodic-vs-wrap-up. - Single hook:
internal/agent/agent_streaming.go:48(pre-stream). Each injection already emits asystem_reminderstream event with aphase(internal/streamevent).
Proposed design
A reminders: list under agent.system_reminders, each entry named, with a trigger and a hook:
agent:
system_reminders:
enabled: true
reminders:
- name: todo-hygiene
text: "<system-reminder>...</system-reminder>"
trigger: interval # interval | turns_before_max | session_start | once
interval: 4
hook: pre_stream # pre_stream | post_tool | queue_drain | on_completion
- name: wrap-up
text: "Wrapping up soon..."
trigger: turns_before_max
threshold: 2
hook: pre_stream
- name: memory-update
text: "Record anything durable in memory."
trigger: session_start
hook: pre_stream- Triggers:
interval(every N turns),turns_before_max(wrap-up threshold),session_start(once at first turn),once(single fire when first due). - Hooks map to state executors:
pre_stream(states/streaming_llm.go, current),post_tool(states/post_tool_execution.go),queue_drain(states/checking_queue.go),on_completion(states/completing.go). - The reminder
namebecomes the stream-eventphase/id for observability.
Backward compatibility. The existing flat fields keep working: when no reminders: list is present they are internally translated into two list entries (periodic + wrap-up). Existing configs are unaffected.
Implementation notes
config/prompts.go: addReminderConfig+Reminders []ReminderConfig; keep legacy fields; defaults inDefaultPromptsConfig().internal/agent/agent_utils.go: replace the two-case logic with an evaluator that, given(turn, hook, ctx), returns the reminders due for that hook; iterate + inject. Consider a smalldomain.SystemReminderProviderso the agent depends on an interface, not the concrete config.- Add injection calls at the new hooks in
states/post_tool_execution.go,states/checking_queue.go,states/completing.go(the pre-stream call stays inagent_streaming.go). - Extend
internal/agent/agent_reminder_emission_test.go. Regenerate config withgo run . init --overwrite.
Out of scope (future)
after_tool:<ToolName>conditional triggers, regex/state-conditional reminders. Land the list + hooks first.
Acceptance Criteria
-
agent.system_reminders.remindersaccepts a list of named reminders, each withtext,trigger, andhook. - Triggers supported:
interval,turns_before_max,session_start,once. - Hooks supported: at least
pre_streamand one ofpost_tool/on_completion, wired into the matching state executors. - Legacy flat fields still work (translated into list entries); existing configs need no change.
- Each injected reminder emits a
system_reminderstream event tagged with the remindername. - Tests cover each trigger and hook;
task lint/task testpass.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Jun 27, 2026
Companion: #670 (Persistent agent memory) consumes this - its reminder-driven memory updates become fully configurable once the reminders list lands here.
feat(hooks): run configured shell commands at agent hook points
feat(hooks): run configured shell commands at agent hook points (#676)
chore(release): 0.125.0 [skip ci]
inference-gateway-releaser commentedon Jun 28, 2026
🎉 This issue has been resolved in version 0.125.0 🎉
The release is available on:
Your semantic-release bot 📦🚀