Skip to content

[FEATURE]: mechanism to keep critical rules visible against long-context dilution #41590

Description

@464917671

Checklist

  • I have verified this feature has not been suggested before (searched existing issues before filing).

Not a duplicate of #37767 / #40474 (checked before filing):

Feature

Provide a supported, native mechanism so that important rules/instructions (e.g. from AGENTS.md) remain effective and visible to the LLM even when the conversation context grows very long.

Why (reason) — the "7-second fish" problem

Every AI agent is essentially a "7-second fish": high capability, but terrible memory. Each session/context boundary is a memory reset; it only survives on the current context window. In long sessions, rules injected early are diluted and forgotten as the conversation grows — so the agent drifts and violates its own golden rules (comment conventions, proxy usage, timeout discipline, role naming, etc.).

The user tried to counter this with a plugin (rules_reminder.js) that every N rounds console.logs a condensed rule card into the log stream. Verification showed this never entered the LLM context at all — it only printed a big text block over the TUI/interface, obscuring the actual conversation, and it had zero effect on the model's behavior. There is currently no reliable way for a plugin to inject text into the LLM context that the model actually reads, nor a way to verify it (plugin self-logs are not evidence).

Request details

  1. A first-class mechanism to re-inject/highlight critical rules at a given interval (e.g. every N user turns), OR a way for plugins/AGENTS.md sections to be marked "always pinned" so they never get diluted.
  2. The injected content must actually reach the LLM context (verifiable in the DB / request payload), not just logs or UI.
  3. Optionally: context window management / automatic compaction info so rules survive.

Please iterate on this soon — context dilution is the single biggest reliability problem in long agent sessions.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions