Continue Sites builds across model turns with durable compaction

Merged
SI
2mo ago
+545-152

Site generation previously required the complete HTML, CSS and JavaScript in one model response. An output cutoff discarded the build even when the task needed more calls.

Replace that single response with an incremental builder using write_file, patch_file and finish tools. The workflow checkpoints each model turn independently, including review-driven rebuilds. Output-limited turns continue with saved files and valid signed reasoning; incomplete tool calls are not replayed. Conversation compacts before it grows too large, or after a recognized context-length rejection, retaining exact source files, the original task, assets, art direction and the agent-maintained working summary. There is no fixed builder turn-count limit; existing credit checks and provider failure handling remain in effect. Existing artifact validation and browser review still gate the completed draft.

Validation: all 136 Sites tests pass, including continuation, reasoning preservation, compaction, invalid-source repair and a 12-turn durable loop. Changed-file lint passes. Type checking reports existing unrelated errors, none in changed files. Real Moonwalk end-to-end verification remains pending: the prior isolated Supabase preview was retired after database PR #80 merged. The prior 64K output fix was merged in #938.


Summary by cubic

Site generation previously required the complete HTML, CSS and JavaScript in a single model response, and hitting the output limit discarded the build. Replaces that with an incremental builder that checkpoints each model turn independently and resumes after output-limited turns.

  • Builds now write files incrementally with write_file and patch_file tools and submit via finish; each completed file write is persisted per turn and orphaned tool calls are never replayed.
  • Conversation compacts before it grows too large or after a context-length rejection, retaining exact source files, the original task, assets, art direction, and the agent-maintained working summary.
  • No fixed builder turn-count limit; existing credit checks and provider failure handling remain in effect.
  • Revisions route through the same durable turn loop, and existing artifact validation plus browser review still gate completion.

All 136 Sites tests pass, including continuation, reasoning preservation, compaction, invalid-source repair, and a 12-turn durable loop. Real Moonwalk end-to-end verification remains pending.