You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Make agent lifecycle message injection extensible for custom agents #25753
The insertReminders function in packages/opencode/src/session/prompt.ts contains hardcoded agent.name === "plan" / agent.name === "build" checks that give these two built-in agents privileged message-injection behavior unavailable to custom agents:
Both issues identified the same gap and were closed for inactivity, not because the feature was implemented or rejected.
Proposed Solution
Add lifecycle hooks to the agent config schema so any agent can declare message injection behavior:
// opencode.jsonc or agent markdown frontmatter
{
"agent": {
"review": {
"mode": "primary",
"lifecycle": {
"on_enter": "<system-reminder>You are now in review mode. Focus on finding bugs...</system-reminder>",
"on_exit": "<system-reminder>Review mode deactivated.</system-reminder>",
"on_enter_from": ["plan"] // optional: only inject when switching from these agents
}
}
}
}
This would replace the hardcoded name checks in insertReminders with a data-driven approach that works for any agent.
Impact
Custom agents could implement their own mode-like behaviors (review, debug, test, etc.)
Built-in plan/build agents would become first-class config entries rather than special cases
The insertReminders function would become a generic lifecycle dispatcher
The feature request template was not used — the required verification checkbox ("I have verified this feature I'm about to request hasn't been suggested before") is missing from the issue body.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
(Note: #12498 and #14210 are already referenced in your issue body as prior closed issues — if this is a revival of those requests, please clarify that explicitly.)
If you believe this was flagged incorrectly, please let a maintainer know.
Activity
github-actions commentedon May 4, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
on_enter/on_exittransition fields to replace the same hardcodedagent.name === "plan"/"build"checks ininsertRemindersreminderandtransitionfields approach(Note: #12498 and #14210 are already referenced in your issue body as prior closed issues — if this is a revival of those requests, please clarify that explicitly.)
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon May 4, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.
Feel free to open a new issue that follows our issue templates.