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(agent): the phone copy of the tool descriptions and three text guards follow C59

purpled3462816e5fa
diff --git a/e2e/agent-live/settings-shot.bench.ts b/e2e/agent-live/settings-shot.bench.ts
new file mode 100644
index 00000000..463a7d6a
--- /dev/null
+++ b/e2e/agent-live/settings-shot.bench.ts
@@ -0,0 +1,18 @@
+/** Screenshot of the C59 switch in Settings → Agent Permissions. Runs only with LU_BENCH_SHOT=<png path>. */
+import { test, expect } from '@playwright/test'
+import { seedOnboardingDone } from '../support/cloud-mock'
+
+const OUT = process.env.LU_BENCH_SHOT
+
+test('C59 switch in the settings', async ({ page }) => {
+ test.skip(!OUT, 'set LU_BENCH_SHOT')
+ await seedOnboardingDone(page)
+ await page.goto('/')
+ await page.getByRole('button', { name: /settings/i }).first().click()
+ const label = page.getByText('Short tool list for local models', { exact: true })
+ await label.scrollIntoViewIfNeeded()
+ await expect(label).toBeVisible()
+ await expect(page.getByText(/finds every other tool with tool_search/)).toBeVisible()
+ const box = await label.locator('xpath=ancestor::*[self::section or self::div][4]').boundingBox()
+ await page.screenshot({ path: OUT!, clip: box ?? undefined })
+})
diff --git a/mobile-client/agent-core.js b/mobile-client/agent-core.js
index 5fd0ddc7..5c57b6c9 100644
--- a/mobile-client/agent-core.js
+++ b/mobile-client/agent-core.js
@@ -16,12 +16,12 @@ import { stripNonCanonicalTags } from './personas.js'
{name:'web_fetch', description:'Fetch a single URL and return its readable text (up to ~40 000 chars), the article without menus, scripts and page furniture. PREFER this over web_search when you already know the target URL. NEVER call it with localhost, a private IP or file://, those are refused. On an empty or 4xx response try a different URL, not the same one again.',
parameters:[{name:'url',type:'string',description:'Full URL including protocol (http:// or https://)',required:true},
{name:'maxLength',type:'number',description:'Max chars to return (default: 40000)',required:false}]},
- {name:'file_read', description:'Read a file. PREFER absolute paths; relative paths resolve against the agent workspace. Omitting offset/limit returns the whole file. For LARGE files pass offset (1-based start line) and limit (number of lines): the response names the window, the total line count and the offset of the next page. A very long whole-file read gets its middle truncated, so page large files. DO NOT re-read a file you just wrote, the write response already confirmed it.',
- parameters:[{name:'path',type:'string',description:'Path to the file (absolute preferred)',required:true},
+ {name:'file_read', description:'Read a file. Use a path relative to the workspace; an absolute path works only inside it. Omitting offset/limit returns the whole file. For LARGE files pass offset (1-based start line) and limit (number of lines): the response names the window, the total line count and the offset of the next page. A very long whole-file read gets its middle truncated, so page large files. DO NOT re-read a file you just wrote, the write response already confirmed it.',
+ parameters:[{name:'path',type:'string',description:'Path relative to the workspace',required:true},
{name:'offset',type:'number',description:'1-based line to start reading from (optional)',required:false},
{name:'limit',type:'number',description:'Maximum number of lines to return (optional)',required:false}]},
- {name:'file_write', description:'Write a WHOLE file: use it to CREATE a new file or fully replace one, and PREFER file_edit to change part of an existing one. Creates parent directories if missing. OVERWRITES existing content, there is no append mode. PREFER absolute paths.',
- parameters:[{name:'path',type:'string',description:'Path to the file (absolute preferred)',required:true},
+ {name:'file_write', description:'Write a WHOLE file: use it to CREATE a new file or fully replace one, and PREFER file_edit to change part of an existing one. Creates parent directories if missing. OVERWRITES existing content, there is no append mode. Use a path relative to the workspace.',
+ parameters:[{name:'path',type:'string',description:'Path relative to the workspace',required:true},
{name:'content',type:'string',description:'The complete new content of the file',required:true}]},
{name:'file_list', description:'List directory contents. Returns name, isDir, size and full path per entry. Supports recursive=true and a glob pattern ("*.ts", "**/*.py"). PREFER a specific pattern over recursing a whole home or drive, that is slow. For content search use file_search.',
parameters:[{name:'path',type:'string',description:'Directory path to list',required:true},
@@ -33,7 +33,7 @@ import { stripNonCanonicalTags } from './personas.js'
{name:'maxResults',type:'number',description:'Maximum matching files (default: 50)',required:false}]},
{name:'shell_execute', description:'THE terminal. Run a shell command: PowerShell on Windows, bash on Unix. Returns stdout, stderr, exit code. Everything runs here: git, tests, package managers, gh, python, platform utilities, and opening files, folders or apps. A recognised test run and the common git commands come back as a parsed summary. Feed a script through `stdin` instead of quoting it: set command to `python3 -` or `bash -s` (fresh process each call, no REPL state). For long work set `background: true` to get a task id back at once, then call again with `task: "status"` and `task_id` (or "list" / "kill"). PREFER dedicated tools where available: file_read over `cat`, file_list over `ls`, file_search over `grep`. `--no-verify` is refused, and NEVER delete permanently without confirmation. Default timeout 120 s, test runs 300 s.',
parameters:[{name:'command',type:'string',description:'The full command to execute. Omit only for task actions.',required:false},
- {name:'cwd',type:'string',description:'Working directory (optional, absolute preferred)',required:false},
+ {name:'cwd',type:'string',description:'Working directory (optional, relative to the workspace)',required:false},
{name:'timeout',type:'number',description:'Timeout in milliseconds (default: 120000)',required:false},
{name:'shell',type:'string',description:'Override shell: "powershell" | "cmd" | "bash" (default: auto)',required:false},
{name:'stdin',type:'string',description:'Text piped to the command\x27s stdin, e.g. a Python script for `python3 -`.',required:false},
diff --git a/src/lib/plan-gate.ts b/src/lib/plan-gate.ts
index 0c976e80..3c18a63b 100644
--- a/src/lib/plan-gate.ts
+++ b/src/lib/plan-gate.ts
@@ -83,7 +83,7 @@ export function codePlanAllowed(input: PlanToolInput & { reviewMode: boolean }):
export const PLAN_NUDGE_AFTER_ROUNDS = 3
export const PLAN_NUDGE =
- 'This task has several steps and there is no plan yet. Send todo_write with every remaining step now, '
+ 'This task has several steps and has no plan. Send todo_write with every remaining step now, '
+ 'together with your next real tool call (finished steps completed, the current one in_progress).'
export function planNudgeDue(input: {
diff --git a/src/lib/plugins/__tests__/rea-tools-stay-for-a-follow-up.test.ts b/src/lib/plugins/__tests__/rea-tools-stay-for-a-follow-up.test.ts
index 48d0e3ee..afae59ac 100644
--- a/src/lib/plugins/__tests__/rea-tools-stay-for-a-follow-up.test.ts
+++ b/src/lib/plugins/__tests__/rea-tools-stay-for-a-follow-up.test.ts
@@ -74,6 +74,6 @@ describe('the turn after a stopped run keeps the REA tools', () => {
expect(read('useCodex.ts')).toMatch(/maxTools: SMALL_MODEL_MAX_TOOLS,\s+reaText,/)
// Since the phone line joined (3.0.8) the options go through withPhoneToolCap
// first; reaText rides next to it in the same object.
- expect(read('useAgentChat.ts').match(/phoneToolCtx, SMALL_MODEL_MAX_TOOLS,\s+\),\s+reaText,\s+\}/g)).toHaveLength(2)
+ expect(read('useAgentChat.ts').match(/phoneToolCtx, SMALL_MODEL_MAX_TOOLS,\s+\),\s+(?:\.\.\.\(compactRun \? \{ maxTools: COMPACT_MAX_TOOLS \} : \{\}\),\s+)?reaText,\s+\}/g)).toHaveLength(2)
})
})
diff --git a/src/lib/tool-search.ts b/src/lib/tool-search.ts
index 39545d58..89d74869 100644
--- a/src/lib/tool-search.ts
+++ b/src/lib/tool-search.ts
@@ -29,7 +29,7 @@ export const TOOL_SEARCH_LIMIT = 5
export const TOOL_SEARCH_DEF: MCPToolDefinition = {
name: TOOL_SEARCH,
description:
- 'Find a tool that is not in your list yet. Describe what you need in a few words '
+ 'Find a tool that is not in your list. Describe what you need in a few words '
+ '(e.g. "make a video", "list running processes"). The matching tools are added to your list for the next step.',
inputSchema: {
type: 'object',