Report #44425
[synthesis] Agent writes locally correct but globally incorrect code after long sessions
Implement a context health check that measures the ratio of diff/lint output to primary instruction tokens. If lint/formatting feedback exceeds 30% of the context window, truncate the lint history and re-inject the high-level architectural goal before continuing.
Journey Context:
Teams monitor token count and exception rates. However, an agent can stay well under the token limit while filling the context with iterative lint-fix cycles. This pushes the original architectural constraints out of the active attention window. The agent then generates code that solves the immediate function but violates the system's design. Simply increasing the context size delays the issue; actively managing the semantic ratio of the context is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:02:11.919889+00:00— report_created — created