Prototype conversational project build flow - #214
Draft
isayahc wants to merge 2 commits into
Draft
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
forma-oss | 829a764 | Aug 04 2026, 02:30 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: Replace staged context gathering with a tool-driven project chat
Summary
The intended product experience is a single conversational interface:
The user should not see a separate context-gathering form or have to understand workflow states. Skip context gathering should simply tell the assistant to build now and choose reasonable defaults for anything noncritical.
This branch attempted that flow, but implemented it across several competing control layers. The result behaves like a growing collection of workflow exceptions rather than one agent using tools.
Related issue
No issue linked yet.
Change type
The breadth of these changes is itself a reason this PR is not ready to merge.
What this branch attempted
ask_question,build_project,render_project, anditerate_project.What worked
These checks validate individual mechanisms, not the complete user experience or production architecture.
Why the approach failed
1. There is no single owner of the conversation
The model router, context updater, workflow state machine, readiness service, API handlers, frontend event handlers, and project renderer can all decide what happens next. A user message therefore passes through several partially overlapping interpretations.
The intended architecture was “the chat agent uses tools.” The current implementation is still structured classification followed by imperative backend branches. Naming the classifications after tools did not create an actual agent/tool loop.
2. Questions and context updates are still treated as workflow mechanics
Ordinary conversation, context extraction, build intent, and project iteration remain separate code paths. This caused canned replies, repeated questions, and failures to answer basic conversational messages naturally.
The assistant should speak normally and update its working brief as a side effect. Asking a question does not need to be a special tool or workflow transition.
3. “Skip” accumulated three meanings
During development, Skip was implemented as:
ready_to_build;build_projectrequest sent through the chat endpoint.Only the last meaning matches the product: build now, allowing the agent to fill noncritical gaps. The earlier implementations added stale-state and dispatch edge cases.
4. Two project data models are active
Generation moved toward canonical
DesignBrief/ProjectWorkflow/ProjectRevisionrecords, while existing project pages, history, and iteration paths still expected legacy generated-project records. This required fallback readers, adapters, and a second revision path inside the same change.Project generation and iteration need one canonical model before chat orchestration is layered on top.
5. Background execution is not production-safe
The initial FastAPI background task kept the request visibly stuck on “Thinking…” during a long generation. It was replaced with a detached daemon thread so the API could return and the frontend could poll.
That fixes the symptom locally, but a daemon thread is process-local: it is not reliably recoverable across restarts, deploys, or multiple replicas. Persisting a plan does not make the execution itself durable.
6. Rendering ownership moved into navigation logic
The first completion path navigated to a separate project page. That directly violated the intended product behavior: the project component belongs inside the chat. The navigation was removed, but the regression shows that the frontend had too much responsibility for interpreting workflow completion.
7. Progress is inferred instead of event-driven
The chat displays estimated legacy pipeline stages while the canonical worker performs generation elsewhere. It does not yet render persisted tool-call and worker-progress events from a single source of truth.
8. The PR mixed independent concerns
The current diff touches 42 tracked files and adds new modules. It combines:
This makes the behavior difficult to reason about and the change unsafe to review as one unit.
User-visible failures observed
Not Found.Proposed replacement
Use one persisted chat event stream and one actual agent tool loop.
The assistant may either respond conversationally or call one of these tools:
build_project(brief_snapshot, allow_agent_defaults)render_project(project_id, revision_id)iterate_project(project_id, instruction)Asking a follow-up question remains an ordinary assistant response. Context extraction can update a draft brief internally, but it must not control the visible conversation.
The server should execute tool calls and append tool status/results to the same chat event stream. The UI should remain passive:
Skip should issue the same build intent as “go ahead,” with
allow_agent_defaults=true. It should not create a separate workflow or endpoint.Long-running builds should run through a durable worker queue with retry and recovery, not an in-process daemon thread.
Recommended PR split
Salvageable work
The structured action router, duplicated workflow transitions, separate start-build path, and process-local generation thread should not be carried forward as the orchestration foundation.
Verification
Checks observed during development:
The complete repository quality suite has not been rerun against the final dirty worktree. End-to-end behavior is not considered verified.
Configuration or migration requirements
Visual changes
The experiment changed the intake UI from a visible context form to conversational messages, added a Skip button and build progress, and attempted to render the project inline. The screenshots captured during development also document the regressions listed above.
Safety and compatibility
AI assistance
The implementation and this retrospective were substantially AI-assisted. Reviewers should independently validate orchestration boundaries, persistence behavior, worker durability, hardware safety, and user-facing behavior.
Checklist
devand the branch started from an up-to-datedev../scripts/quality/test.shpasses, or failures are explained above.Merge recommendation
Do not merge this branch as a feature PR. Use it as a design spike: retain the useful persistence, rendering, and architecture pieces, then rebuild the interaction around one real chat-agent tool loop in the smaller PRs above.