Problem
Under all-stack agent workflows (all three of CLI, MCP, and REST available), we observe a recurring failure pattern: during local-runtime debugging, the agent iteratively rewrites correct code with diagnostic stubs — and doesn't checkpoint the working version first. When the diagnostic path reveals the actual bug is elsewhere (env var, dependency, container config), the agent has already destroyed the correct implementation.
Observed in sc11/all, sc02/all, sc05/all (2026-06-23 sweep).
Concrete trajectory (paraphrased):
- Agent writes correct scraper. Local test fails (unrelated env issue).
- Agent Edits scraper to add
console.log('reached this line') debugging stubs — overwriting the working parse/extraction logic in the process.
- Env issue is fixed. Agent re-runs. Now the code is broken (stubs only). Agent tries to reconstruct from memory — often incorrectly.
Suggested addition to the skill
Add a "Checkpoint working code before diagnostic tweaks" pattern:
### Save known-good state before adding debug instrumentation
When local runs fail, and before you Edit any code file to add `console.log`, add a `throw`, or otherwise instrument for diagnostics:
1. **Copy the current file to a `.bak` sibling first** — `cp src/main.js src/main.js.bak` — so you can `mv` back to it in one step.
2. **Or `git init` + `git add` + `git commit` early** — before any Edit, so you have a rollback anchor.
3. **Prefer additive instrumentation over destructive rewrite.** Add `console.log` at the top of a function; do NOT replace the function body with a stub.
Rule of thumb: if you're about to Edit-then-Edit-again the same file to try different debug approaches, you should have a checkpoint first. Overwriting working code with a debug stub and losing the original is a common self-inflicted regression.
Related
- Companion runner-side change in the eval framework: surface trajectories where one stack succeeds and another fails on the same scenario, dumping a diff of what code was written when — makes the regression pattern auditable from artifacts alone.
Impact
High (agent-gap). Concentrated under all stack where the extra tools (MCP for run inspection, REST for KV probing) tempt more iterative debugging cycles.
Surfaced during an evaluation of Apify surfaces for agent-driven Actor development.
Problem
Under
all-stack agent workflows (all three of CLI, MCP, and REST available), we observe a recurring failure pattern: during local-runtime debugging, the agent iteratively rewrites correct code with diagnostic stubs — and doesn't checkpoint the working version first. When the diagnostic path reveals the actual bug is elsewhere (env var, dependency, container config), the agent has already destroyed the correct implementation.Observed in sc11/all, sc02/all, sc05/all (2026-06-23 sweep).
Concrete trajectory (paraphrased):
console.log('reached this line')debugging stubs — overwriting the working parse/extraction logic in the process.Suggested addition to the skill
Add a "Checkpoint working code before diagnostic tweaks" pattern:
Related
Impact
High (agent-gap). Concentrated under
allstack where the extra tools (MCP for run inspection, REST for KV probing) tempt more iterative debugging cycles.Surfaced during an evaluation of Apify surfaces for agent-driven Actor development.