Feature/20260626/fix memory v5 pipeline pollution#5376
Conversation
Add shouldInjectCompiler() with three-layer guard: - Session cap (default 5 injections) - Genuine input check (reject system-generated/empty) - Cooldown enforcement (default 30s between injections) Fixes esengine#5342 (infinite injection loop) and esengine#5316-B3 (spontaneous injection).
Replace silent stripMemoryCompilerExecution with collapsible component: - Extract memory compiler block instead of deleting it - Show 'Memory v5 context' toggle, collapsed by default - Click to expand raw IR content Fixes esengine#5316-B1 (IR leak to user chat UI).
ab887e1 to
9cd87bf
Compare
- Fix syntax error: missing ) closing ternary in Message.tsx - Add extractMemoryCompilerExecution to lib/memoryCompilerDisplay.ts - Remove duplicate local function definitions from Message.tsx - Add missing msg.memoryCompilerContext i18n key to zh-TW locale
|
Thanks @myipanta for investigating the Memory v5 pipeline pollution/noise path. I'm closing this PR as superseded by #5493. The selected fix keeps the same product goal but uses the newer Memory v5 path: task/chat classification gates Memory v5 startup, simple greetings and acknowledgements skip execution-contract injection, real task/failure descriptions still use Memory v5, and compiler citations are kept out of the visible transcript. #5493 also has focused backend/frontend coverage and is clean against the current We are not adopting this branch because it is based on an older version of the flow and leaves more of the raw Memory v5 contract/UI behavior exposed than the selected approach. Thanks again for the exploration here. |
Summary
Verification
Cache impact
Cache-impact: low — adds new methods to Agent struct, no system-prompt or tool-schema changes
Cache-guard: go test ./internal/agent/ -run "TestShouldInject|TestMarkCompiler|TestRunUsesMemoryCompiler" -count=1
System-prompt-review: N/A
For cache-sensitive changes, fill these lines before requesting review:
Cache-impact:none,low,medium, orhigh, plus the reason.Cache-guard: the focused guard test/command added or run, or why an existing guard covers the change.System-prompt-review: required reviewer/approval note when provider-visible system prompt, memory prefix, output style, or skill index behavior changes.