Skip to content

Commit a28e305

Browse files
authored
fix(agent): route projectless build prompts (#121)
## 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.
1 parent f2eefaa commit a28e305

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/agent-worker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ answer segmentation. The Workflow controller owns admission, execution identity,
109109
at-most-once fence, and ownership leases. The shell retains only Durable Object identity,
110110
cancellation, status, and dependency wiring.
111111

112-
An explicit app-builder mode remains authoritative. On a projectless first run, a narrowly
112+
An explicit app-builder mode remains authoritative. In a projectless chat, a narrowly
113113
matched imperative such as “build a website” or “create a mobile app” also enters the matching
114114
app-builder path before model execution. That high-confidence fallback materializes the project,
115115
scaffolds its canonical workspace, and registers the managed preview even when the selected model

apps/agent-worker/src/durable-objects/agent-run-path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function appBuilderModeForRun(input: StartRunInput): "app-builder" | "app-builde
110110
if (isAppBuilderMode(input.projectMode)) {
111111
return input.projectMode;
112112
}
113-
if (!input.isFirstRun || input.projectId || !IMPERATIVE_BUILD_PATTERN.test(input.messageText)) {
113+
if (input.projectId || !IMPERATIVE_BUILD_PATTERN.test(input.messageText)) {
114114
return null;
115115
}
116116
if (MOBILE_APP_PATTERN.test(input.messageText)) {

packages/types/src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const GitHubRepoUrlSchema = z
3333
const PROJECT_MODES = ["app-builder", "app-builder-mobile", "general"] as const;
3434
export const ProjectModeSchema = z.enum(PROJECT_MODES);
3535

36-
/** Product modes selected by UI intent or a high-confidence first-run build imperative. */
36+
/** Product modes selected by UI intent or a high-confidence projectless build imperative. */
3737
const RUN_INTENTS = ["skill-creator"] as const;
3838
export const RunIntentSchema = z.enum(RUN_INTENTS);
3939

0 commit comments

Comments
 (0)