fix(agent): prevent projectless app builds - #120
Merged
Conversation
Route high-confidence first-run app builds through the managed builder. Confine virtual workspace paths to the canonical project and keep projectless probes ephemeral so weaker models cannot produce blank Computer panels.
iamjr15
added a commit
that referenced
this pull request
Aug 3, 2026
## What changed - route high-confidence imperative website and mobile-app prompts into the managed builder whenever the chat has no project - stop treating `isFirstRun` as the first run of a chat; it represents the user account’s first-ever agent run - keep explicit project modes and existing-project follow-ups authoritative ## Why Production DeepSeek V4 QA after PR #120 exposed the semantic mismatch: workspace confinement worked, but a returning user’s new projectless build chat remained in general mode and could still omit the managed preview. ## Verification - `pnpm typecheck` - `pnpm turbo lint` - `pnpm turbo build --force` - architecture checks: 847 modules / 1,753 dependencies, zero violations - dead-code check: exit 0 (four existing configuration hints only) After merge and Cloudflare deployment, this will be re-tested through the production UI with DeepSeek V4.
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.
Summary
/workspaceas a virtual project root across file, shell, inline-code, and preview commands./tmpso they cannot leave orphaned durable files.Context
A production DeepSeek run wrote a complete site into
/workspace/beautiful-sitewithout attaching a project or registering a managed preview, then claimed the result was available in Computer. Files therefore had no project to open and Browser had no preview record.No Linear issue or standalone plan document is linked; this is a production QA follow-up to the preview recovery work in #118 and #119.
Architecture
A narrowly matched imperative first message (for example, “build a website”) is promoted from general mode into the existing app-builder path before model execution. The builder creates the canonical project and managed preview first. Tool execution then remaps the model-facing virtual
/workspacenamespace into that project root. Commands with no workspace intent remain projectless and use/tmp.Decisions Made
/tmp/workspaceroot/workspace/*inputsEdge Cases Handled
/workspace/*path in argv or inline code/tmpwithout creating a project.How to Review
agent-run-path.tsfor the high-confidence first-run builder routing.workspace-paths.tsand the code-tool adapters for confinement/remapping.runs.tsfor persisted resolved project mode.Test Plan