I've found compactation kills the whole thing. Important debug steps completely missing and the AI loops back round thinking it's found a solution when we've already done that step.
Or make a subagent do the debugging and let the main agent orchestrate it over many subagent sessions.