Feature hasn't been suggested before.
Describe the enhancement you want to request
Specialized agents (judges, reviewers, planners, explorers) lose their identity after context compaction. The compaction summarizer has no knowledge of which agent is being compacted, so the summary omits role-specific context. Post-compaction, agents revert to generic implementor behavior — e.g. a reviewer starts suggesting code changes instead of reviewing.
Problem:
- The compaction LLM receives no system prompt from the source agent, so it can't preserve role context
- The summary template has no section for agent role/constraints
- After compaction, non-native agents receive a generic "continue" message with no identity reinforcement
Proposed changes:
- Pass the source agent's system prompt (capped at 4K) to the compaction LLM as a system message
- Add an "Agent Role & Constraints" section to the compaction summary template
- Inject a post-compaction
<system-reminder> for non-native agents to prevent role drift
- Expose the agent name on the
experimental.session.compacting plugin hook
This is related to #16960 (compaction loses instruction context) and #17900 (agent stops working after compaction), but addresses the runtime agent identity specifically rather than AGENTS.md file preservation.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Specialized agents (judges, reviewers, planners, explorers) lose their identity after context compaction. The compaction summarizer has no knowledge of which agent is being compacted, so the summary omits role-specific context. Post-compaction, agents revert to generic implementor behavior — e.g. a reviewer starts suggesting code changes instead of reviewing.
Problem:
Proposed changes:
<system-reminder>for non-native agents to prevent role driftexperimental.session.compactingplugin hookThis is related to #16960 (compaction loses instruction context) and #17900 (agent stops working after compaction), but addresses the runtime agent identity specifically rather than AGENTS.md file preservation.