Skip to content

feat(core): system-reminder injector (date / cwd / todos / files / AGENTS.md)#21

Merged
oratis merged 1 commit into
mainfrom
feat/system-reminders
May 28, 2026
Merged

feat(core): system-reminder injector (date / cwd / todos / files / AGENTS.md)#21
oratis merged 1 commit into
mainfrom
feat/system-reminders

Conversation

@oratis

@oratis oratis commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Lands the system-reminder injector from the morning report's M8 polish list. The agent now sees a <system-reminder> block prepended to every user message with the things long contexts let it forget: today's date, the cwd, pending todos, files that were modified externally between turns, and whether the project has an AGENTS.md.

5 of the 7 planned reminder types ship; plan-mode-active and no-test-yet are stubs in the ReminderType union for future work.

Builders

  • dateReminderToday's date is YYYY-MM-DD (UTC). — always fires.
  • cwdReminderCurrent working directory: <path> — always fires.
  • agentsMdMissingReminder — nudge toward /init when no AGENTS.md/DEEPCODE.md/CLAUDE.md in cwd.
  • todosPendingReminder — reads <sessionDir>/todos.json; lists in_progress + pending (uses activeForm for in_progress).
  • externalFileModifiedReminder — given a Map<path, mtimeMs>, flags drift > 1s and deletions; caps at 5 + "more" suffix.

Wiring

runAgent({ systemReminders: false | { enabled: [...] } }) controls the injection. Default ON. Reminder builder errors are caught and don't poison the batch.

Test plan

  • pnpm -r test340 + 47 = 387 passing (was 317 + 47 = 364; +23 new: 21 reminder unit + 2 agent integration)
  • pnpm -F @deepcode/core build — clean
  • New agent tests verify the wire: one asserts default-ON injection includes date + cwd + user text; one asserts systemReminders: false skips entirely.

🤖 Generated with Claude Code

Closes the "System-reminder injector (7 types)" line item from the M8 polish
list in the morning report. Lands 5 of the 7 types; 2 (plan-mode-active and
no-test-yet) are stubs in the ReminderType union for future implementation.

  · packages/core/src/reminders/index.ts (NEW, ~145 lines)
    - buildSystemReminders() composes per-type builders into a single
      <system-reminder>...</system-reminder> block.
    - dateReminder, cwdReminder — always fire.
    - agentsMdMissingReminder — fires only when no AGENTS.md/DEEPCODE.md/
      CLAUDE.md is in cwd; nudges the user toward /init.
    - todosPendingReminder — reads <sessionDir>/todos.json; lists any
      in_progress + pending items (uses activeForm for in_progress).
    - externalFileModifiedReminder — given a knownFiles Map<path, mtimeMs>,
      flags drift > 1s plus deletions; truncates at 5 items with "more"
      suffix.
    - prependReminders() convenience wrapper for callers that just want
      "userMessage + maybe a reminder block".
    - Per-builder errors are caught and don't poison the batch.

  · packages/core/src/agent.ts
    - RunAgentOptions.systemReminders?: false | { enabled?: ReminderType[] }
    - Before appending the user message, build the reminder block and prepend
      it as text to the user content. Reminders default ON; pass `false` to
      disable.
    - 2 new agent tests cover the injected/skipped cases.

Tests: core 317 → 340 (+23: 21 reminder unit + 2 agent integration).
Total 364 → 387 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oratis oratis merged commit 7364c85 into main May 28, 2026
1 of 2 checks passed
@oratis oratis deleted the feat/system-reminders branch May 28, 2026 05:35
oratis added a commit that referenced this pull request May 28, 2026
This session ("继续推进" from v2) added 5 PRs on top of #1-#16:
  · #17 M3c-rest tools (TodoWrite + WebFetch + WebSearch)
  · #18 M3.5 attack tests + security-model.md
  · #19 M8 headless mode (-p / --print)
  · #20 M5.2 plugin live wire-up
  · #21 system-reminder injector

Test count: 313 → 387 (+74).
Scope completion estimate: 65-70% → 72-78%.

Major remaining items: M6 Mac Electron (still 0%), M7 file panel (depends
on M6), and the M3c-rest/M8/M5.2 leftovers itemized in the body.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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