Repository navigation
refactor(agent-core-v2): remove idle reminder reconciliation - #5207
Conversation
Keep register and notify on the normal loop.remind path. Defer plugin, swarm, and tower reminders to the next step or turn. Update tests to drive the existing context-injector hook.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc60264a75
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| * enter is idempotent and schedules the byte-identical enter reminder for | ||
| * non-`tool` triggers on the next step, exit pops that reminder when it is the last message |
There was a problem hiding this comment.
Preserve an escape hatch for immediate mode reminders
When an SDK or TUI caller toggles swarm or tower mode while the loop is idle, this change returns before the mode reminder is added to history; exporting or closing the session before another model step therefore loses guidance that was previously delivered immediately. This intentionally removes observable behavior without a compatibility switch, a guard for callers retaining the old behavior, or any changeset in the commit. Add an escape hatch, or obtain explicit maintainer approval and document the lost behavior in the required changeset.
AGENTS.md reference: AGENTS.md:L195-L197
Useful? React with 👍 / 👎.
Keep register and notify on the normal loop.remind path. Defer plugin, swarm, and tower reminders to the next step or turn. Update tests to drive the existing context-injector hook.
Requirement or Bug
Reminder providers already deliver through
loop.remind, but plugin reloads and SDK swarm/tower transitions can bypass that timing by reconciling while idle and forcing an immediate flush. Internal task 411 narrows the change to removing that idle path while preserving the central ReminderService and its normal injection lifecycle.Bug Reproduction Steps
N/A — this is a reminder-lifecycle refactor with intentional timing changes, not a bug reproduction PR.
Root Cause
IAgentReminderService.reconcileWhenIdleacquired loop quiescence, evaluated a selected provider, and calledflushReminders()immediately. That created a second delivery path outside the ordinaryonWillBeginStep/loop.remindconsumption points. This PR removes the alternate path rather than adding another workaround.Code Changes
AgentReminderService,register, andnotify; normal provider evaluation and message construction are unchanged.reconcileWhenIdlefrom the service interface and implementation.context-injectorhook. Cover deferred registration, delayed plugin refresh, WaitFor independence from unrelated tool descriptions, and the real dynamic-tool removal announcement.No changeset is included, as explicitly requested by the author.
Behavior Changes and Affected Users
register/notifydeliveryloop.remindand are consumed at subsequent step/turn injection points/reloadcan inject refreshed session-start guidance immediately while idlepromptOnlyturn; no turn is startedflushReminders()and existing loop-owned consumption remain availableVerification
tsc --noEmitforagent-core-v2: passedtsc --noEmitfornode-sdk: passedpnpm lint: passedChecklist