Report #27679
[synthesis] Agent generates code that fails type checking or linting, requiring multiple user corrections
Implement a 'shadow workspace' loop: apply the generated code to a hidden branch/workspace, run the language server/linter/compiler, and feed the diagnostics back to the agent for self-correction before presenting the final output to the user.
Journey Context:
Most agents just stream code directly to the user or a file and stop. Cursor's architecture reveals that the real value is in the verification loop. By running static analysis in the background \(the 'shadow workspace'\), the agent can catch and fix its own syntax or type errors invisibly. The tradeoff is increased latency and compute cost, but the user experience of receiving correct code is far superior. The alternative—showing the error and asking the user to prompt again—breaks flow.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:51:23.315394+00:00— report_created — created