Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(copy): clean the error messages the user actually reads

purplec9de028fa3dd
diff --git a/src/api/cloud/supabase.ts b/src/api/cloud/supabase.ts
index 28e567dd..db92c8a7 100644
--- a/src/api/cloud/supabase.ts
+++ b/src/api/cloud/supabase.ts
@@ -114,7 +114,7 @@ export function supabaseCloud(): SupabaseClient {
export async function getAccessToken(): Promise<string | null> {
const { data, error } = await supabaseCloud().auth.getSession()
if (!data.session && error) {
- throw new Error('LU Cloud unreachable — check your connection.')
+ throw new Error('LU Cloud unreachable. Check your connection.')
}
return data.session?.access_token ?? null
}
@@ -139,7 +139,7 @@ export async function loginWithProvider(provider: OAuthProvider, signal?: AbortS
},
})
if (error) throw new Error(error.message)
- if (!data?.url) throw new Error('OAuth start failed — no provider URL')
+ if (!data?.url) throw new Error('OAuth start failed, no provider URL')
await openExternal(data.url)
const wait = oauthWait(port, 300)
const query = signal
diff --git a/src/api/mcp/builtin-tools.ts b/src/api/mcp/builtin-tools.ts
index 19406026..b149c13d 100644
--- a/src/api/mcp/builtin-tools.ts
+++ b/src/api/mcp/builtin-tools.ts
@@ -685,7 +685,7 @@ async function executeWebFetch(args: Record<string, any>): Promise<string> {
if (text.length > maxLength) return text.substring(0, maxLength) + '\n\n[...truncated]'
return text || 'Error: Page returned empty content'
} catch (fallbackErr) {
- return `Error: web_fetch failed — ${e instanceof Error ? e.message : String(e)}`
+ return `Error: web_fetch failed: ${e instanceof Error ? e.message : String(e)}`
}
}
}
@@ -766,7 +766,7 @@ async function executeFileEdit(args: Record<string, any>): Promise<string> {
try {
data = await backendCall('fs_read', { path, ...chatCtx() })
} catch (e) {
- return `Error: file_edit could not read ${path} — ${e instanceof Error ? e.message : String(e)}. To create a new file use file_write.`
+ return `Error: file_edit could not read ${path}: ${e instanceof Error ? e.message : String(e)}. To create a new file use file_write.`
}
if (data.encoding === 'base64') return `Error: file_edit cannot edit a binary file (${path}).`
const content = typeof data.content === 'string' ? data.content : ''
@@ -777,7 +777,7 @@ async function executeFileEdit(args: Record<string, any>): Promise<string> {
case 'empty_old':
return 'Error: file_edit requires a non-empty old_string. To create a new file use file_write.'
case 'noop':
- return 'Error: old_string and new_string are identical — nothing to change.'
+ return 'Error: old_string and new_string are identical, nothing to change.'
case 'not_found':
return `Error: old_string was not found in ${path}. Read the file and copy the exact text (including indentation) you want to replace.`
case 'not_unique':
diff --git a/src/api/vram-handoff.ts b/src/api/vram-handoff.ts
index becc07fd..86a8e2ea 100644
--- a/src/api/vram-handoff.ts
+++ b/src/api/vram-handoff.ts
@@ -673,7 +673,7 @@ async function runHandoff(kind: 'image' | 'video', args: VramHandoffArgs, seq: n
const i2vModels = models.filter((m) => isI2VModel(m.name))
if (i2vModels.length === 0) {
emitHandoff('error', { kind, detail: 'no i2v model installed' })
- return 'Error: Image-to-video needs an I2V model such as SVD. Install one from Models → Discover (e.g. "SVD-XT 1.1 — Image to Video"), then try again.'
+ return 'Error: Image-to-video needs an I2V model such as SVD. Install one from Models → Discover (e.g. "SVD-XT 1.1 (Image to Video)"), then try again.'
}
if (typeof args.model === 'string' && args.model) {
const resolved = resolveModelName(args.model, i2vModels)
@@ -695,7 +695,7 @@ async function runHandoff(kind: 'image' | 'video', args: VramHandoffArgs, seq: n
const t2vModels = models.filter((m) => isT2VCapable(m.name))
if (t2vModels.length === 0 || backend === 'none') {
emitHandoff('error', { kind, detail: 'no text-to-video model installed' })
- return 'Error: No text-to-video model installed. Download one from Models → Discover (e.g. "Wan 2.1 — 1.3B (Lightweight)" for 8-10 GB VRAM or "HunyuanVideo 1.5 T2V FP8" for 12+ GB) — or generate an image first and animate it with an I2V model like "SVD-XT 1.1".'
+ return 'Error: No text-to-video model installed. Download one from Models → Discover (e.g. "Wan 2.1 · 1.3B (Lightweight)" for 8 to 10 GB VRAM or "HunyuanVideo 1.5 T2V FP8" for 12+ GB). Or generate an image first and animate it with an I2V model like "SVD-XT 1.1".'
}
if (typeof args.model === 'string' && args.model) {
const resolved = resolveModelName(args.model, t2vModels)
@@ -714,7 +714,7 @@ async function runHandoff(kind: 'image' | 'video', args: VramHandoffArgs, seq: n
// ComfyUI unreachable while listing models — we have not unloaded anything,
// so just report it. Don't mask the connection failure.
emitHandoff('error', { kind, detail: String(e) })
- return `Error: Could not query ComfyUI models — ${e instanceof Error ? e.message : String(e)}. Is ComfyUI installed and reachable?`
+ return `Error: Could not query ComfyUI models: ${e instanceof Error ? e.message : String(e)}. Is ComfyUI installed and reachable?`
}
// Which text model do we reload afterwards? The pinned agent-loop model is
@@ -1498,7 +1498,7 @@ async function resolveInputImage(ref: string): Promise<ResolvedInputImage> {
if (!resp.ok) throw new Error(`could not read input image "${ref}" (HTTP ${resp.status})`)
const blob = await resp.blob()
if (!blob || blob.size === 0) {
- throw new Error(`could not read input image "${ref}" — ComfyUI returned an empty file`)
+ throw new Error(`could not read input image "${ref}", ComfyUI returned an empty file`)
}
// Probe the source dimensions so the I2V path can pick the model's native
// aspect ratio (David 2026-06-11: a portrait still forced into 768×448
diff --git a/src/hooks/useAgentChat.ts b/src/hooks/useAgentChat.ts
index c233b5dc..6556eda5 100644
--- a/src/hooks/useAgentChat.ts
+++ b/src/hooks/useAgentChat.ts
@@ -976,7 +976,7 @@ export function useAgentChat() {
agentMessages.push({
role: 'user',
content:
- 'Stop — the media you were asked for is already created and shown. Write ONLY a short, friendly closing line to the user in their own language (e.g. that their picture/clip is ready). Do not output JSON, do not repeat this note, and do not call any tool.',
+ 'Stop, the media you were asked for is already created and shown. Write ONLY a short, friendly closing line to the user in their own language (e.g. that their picture/clip is ready). Do not output JSON, do not repeat this note, and do not call any tool.',
} as ChatMessage)
continue
}
@@ -1238,7 +1238,7 @@ export function useAgentChat() {
: r.status === 'completed' || r.status === 'cached'
? (r.result ?? '')
: r.errorHint
- ? `${r.error ?? 'Tool failed'} — ${r.errorHint}`
+ ? `${r.error ?? 'Tool failed'}, ${r.errorHint}`
: (r.error ?? 'Tool failed')
// Small-Model Mode (Knob 3): truncate long tool outputs (head+tail)
// before re-injecting into history. No-op for big models. The short
@@ -1401,7 +1401,7 @@ export function useAgentChat() {
useChatStore.getState().updateMessageContent(
convId!, assistantMessage.id,
(contentRef.current ? contentRef.current + '\n\n' : '') +
- `Lost the connection to the local model backend mid-response — it may have crashed, been closed, or was busy swapping models. LU already retried automatically.\n\nCheck that Ollama / LM Studio is running (and the model still loads), then send the message again.\n\nDetails: ${errorMsg}`
+ `Lost the connection to the local model backend mid-response, it may have crashed, been closed, or was busy swapping models. LU already retried automatically.\n\nCheck that Ollama / LM Studio is running (and the model still loads), then send the message again.\n\nDetails: ${errorMsg}`
)
} else {
useChatStore.getState().updateMessageContent(
@@ -1508,7 +1508,7 @@ export function extractMediaPrompt(text: string): string {
}
function buildAgentSystemPrompt(basePrompt: string): string {
- const agentInstructions = `You are an autonomous AI agent inside LU with full access to this computer. You execute tasks end-to-end by using tools — you do NOT just describe what to do.
+ const agentInstructions = `You are an autonomous AI agent inside LU with full access to this computer. You execute tasks end-to-end by using tools, you do NOT just describe what to do.
Available tools:
- Filesystem: file_read, file_write, file_list, file_search
@@ -1516,29 +1516,29 @@ Available tools:
- System: shell_execute, code_execute, system_info, screenshot, process_list, get_current_time
- Creative: image_generate, video_generate (text-to-video, or animate a generated image via inputImage), run_workflow
-AUTONOMY CONTRACT (read carefully — this is the most important rule):
-- When the user asks you to BUILD, CREATE, MAKE, or WRITE something (a file, a website, a script, a folder structure), you MUST execute it via tools — typically file_write.
-- NEVER produce a code block in your reply followed by "save this as index.html". That is a FAILURE — it means you talked instead of acted.
+AUTONOMY CONTRACT (read carefully, this is the most important rule):
+- When the user asks you to BUILD, CREATE, MAKE, or WRITE something (a file, a website, a script, a folder structure), you MUST execute it via tools, typically file_write.
+- NEVER produce a code block in your reply followed by "save this as index.html". That is a FAILURE, it means you talked instead of acted.
- NEVER say "Now I will create X" or "Next I'll write Y" as plain prose and then stop. The model is supposed to DO the next step right now, as a tool call.
-- When the task has N steps, execute ALL N as tool calls in one session. The user does not want a tutorial — they want the result on disk.
+- When the task has N steps, execute ALL N as tool calls in one session. The user does not want a tutorial, they want the result on disk.
- The ONLY reasons to finish without calling another tool are: (a) the task is genuinely complete, or (b) you are stuck and need user input.
Workflow for build / create tasks:
1. (Optional) file_list to scout the target directory.
2. file_write the artefact(s) directly. For a website: write index.html, style.css, script.js as separate file_write calls.
-3. After the LAST file_write, write a 1–3 sentence final answer ("Done — wrote 3 files to <path>"). Nothing in between.
+3. After the LAST file_write, write a 1 to 3 sentence final answer ("Done — wrote 3 files to <path>"). Nothing in between.
-Creative tools — image_generate, video_generate:
-- When the user asks for an image / picture / drawing, CALL image_generate. You HAVE this tool — do NOT reply with prose about DALL-E, Midjourney, or "as a text model I can't". Just call it.
+Creative tools, image_generate, video_generate:
+- When the user asks for an image / picture / drawing, CALL image_generate. You HAVE this tool, do NOT reply with prose about DALL-E, Midjourney, or "as a text model I can't". Just call it.
- After image_generate runs you will be shown the generated image; LOOK at it and briefly describe what you actually see.
- To make a video, CALL video_generate. To animate an image you just generated, call video_generate with inputImage set to that image's filename (it is in the image_generate result).
- Emit these as REAL tool calls through the tool channel — never write the call as plain text like image_generate(prompt="…") in your answer.
Other rules:
- You MUST use tools — NEVER answer from memory or guess file contents.
-- PATHS: use paths relative to your working directory (e.g. \`package.json\`, \`src/app.ts\`, \`.\` for the current folder). Never start a path with \`/\` or a drive letter (\`C:\\\`) — that escapes your workspace and fails. To list the current folder, use file_list with path \`.\`.
+- PATHS: use paths relative to your working directory (e.g. \`package.json\`, \`src/app.ts\`, \`.\` for the current folder). Never start a path with \`/\` or a drive letter (\`C:\\\`), that escapes your workspace and fails. To list the current folder, use file_list with path \`.\`.
- For filesystem READ tasks: file_list first if needed, then file_read.
-- For web tasks: web_search → web_fetch on the best URL → answer based on real data. web_search returns ONLY short snippets — ALWAYS call web_fetch to read the page.
+- For web tasks: web_search → web_fetch on the best URL → answer based on real data. web_search returns ONLY short snippets, ALWAYS call web_fetch to read the page.
- If you need to know the OS, paths, or hardware: call system_info once at the start.
- Chain multiple tools as needed. If a tool fails, try a different approach.
- Be concise in text. All the work happens in tool calls.
@@ -1556,14 +1556,14 @@ Other rules:
// have a limited instruction-following budget. Keep only what a small model
// needs to ACT — same tool names + native call format as the full prompt.
function buildAgentSystemPromptLean(basePrompt: string): string {
- const lean = `You are an autonomous agent in LU with tools on this computer. Do tasks by CALLING tools — do not just describe them.
+ const lean = `You are an autonomous agent in LU with tools on this computer. Do tasks by CALLING tools, do not just describe them.
Tools: file_read, file_write, file_list, file_search, web_search, web_fetch, shell_execute, code_execute, system_info, get_current_time, image_generate, video_generate.
Rules:
-- To build/create/write something, CALL the tool (usually file_write) — never paste a code block and say "save this".
-- PATHS: use relative paths (e.g. \`package.json\`, \`.\`). Never start with \`/\` or a drive letter — it escapes your workspace and fails.
-- Emit the tool call as your FIRST output — no "Okay, let me…" preamble. Valid JSON, one at a time. Never guess file contents — file_read first.
+- To build/create/write something, CALL the tool (usually file_write), never paste a code block and say "save this".
+- PATHS: use relative paths (e.g. \`package.json\`, \`.\`). Never start with \`/\` or a drive letter, it escapes your workspace and fails.
+- Emit the tool call as your FIRST output, no "Okay, let me…" preamble. Valid JSON, one at a time. Never guess file contents, file_read first.
- After each tool result, if a step remains, immediately call the next tool. Do not narrate "I will now…" and then stop.
- For images/video call image_generate / video_generate as real tool calls.
- When everything is done, reply with one short sentence in the user's language.`
@@ -1578,13 +1578,13 @@ Rules:
* chat into an agent. Kept short so it doesn't crowd a small model's context.
*/
function buildChatToolsSystemPrompt(basePrompt: string): string {
- const p = `You are a helpful chat assistant in LU, having a normal conversation. You also have a few tools for things you cannot do from memory — use one ONLY when the user's request actually needs it, otherwise just reply normally:
-- web_search — look up current/real-world facts (returns short snippets)
-- web_fetch — read a specific web page or URL (after a search, or when the user gives a link)
-- file_write — save text to a file when the user asks you to write/create/save a file
-- image_generate — create an image when the user asks for a picture/drawing/logo
-- video_generate — create a short video/animation when the user asks for one (to animate an image you just made, pass its filename as inputImage)
-
-Emit tool calls through the real tool channel — never as plain text like image_generate("…"). After a tool runs, give a short, natural reply about the result. For web questions, prefer web_search then web_fetch on the best result before answering. Reply in the user's language.`
+ const p = `You are a helpful chat assistant in LU, having a normal conversation. You also have a few tools for things you cannot do from memory, use one ONLY when the user's request actually needs it, otherwise just reply normally:
+- web_search, look up current/real-world facts (returns short snippets)
+- web_fetch, read a specific web page or URL (after a search, or when the user gives a link)
+- file_write, save text to a file when the user asks you to write/create/save a file
+- image_generate, create an image when the user asks for a picture/drawing/logo
+- video_generate, create a short video/animation when the user asks for one (to animate an image you just made, pass its filename as inputImage)
+
+Emit tool calls through the real tool channel, never as plain text like image_generate("…"). After a tool runs, give a short, natural reply about the result. For web questions, prefer web_search then web_fetch on the best result before answering. Reply in the user's language.`
return basePrompt ? `${p}\n\n${basePrompt}` : p
}
diff --git a/src/hooks/useChat.ts b/src/hooks/useChat.ts
index 9dd0c17f..8b86fc4b 100644
--- a/src/hooks/useChat.ts
+++ b/src/hooks/useChat.ts
@@ -477,13 +477,13 @@ export function useChat() {
const explanation =
finishReason === 'length'
? (captured
- ? 'The model spent its entire token budget thinking and never wrote the answer. Try again — reasoning is not deterministic — or turn Thinking off for this question.'
+ ? 'The model spent its entire token budget thinking and never wrote the answer. Try again, reasoning is not deterministic, or turn Thinking off for this question.'
: 'The model hit its token limit before writing an answer. Try again, or raise Max Tokens in Settings.')
: finishReason === 'disconnect'
? 'The connection dropped before the model finished its answer. Check your network and try again.'
: captured && keepThinking
- ? 'The model finished thinking but never wrote an answer. Try again — or turn Thinking off for this question.'
- : "I didn't return a visible answer that time — please try again."
+ ? 'The model finished thinking but never wrote an answer. Try again, or turn Thinking off for this question.'
+ : "I didn't return a visible answer that time, please try again."
if (captured && keepThinking) {
// Thinking ON: surface the reasoning AND say why there's no answer
// (the collapsed thinking pill alone reads as dead air).
diff --git a/src/hooks/useCloudCreate.ts b/src/hooks/useCloudCreate.ts
index c487ae4a..6050db10 100644
--- a/src/hooks/useCloudCreate.ts
+++ b/src/hooks/useCloudCreate.ts
@@ -140,7 +140,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
if (!cloudMediaLive()) {
// Server MEDIA_LIVE switch is off — the GPU fleet isn't up, a submit
// would only 503. Mirror the server's honest "coming soon".
- s.setError('Cloud rendering is coming soon — the GPU fleet is not live yet.')
+ s.setError('Cloud rendering is coming soon, the GPU fleet is not live yet.')
return
}
if ((op === 'generate' || op === 'music' || op === 'tts') && s.prompt.trim().length === 0) {
@@ -156,7 +156,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
}
// Per-intent input contracts (client UX; the server re-checks all of it).
if (characterUse && !s.selectedCharacter) {
- s.setError('Pick a character from your shelf first — or train one.')
+ s.setError('Pick a character from your shelf first, or train one.')
return
}
if (op === 'lora-train' && s.trainImages.length < 4) {
@@ -165,7 +165,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
}
if (op === 'lipsync') {
if (!s.audioInput && !s.voiceFromJob) {
- s.setError('Add a voice first — upload an audio file or pick a generated one.')
+ s.setError('Add a voice first, upload an audio file or pick a generated one.')
return
}
const needsClip = cloudModelById(model)?.lipsync_source === 'video'
@@ -252,8 +252,8 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
if (!s.mask) {
s.setError(
op === 'eraser'
- ? 'Paint a mask first — the eraser removes what you painted.'
- : 'Paint a mask first — the edit only changes the painted area.',
+ ? 'Paint a mask first, the eraser removes what you painted.'
+ : 'Paint a mask first, the edit only changes the painted area.',
)
s.setIsGenerating(false)
return
@@ -272,7 +272,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
} else if (s.voiceFromJob) {
// A prior own render (tts/music) — fresh signed URL, zero re-upload.
const vj = await getJob(s.voiceFromJob.jobId)
- if (!vj.result_url) throw new Error('That voice has expired — generate it again first.')
+ if (!vj.result_url) throw new Error('That voice has expired, generate it again first.')
params.audio_url = vj.result_url
}
}
@@ -287,7 +287,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
}
if (op === 'extend' && s.extendSource) {
const src = await getJob(s.extendSource.jobId)
- if (!src.result_url) throw new Error('The source clip has expired — re-render it first.')
+ if (!src.result_url) throw new Error('The source clip has expired, re-render it first.')
params.source_url = src.result_url
}
@@ -374,13 +374,13 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
} catch (err) {
const st = useCreateStore.getState()
if (err instanceof CloudJobError && err.status === 429) {
- st.setError('Monthly credit budget exhausted — upgrade your plan or wait for the next period.')
+ st.setError('Monthly credit budget exhausted, upgrade your plan or wait for the next period.')
} else if (err instanceof CloudJobError && err.status === 401) {
st.setError('Sign in to your LU Cloud account to render in the cloud.')
} else if (err instanceof CloudJobError && err.message === 'render timed out') {
// The desktop app has no jobs-history view — point at the account
// page instead of promising an in-app surface that doesn't exist.
- st.setError('Still rendering — this is taking longer than expected. When it completes you can view it in your account at lu-labs.ai.')
+ st.setError('Still rendering, this is taking longer than expected. When it completes you can view it in your account at lu-labs.ai.')
} else if (!(err instanceof CloudJobError && err.message === 'polling aborted')) {
st.setError(err instanceof Error ? err.message : String(err))
}
@@ -491,7 +491,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
} catch (err) {
const st = useCreateStore.getState()
if (err instanceof CloudJobError && err.status === 429) {
- st.setError('Monthly credit budget exhausted — upgrade your plan or wait for the next period.')
+ st.setError('Monthly credit budget exhausted, upgrade your plan or wait for the next period.')
} else if (!(err instanceof CloudJobError && err.message === 'polling aborted')) {
st.setError(err instanceof Error ? err.message : String(err))
}
@@ -526,7 +526,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
try {
// Fresh signed URL — the stored one expires ~1 h after the last read.
const sourceJob = await getJob(item.jobId)
- if (!sourceJob.result_url) throw new Error('The source clip has expired — re-render it first.')
+ if (!sourceJob.result_url) throw new Error('The source clip has expired, re-render it first.')
if (ac.signal.aborted) return
@@ -583,7 +583,7 @@ export function useCloudCreate(opts: { onQuotaChange?: () => void } = {}) {
} catch (err) {
const st = useCreateStore.getState()
if (err instanceof CloudJobError && err.status === 429) {
- st.setError('Monthly credit budget exhausted — upgrade your plan or wait for the next period.')
+ st.setError('Monthly credit budget exhausted, upgrade your plan or wait for the next period.')
} else if (!(err instanceof CloudJobError && err.message === 'polling aborted')) {
st.setError(err instanceof Error ? err.message : String(err))
}
diff --git a/src/hooks/useCodex.ts b/src/hooks/useCodex.ts
index 9dd8a0c7..b96b4326 100644
--- a/src/hooks/useCodex.ts
+++ b/src/hooks/useCodex.ts
@@ -60,20 +60,20 @@ function diagLog(_tag: string, _data: unknown): void {
// framing for a read-only reviewer and would fight the executor gate. The
// list-stripping below (REVIEW_MODE_FORBIDDEN_TOOLS) still enforces
// read-only programmatically even if the model tries a write tool anyway.
-const CODEX_REVIEW_SYSTEM_PROMPT = `You are the Coding Agent in REVIEW MODE — a read-only code reviewer inside LU. You DO NOT modify any files, run any commands, or change any state. Your job is to read code with file_read / file_list / file_search / git_diff / git_log and return INLINE COMMENTS only.
+const CODEX_REVIEW_SYSTEM_PROMPT = `You are the Coding Agent in REVIEW MODE, a read-only code reviewer inside LU. You DO NOT modify any files, run any commands, or change any state. Your job is to read code with file_read / file_list / file_search / git_diff / git_log and return INLINE COMMENTS only.
REVIEW MODE CONTRACT (binding):
- You MAY call: file_read, file_list, file_search, git_status, git_log, git_diff, system_info, process_list, get_current_time, web_fetch, web_search.
-- You MUST NOT call: file_write, file_edit, shell_execute, code_execute, run_tests, git_commit, git_push, gh_pr_create, image_generate, video_generate, run_workflow, screenshot, delegate_task. If you call them, the harness will reject the call and tell the model "review-only mode" — wasted budget.
+- You MUST NOT call: file_write, file_edit, shell_execute, code_execute, run_tests, git_commit, git_push, gh_pr_create, image_generate, video_generate, run_workflow, screenshot, delegate_task. If you call them, the harness will reject the call and tell the model "review-only mode", wasted budget.
- Output format: a markdown report with sections "## Summary", "## Findings (priority order)", "## Suggested follow-ups". For each finding cite the file + line range (path:line or path:start-end).
- Be direct. No flattery, no boilerplate. If the code is fine, say so in one sentence and stop.`
-const CODEX_SYSTEM_PROMPT = `You are the Coding Agent, an autonomous coding agent inside LU. You execute coding tasks end-to-end by reading files, writing code, and running shell commands. You MUST use tools — never guess file contents.
+const CODEX_SYSTEM_PROMPT = `You are the Coding Agent, an autonomous coding agent inside LU. You execute coding tasks end-to-end by reading files, writing code, and running shell commands. You MUST use tools, never guess file contents.
AUTONOMY CONTRACT (read carefully):
- You are expected to COMPLETE multi-step tasks without the user prompting between steps.
- NEVER say "Now I will create X" or "Next I'll write Y" as plain text and then stop. That is a FAILURE.
-- When your plan has N steps, execute ALL N steps in one session — each step as a concrete tool call.
+- When your plan has N steps, execute ALL N steps in one session, each step as a concrete tool call.
- The ONLY reasons to finish without calling another tool are:
(a) the task is 100% complete AND verified, or
(b) you hit an error you cannot recover from after trying.
@@ -81,20 +81,20 @@ AUTONOMY CONTRACT (read carefully):
Workflow per task:
1. Understand the task (optional brief sentence)
-2. Explore the codebase — file_list / file_read / file_search
-3. Implement ALL required changes — file_edit to change existing files, file_write for new ones; as many calls as needed in one go
-4. Verify — shell_execute to run tests, lint, or build
+2. Explore the codebase, file_list / file_read / file_search
+3. Implement ALL required changes, file_edit to change existing files, file_write for new ones; as many calls as needed in one go
+4. Verify, shell_execute to run tests, lint, or build
5. Only THEN write a short summary of what you did
Rules:
- Always read a file before modifying it
-- To CHANGE part of an existing file, use file_edit (replace a UNIQUE old_string with new_string) — it is far cheaper and safer than rewriting the whole file with file_write, and never truncates a large file. Use file_write only to CREATE a new file or fully replace one. If file_edit reports the old_string is missing or not unique, read the file and retry with more surrounding lines.
-- PATHS: use paths relative to the working directory shown below (e.g. \`package.json\`, \`src/app.ts\`, \`.\` for the current folder). Never start a path with \`/\` or a drive letter (\`C:\\\`) — that escapes the workspace and fails.
+- To CHANGE part of an existing file, use file_edit (replace a UNIQUE old_string with new_string), it is far cheaper and safer than rewriting the whole file with file_write, and never truncates a large file. Use file_write only to CREATE a new file or fully replace one. If file_edit reports the old_string is missing or not unique, read the file and retry with more surrounding lines.
+- PATHS: use paths relative to the working directory shown below (e.g. \`package.json\`, \`src/app.ts\`, \`.\` for the current folder). Never start a path with \`/\` or a drive letter (\`C:\\\`), that escapes the workspace and fails.
- Chain tool calls: after each tool result, if there is another step left, IMMEDIATELY call the next tool
-- If a command fails, diagnose and retry with a different approach — don't hand back to the user unless truly stuck
+- If a command fails, diagnose and retry with a different approach, don't hand back to the user unless truly stuck
- Be concise in text. All the work happens in tool calls.
-- Asset generation: when the task needs an image or a short video (placeholder art, hero image, demo clip), call image_generate / video_generate as a real tool call — ComfyUI runs locally. To animate a generated image, call video_generate with inputImage set to that image's filename.
-- FINISH with a short natural-language sentence summarising what you did or found. NEVER end your turn with only a raw JSON object or a bare code block — the user needs a human-readable answer, not a data dump.`
+- Asset generation: when the task needs an image or a short video (placeholder art, hero image, demo clip), call image_generate / video_generate as a real tool call, ComfyUI runs locally. To animate a generated image, call video_generate with inputImage set to that image's filename.
+- FINISH with a short natural-language sentence summarising what you did or found. NEVER end your turn with only a raw JSON object or a bare code block, the user needs a human-readable answer, not a data dump.`
// Small-Model Mode (Knob 2): a lean Codex prompt (~500 chars vs ~1700 above)
// for 3B-8B models. Research (LongFuncEval, arXiv 2505.10570) shows long
@@ -103,13 +103,13 @@ Rules:
// workflow prose costs more than it buys. Keep only the essentials and stay
// faithful to the native tool-call format. Selected at the injection point
// below when settings.smallModelMode is on (review mode still wins).
-const CODEX_SYSTEM_PROMPT_LEAN = `You are a coding agent in LU. Use tools to do the work — never guess file contents.
+const CODEX_SYSTEM_PROMPT_LEAN = `You are a coding agent in LU. Use tools to do the work, never guess file contents.
Rules:
- Read a file before you edit it.
- To change an existing file use file_edit (replace a unique old_string with new_string), not file_write. Use file_write only to create a new file.
-- PATHS: use relative paths (e.g. \`package.json\`, \`.\`). Never start with \`/\` or a drive letter — it escapes the workspace and fails.
-- Emit the tool call as your FIRST output — no "Okay, let me…" preamble. One step at a time, as valid JSON.
+- PATHS: use relative paths (e.g. \`package.json\`, \`.\`). Never start with \`/\` or a drive letter, it escapes the workspace and fails.
+- Emit the tool call as your FIRST output, no "Okay, let me…" preamble. One step at a time, as valid JSON.
- After each tool result, if more steps remain, immediately call the next tool. Do not narrate "I will now…" and then stop.
- When the task is done and verified, reply with one short sentence. Never end with only raw JSON or a bare code block.`
@@ -199,7 +199,7 @@ function isSystemPromptEcho(content: string): boolean {
}
// Server-declared think capability (LU Cloud models carry thinkMode from
-// /models) wins over the local name-heuristic — same precedence as
+// /models) wins over the local name-heuristic, same precedence as
// useChat/useAgentChat: 'always' reasoners keep their native channel,
// 'never' models get no think prompting or knobs.
function codexThinkMode(model: string) {
@@ -221,7 +221,7 @@ export function useCodex() {
if (!activeModel) return
// Coding-Agent slash commands (David 2026-06-12): "/review", "/commit",
- // "/test", … live HERE, in the Code view — its full file_*/shell/git tools
+ // "/test", … live HERE, in the Code view, its full file_*/shell/git tools
// + working directory are exactly what these templates drive. Expand the
// command to the full instruction the model acts on; the raw "/cmd args" is
// shown as the user's message (displayContent). A non-command input passes
@@ -501,7 +501,7 @@ export function useCodex() {
id: uuid(),
phase: 'reflection',
content:
- `🏗️ Architect skipped — \`${archModel}\` is a cloud model and "Allow cloud architect" is off. Enable it in Settings → Coding Agent, or pick a local model.`,
+ `🏗️ Architect skipped, \`${archModel}\` is a cloud model and "Allow cloud architect" is off. Enable it in Settings → Coding Agent, or pick a local model.`,
timestamp: Date.now(),
})
useChatStore.getState().updateMessageAgentBlocks(convId, assistantMsg.id, [...blocks])
@@ -555,7 +555,7 @@ export function useCodex() {
blocks.push({
id: uuid(),
phase: 'reflection',
- content: `🗺️ Repo map: top ${repoMap.files.length} files (of ${repoMap.count}) — ${repoMap.files.slice(0, 5).map((f) => f.path).join(', ')}${repoMap.files.length > 5 ? '…' : ''}`,
+ content: `🗺️ Repo map: top ${repoMap.files.length} files (of ${repoMap.count}), ${repoMap.files.slice(0, 5).map((f) => f.path).join(', ')}${repoMap.files.length > 5 ? '…' : ''}`,
timestamp: Date.now(),
})
useChatStore.getState().updateMessageAgentBlocks(convId, assistantMsg.id, [...blocks])
@@ -1034,7 +1034,7 @@ export function useCodex() {
const emptyTurn = turnContent.trim().length === 0
// Only nudge an empty turn when NOTHING has been produced yet (a true
// early stall). An empty turn AFTER a real answer means the model is
- // finished — break immediately instead of spinning slow no-op nudge
+ // finished, break immediately instead of spinning slow no-op nudge
// iterations that keep the typing dots up long after the answer is
// done (David 2026-06-12: "die punkte bleiben so lange obwohl keine
// antwort mehr kam"). Read-only report commands (/review, /explain …)
@@ -1054,7 +1054,7 @@ export function useCodex() {
break
}
- // Phase 5b (v2.4.0) — parallel tool execution via tool-executor.
+ // Phase 5b (v2.4.0), parallel tool execution via tool-executor.
if (!runningRef.current || abort.signal.aborted) break
// Loop-detector: compute batch signature (sorted name+args pairs).
@@ -1066,7 +1066,7 @@ export function useCodex() {
if (batchSig === prevBatchSig) {
sameBatchRepeats++
if (sameBatchRepeats >= 2) {
- const msg = `\n\n_(halted: same tool sequence repeated ${sameBatchRepeats + 1}× — model is looping. Try a larger model like Qwen 3.6 for multi-step code tasks.)_`
+ const msg = `\n\n_(halted: same tool sequence repeated ${sameBatchRepeats + 1}×, model is looping. Try a larger model like Qwen 3.6 for multi-step code tasks.)_`
useChatStore.getState().updateMessageContent(convId, assistantMsg.id, fullContent + msg)
break
}
@@ -1283,7 +1283,7 @@ export function useCodex() {
if (!applied.ok) {
switch (applied.reason) {
case 'empty_old': return 'file_edit: old_string must be non-empty. Use file_write to create a new file.'
- case 'noop': return 'file_edit: old_string and new_string are identical — nothing to change.'
+ case 'noop': return 'file_edit: old_string and new_string are identical, nothing to change.'
case 'not_found': return `file_edit: old_string not found in ${path}. Read the file and copy the exact text you want to replace.`
case 'not_unique': return `file_edit: old_string matches ${applied.matches} places in ${path}. Add surrounding lines so it is unique.`
default: return 'file_edit: failed.'
@@ -1468,7 +1468,7 @@ export function useCodex() {
r.status === 'completed' || r.status === 'cached'
? (r.result ?? '')
: r.errorHint
- ? `${r.error ?? 'Tool failed'} — ${r.errorHint}`
+ ? `${r.error ?? 'Tool failed'}, ${r.errorHint}`
: (r.error ?? 'Tool failed')
// Small-Model Mode (Knob 3): truncate long tool outputs (head+tail)
// before they re-enter the model history. Long results cost small
@@ -1537,10 +1537,10 @@ export function useCodex() {
// nothing failed.
if (completed.length === 0) {
fullContent = failed.length
- ? `I couldn't complete the task — ${failed.length} operation(s) failed and nothing succeeded. Check the tool errors above, then refine the instruction or try a stronger model.`
- : `I stopped without completing the task — the model ended its turn without doing any work. Try rephrasing the instruction, or turn Think off and resend.`
+ ? `I couldn't complete the task, ${failed.length} operation(s) failed and nothing succeeded. Check the tool errors above, then refine the instruction or try a stronger model.`
+ : `I stopped without completing the task, the model ended its turn without doing any work. Try rephrasing the instruction, or turn Think off and resend.`
} else if (failed.length > 0) {
- fullContent = `Partially done: ${parts.join(', ')}. Some steps failed — see the errors above; the result may be incomplete.`
+ fullContent = `Partially done: ${parts.join(', ')}. Some steps failed, see the errors above; the result may be incomplete.`
} else {
fullContent = parts.length > 0 ? `Done: ${parts.join(', ')}.` : 'Done.'
}
diff --git a/src/hooks/useCreate.ts b/src/hooks/useCreate.ts
index 650f276f..60e44140 100644
--- a/src/hooks/useCreate.ts
+++ b/src/hooks/useCreate.ts
@@ -435,7 +435,7 @@ export function useCreate() {
// Local Edit is mask inpaint — without a painted mask it would silently
// degrade to plain img2img and repaint the WHOLE image.
if (intent === 'edit' && !maskFilename) {
- setError('Paint a mask first — open the mask editor and mark the area to change.')
+ setError('Paint a mask first, open the mask editor and mark the area to change.')
return
}
if (!isRemoveBg && !activeModel) {
@@ -698,7 +698,7 @@ export function useCreate() {
// Re-build the workflow now that the new node is available
const genParams = { ...baseParams, frames, fps, ...(effI2vImage ? { inputImage: effI2vImage } : {}) }
workflow = await buildDynamicWorkflow(genParams, imageModelType)
- setProgress(10, 'VHS installed — generating MP4...')
+ setProgress(10, 'VHS installed, generating MP4...')
} catch (instErr) {
setError(`Failed to install VHS_VideoCombine: ${instErr instanceof Error ? instErr.message : String(instErr)}. You can install it manually in ComfyUI Manager.`)
setIsGenerating(false)
diff --git a/src/hooks/useVoice.ts b/src/hooks/useVoice.ts
index 8198623f..7f7d37a6 100644
--- a/src/hooks/useVoice.ts
+++ b/src/hooks/useVoice.ts
@@ -31,12 +31,12 @@ import { registerAutoSpeak } from "../lib/ttsBridge";
// budget exhausted") are already human-readable — pass those through.
function sttErrorMessage(err: unknown): string {
if (err instanceof CloudJobError) {
- if (err.status === 401) return "Signed out — sign in again to use cloud dictation";
- if (err.status === 413) return "Recording too long — try a shorter take";
- if (err.status >= 500) return "Cloud transcription is unavailable right now — try again";
+ if (err.status === 401) return "Signed out, sign in again to use cloud dictation";
+ if (err.status === 413) return "Recording too long, try a shorter take";
+ if (err.status >= 500) return "Cloud transcription is unavailable right now, try again";
return err.message;
}
- return "Transcription failed — check the microphone and try again";
+ return "Transcription failed, check the microphone and try again";
}
// Speak-generation counter + abort plumbing, module-scoped (NOT per hook
@@ -225,7 +225,7 @@ export function useVoice() {
if (streamTimerRef.current) { clearInterval(streamTimerRef.current); streamTimerRef.current = null; }
interimBusyRef.current = false;
recorderRef.current = null;
- store.setSttError("Microphone unavailable — check mic permissions for LU in System Settings");
+ store.setSttError("Microphone unavailable, check mic permissions for LU in System Settings");
return false;
}
},
@@ -268,7 +268,7 @@ export function useVoice() {
store.setRecording(false);
store.setTranscribing(false);
recorderRef.current = null;
- store.setSttError("Recording failed — try again");
+ store.setSttError("Recording failed, try again");
return "";
}
}, [store, cloudVoice]);