feat(compression): add failed_approaches and critical_details schema sections

Prevents context rot by:
- Tracking failed approaches to avoid retry loops
- Preserving verbatim error messages, ports, URLs, and other critical details
This commit is contained in:
Gaurav Ghosh
2026-02-06 02:13:39 +00:00
parent 8ec176e005
commit 59cd3011c5
2 changed files with 144 additions and 0 deletions
+22
View File
@@ -568,6 +568,28 @@ The structure MUST be as follows:
-->
</key_knowledge>
<failed_approaches>
<!-- CRITICAL: Approaches that were tried and DID NOT WORK. This prevents the agent from retrying failed solutions. -->
<!-- Include: what was attempted, why it failed, and any error messages. -->
<!-- Example:
- Tried \`fs.readFileSync\` in async handler → caused event loop blocking, switched to \`fs.promises.readFile\`.
- Attempted to use port 3000 → EADDRINUSE, another process is using it. Using port 3001 instead.
- Installed \`lodash\` v3 → incompatible with ESM, upgraded to v4.
-->
</failed_approaches>
<critical_details>
<!-- Verbatim technical details that MUST NOT be paraphrased or approximated. Copy these exactly. -->
<!-- Include: specific error messages still relevant, exact URLs/ports, environment variables, version numbers. -->
<!-- Example:
- Error: "TypeError: Cannot read properties of undefined (reading 'id')" at src/auth.ts:45
- Dev server: http://localhost:3001
- API endpoint: https://api.example.com/v2/users
- Required env var: GEMINI_API_KEY
- Node version constraint: >=18.0.0
-->
</critical_details>
<artifact_trail>
<!-- Evolution of critical files and symbols. What was changed and WHY. Use this to track all significant code modifications and design decisions. -->
<!-- Example: