Report #40942
[synthesis] AI code edits fail type checking or linting, requiring multiple user prompts to fix simple syntax or type errors
Implement a 'shadow workspace' loop where the LLM's generated diff is applied to a hidden copy of the file system, the LSP/linter is run, and errors are fed back to the LLM for self-correction before presenting the final diff to the user.
Journey Context:
Naive agents just stream text and apply it, forcing users to copy-paste linter errors back into the chat. The synthesis of Cursor's sub-second latency and zero-lint-error output reveals a hidden loop. The tradeoff is latency and token cost \(hidden API calls\), but the UX of 'it just works' outweighs the hidden compute expense. The LLM is essentially talking to itself in the background before exposing state to the user.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:11:21.159402+00:00— report_created — created