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.

v2.5.0 polish: remove Claude Code, Codex→Coding Agent rename, branding, coding-agent parity + small-model harness

purpled0be56658588
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3a67ac8e..9e7e32c4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -89,10 +89,10 @@ importers:
version: 9.39.4
'@tauri-apps/api':
specifier: ^2.10.1
- version: 2.11.0
+ version: 2.10.1
'@tauri-apps/cli':
specifier: ^2.10.1
- version: 2.11.2
+ version: 2.10.1
'@types/node':
specifier: ^24.12.0
version: 24.12.4
@@ -597,77 +597,77 @@ packages:
peerDependencies:
vite: ^5.2.0 || ^6 || ^7 || ^8
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-7CinYODhky9lmO23xHnUFv0Xt43fbtWMyxZcLcRBlFkcgXKuEirBvHpmtJ89YMhyeGcq20Wuc47Fa4XjyniywA==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-hKL/jWf293UDSUN09rR69hrToyIXBb8CjGaWC7gfinvnQrBVvnLr08FeFi38gxtugAVyVcTa5/FD/Xnkb1siBw==}
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-+4UZzLt+eOAEQCwgd+TqKgyUJMrvx+BgdXLLaqJYmPqzP+nE6YZr/hY6CWLYGQb8jFn99jEkmC6uA3tNvamA1w==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-Z2OjCXiZ+fbYZy7PmP3WRnOpM9+Fy+oonKDEmUE6MwN4IGaYqgceTjwHucc/kEEYZos5GICve35f7ZiizgqEnQ==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-VjYYtZUPqDMLutSfJEyxFE3Bz+DPi7c8wC3imckgvciLDZLq4qwKJxBicg0BXGhXjJsl8vKWgWRFNMPELQ+Xyg==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-V/irQVvjPMGOTQqNj55PnQPVuH4VJP8vZCN7ajnj+ZS8Kom1tEM2hR3qbbIRoS3dBKs5mbG8yg1WC+97dq17Pw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-yMemD6f4i95AQriS8EazyOFzbE34yjnP16i3IOzpHGQvBoy2DjypFMFBq0NtPuITURv/cOGguRtHR5d79/9CSA==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-Hyzwsb4VnCWKGfTw+wSt15Z2pLw2f0JdFBfq2vHBOBhvg7oi6uhKiF87hmbXOBXUZaGkyRDkCHsdzJcIfoJC2w==}
engines: {node: '>= 10'}
cpu: [arm]
os: [linux]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-cgI91D2wL8GSgoWwZXDqt+DwnuZCP2/bz03QAE4TrhgAKIsrB4hX26W/H1EONPUUNkqrsgeCD0wU6pcNjV/5kw==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-OyOYs2t5GkBIvyWjA1+h4CZxTcdz1OZPCWAPz5DYEfB0cnWHERTnQ/SLayQzncrT0kwRoSfSz9KxenkyJoTelA==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-X1rm0BERqAAggtYTESSgXrS3sz4Sb/OiPiz54UqISlXW+GkR3vNIGnsy/lejNmoXGVqri3Q53BCfQiclOIyRPw==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-MIj78PDDGjkg3NqGptDOGgfXks7SYJwhiMh8SBoZS+vfdz7yP5jN18bNaLnDhsVIPARcAhE1TlsZe/8Yxo2zqg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-usbMLJbT3KtkOrBMDVeGYNM35aTHXx38SJSzTMSqqjeUIOQ+iVPjb2yAGNAE+KqmBbAx4FOFIyMeKXx2M/JKGQ==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-X0lvOVUg8PCVaoEtEAnpxmnkwlE1gcMDTqfhbefICKDnOTJ5Est3qL0SrWxizDackIOKBcvtpejrSiVpuJI1kw==}
engines: {node: '>= 10'}
cpu: [riscv64]
os: [linux]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-Ru4gwJKPG0ctVGchRGpRup4Y4lW2SSfFnrbQcyHhCliKy4g8Qz97TrUgCur4CbWyAgKxvGh3SjrkA0LDYzDGiw==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-2/12bEzsJS9fAKybxgicCDFxYD1WEI9kO+tlDwX5znWG2GwMBaiWcmhGlZ8fi+DMe9CXlcVarMTYc0L3REIRxw==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-eUm7T6clN1MMmNSRQ9gaWsQdyehQx2Gmn5hht/QUlqZQI/qcP2OJK5dnaxqwFzCr2HdsEo9ydxaqcS1oJzMvUw==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-Y8J0ZzswPz50UcGOFuXGEMrxbjwKSPgXftx5qnkuMs2rmwQB5ssvLb6tn54wDSYxe7S6vlLob9vt0VKuNOaCIQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-HeeZW80jU+gVTOEX4X/hC6NVSAdDVXajwP5fxIZ/3z9WvUC7qrudX2GMTilYq6Dg0e0sk0XgsAJD1hZ5wPBXUA==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-iSt5B86jHYAPJa/IlYw++SXtFPGnWtFJriHn7X0NFBVunF6zu9+/zOn8OgqIWSl8RgzhLGXQEEtGBdR4wzpVgg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-YhjQNZcXfbkCLyazSv1nPnJ9iRFE1wm6kc51FDbU10/Dk09io+6PAGMLjkxnX2GdM0qMnDmTjstY8mTDVvtKeA==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-gXyxgEzsFegmnWywYU5pEBURkcFN/Oo45EAwvZrHMh+zUSEAvO5E8TXsgPADYm31d1u7OQU3O3HsYfVBf2moHw==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-d2JchlFIpZevZVReyqhQOekJmb1UH3rhZ5VX6sH3ty9ETE0TKQavpihvoScUXfKKpW6HZC0MrFGRU0ZtD+w3gA==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-6Cn7YpPFwzChy0ERz6djKEmUehWrYlM+xTaNzGPgZocw3BD7OfwfWHKVWxXzdjEW2KfKkHddfdxK1XXTYqBRLg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
- '@tauri-apps/[email protected]':
- resolution: {integrity: sha512-bk3HemqvGRoy+5D/dVMUQHKMYLglD0jVnMm/0iGMH6ufZ+p8r14m6BpIixwij3PBvZdvORUp1YifTD8QxVZ1Nw==}
+ '@tauri-apps/[email protected]':
+ resolution: {integrity: sha512-jQNGF/5quwORdZSSLtTluyKQ+o6SMa/AUICfhf4egCGFdMHqWssApVgYSbg+jmrZoc8e1DscNvjTnXtlHLS11g==}
engines: {node: '>= 10'}
hasBin: true
@@ -2669,62 +2669,62 @@ snapshots:
tailwindcss: 4.3.0
vite: 8.0.14(@types/[email protected])([email protected])
- '@tauri-apps/[email protected]': {}
+ '@tauri-apps/[email protected]': {}
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optional: true
- '@tauri-apps/[email protected]':
+ '@tauri-apps/[email protected]':
optionalDependencies:
- '@tauri-apps/cli-darwin-arm64': 2.11.2
- '@tauri-apps/cli-darwin-x64': 2.11.2
- '@tauri-apps/cli-linux-arm-gnueabihf': 2.11.2
- '@tauri-apps/cli-linux-arm64-gnu': 2.11.2
- '@tauri-apps/cli-linux-arm64-musl': 2.11.2
- '@tauri-apps/cli-linux-riscv64-gnu': 2.11.2
- '@tauri-apps/cli-linux-x64-gnu': 2.11.2
- '@tauri-apps/cli-linux-x64-musl': 2.11.2
- '@tauri-apps/cli-win32-arm64-msvc': 2.11.2
- '@tauri-apps/cli-win32-ia32-msvc': 2.11.2
- '@tauri-apps/cli-win32-x64-msvc': 2.11.2
+ '@tauri-apps/cli-darwin-arm64': 2.10.1
+ '@tauri-apps/cli-darwin-x64': 2.10.1
+ '@tauri-apps/cli-linux-arm-gnueabihf': 2.10.1
+ '@tauri-apps/cli-linux-arm64-gnu': 2.10.1
+ '@tauri-apps/cli-linux-arm64-musl': 2.10.1
+ '@tauri-apps/cli-linux-riscv64-gnu': 2.10.1
+ '@tauri-apps/cli-linux-x64-gnu': 2.10.1
+ '@tauri-apps/cli-linux-x64-musl': 2.10.1
+ '@tauri-apps/cli-win32-arm64-msvc': 2.10.1
+ '@tauri-apps/cli-win32-ia32-msvc': 2.10.1
+ '@tauri-apps/cli-win32-x64-msvc': 2.10.1
'@tauri-apps/[email protected]':
dependencies:
- '@tauri-apps/api': 2.11.0
+ '@tauri-apps/api': 2.10.1
'@tauri-apps/[email protected]':
dependencies:
- '@tauri-apps/api': 2.11.0
+ '@tauri-apps/api': 2.10.1
'@tweenjs/[email protected]': {}
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 78e4464d..b6fc1ce4 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -2025,7 +2025,7 @@ dependencies = [
"libc",
"percent-encoding",
"pin-project-lite",
- "socket2 0.6.3",
+ "socket2 0.5.10",
"system-configuration",
"tokio",
"tower-service",
@@ -2045,7 +2045,7 @@ dependencies = [
"js-sys",
"log",
"wasm-bindgen",
- "windows-core 0.62.2",
+ "windows-core 0.57.0",
]
[[package]]
@@ -6376,19 +6376,6 @@ dependencies = [
"windows-strings 0.4.2",
]
-[[package]]
-name = "windows-core"
-version = "0.62.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
-dependencies = [
- "windows-implement 0.60.2",
- "windows-interface 0.59.3",
- "windows-link 0.2.1",
- "windows-result 0.4.1",
- "windows-strings 0.5.1",
-]
-
[[package]]
name = "windows-future"
version = "0.2.1"
diff --git a/src-tauri/src/commands/install.rs b/src-tauri/src/commands/install.rs
index e458906d..da683688 100644
--- a/src-tauri/src/commands/install.rs
+++ b/src-tauri/src/commands/install.rs
@@ -1014,6 +1014,98 @@ pub fn windows_git_install_hint(state: &WindowsGitState) -> Option<String> {
}
}
+/// Git availability for the Codex coding view (v2.5.0). The coding agent shells
+/// out to `git` for `git_status`/`git_diff`/`git_commit`/`git_log`, so if git
+/// isn't on PATH those tools fail with confusing errors. The Codex view calls
+/// this on open and, when git is missing, shows a minimal "Install Git" banner.
+#[derive(Debug, Clone, serde::Serialize)]
+pub struct GitStatus {
+ /// `git --version` ran successfully.
+ pub installed: bool,
+ /// Windows: Git-for-Windows (clone-safe). Other OS: same as `installed`.
+ pub native: bool,
+ /// The raw `git --version` line, when available.
+ pub version: Option<String>,
+ /// User-facing hint when missing / non-native; `None` when all good.
+ pub hint: Option<String>,
+ /// Platform-correct git download page for the install button.
+ pub download_url: String,
+}
+
+/// Run `git --version` (no console window on Windows) and return the trimmed
+/// stdout line, or `None` if git is missing / failed to run.
+fn git_version_string() -> Option<String> {
+ let mut cmd = Command::new("git");
+ cmd.arg("--version");
+ #[cfg(target_os = "windows")]
+ {
+ cmd.creation_flags(CREATE_NO_WINDOW);
+ }
+ match cmd.output() {
+ Ok(o) if o.status.success() => {
+ let s = String::from_utf8_lossy(&o.stdout).trim().to_string();
+ (!s.is_empty()).then_some(s)
+ }
+ _ => None,
+ }
+}
+
+/// Platform-correct git download page.
+fn git_download_url() -> &'static str {
+ #[cfg(target_os = "windows")]
+ {
+ "https://git-scm.com/download/win"
+ }
+ #[cfg(target_os = "macos")]
+ {
+ "https://git-scm.com/download/mac"
+ }
+ #[cfg(all(not(target_os = "windows"), not(target_os = "macos")))]
+ {
+ "https://git-scm.com/download/linux"
+ }
+}
+
+/// Cross-platform git availability check for the Codex view's install banner.
+#[tauri::command]
+pub fn check_git_installed() -> GitStatus {
+ let download_url = git_download_url().to_string();
+ let version = git_version_string();
+
+ #[cfg(target_os = "windows")]
+ {
+ let state = windows_git_probe();
+ GitStatus {
+ installed: state != WindowsGitState::Missing,
+ native: state == WindowsGitState::Native,
+ version,
+ hint: windows_git_install_hint(&state),
+ download_url,
+ }
+ }
+ #[cfg(not(target_os = "windows"))]
+ {
+ let installed = version.is_some();
+ GitStatus {
+ installed,
+ native: installed,
+ version,
+ hint: if installed {
+ None
+ } else {
+ Some(
+ "Git is not installed or not on PATH. Install it from your \
+ package manager (e.g. `sudo apt install git`, `brew install \
+ git`) or https://git-scm.com/downloads, then restart LU so the \
+ new PATH is picked up."
+ .to_string(),
+ )
+ },
+ download_url,
+ }
+ }
+}
+
/// Wait for Ollama HTTP API to respond on the default port (best-effort
/// shared startup probe used after every platform-specific install path).
fn wait_for_ollama_ready() -> bool {
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index cf7d3888..87339b52 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -121,6 +121,7 @@ fn main() {
commands::install::install_custom_node,
commands::install::install_whisper,
commands::install::install_whisper_status,
+ commands::install::check_git_installed,
// Whisper STT
commands::whisper::whisper_status,
commands::whisper::transcribe,
diff --git a/src/api/__tests__/app-wide-smoke.test.ts b/src/api/__tests__/app-wide-smoke.test.ts
index 390b6d0f..a8074dbc 100644
--- a/src/api/__tests__/app-wide-smoke.test.ts
+++ b/src/api/__tests__/app-wide-smoke.test.ts
@@ -182,7 +182,7 @@ describe('Video bundles → strategy pipeline', () => {
// ── Chat mode system ────────────────────────────────────────────────────
describe('Chat mode system', () => {
- const validModes = ['lu', 'codex', 'openclaw', 'claude-code', 'remote'] as const
+ const validModes = ['lu', 'codex', 'openclaw', 'remote'] as const
it('all modes are strings (not undefined)', () => {
for (const mode of validModes) {
diff --git a/src/api/agent-context.ts b/src/api/agent-context.ts
index 0e2e5f7f..964c3afb 100644
--- a/src/api/agent-context.ts
+++ b/src/api/agent-context.ts
@@ -6,7 +6,7 @@
* public args shape or polluting the tool JSON schema the model sees.
*
* How it flows:
- * 1. useAgentChat / useCodex / useClaudeCode → setActiveChatId(convId)
+ * 1. useAgentChat / useCodex → setActiveChatId(convId)
* at the start of their agent loop.
* 2. Tool executors in `src/api/mcp/builtin-tools.ts` → backendCall
* includes `{ chatId: getActiveChatId() }` in the request body.
diff --git a/src/api/agents/partial-args-accumulator.ts b/src/api/agents/partial-args-accumulator.ts
index 48c05507..c2029180 100644
--- a/src/api/agents/partial-args-accumulator.ts
+++ b/src/api/agents/partial-args-accumulator.ts
@@ -4,8 +4,8 @@
* Providers that stream tool-call arguments (OpenAI via
* choice.delta.tool_calls[].function.arguments, Anthropic via
* input_json_delta) emit JSON in fragments. To render "args as they
- * stream" in the UI — the same experience Claude Code ships — we need a
- * cheap best-effort parser that takes the accumulated string so far and
+ * stream" in the UI — the same experience leading coding agents ship — we
+ * need a cheap best-effort parser that takes the accumulated string so far and
* returns a partial object.
*
* Strategy:
diff --git a/src/api/backend.ts b/src/api/backend.ts
index c1727070..e060db99 100644
--- a/src/api/backend.ts
+++ b/src/api/backend.ts
@@ -250,13 +250,6 @@ export async function backendCall<T = any>(
start_tunnel: { path: "/local-api/start-tunnel", method: "POST" },
stop_tunnel: { path: "/local-api/stop-tunnel", method: "POST" },
tunnel_status: { path: "/local-api/tunnel-status" },
- // Claude Code
- detect_claude_code: { path: "/local-api/detect-claude-code" },
- install_claude_code: { path: "/local-api/install-claude-code", method: "POST" },
- install_claude_code_status: { path: "/local-api/install-claude-code-status" },
- start_claude_code: { path: "/local-api/start-claude-code", method: "POST" },
- stop_claude_code: { path: "/local-api/stop-claude-code", method: "POST" },
- send_claude_code_input: { path: "/local-api/send-claude-code-input", method: "POST" },
// Agent tools (Phase 1 — new commands)
shell_execute: { path: "/local-api/shell-execute", method: "POST" },
fs_read: { path: "/local-api/fs-read", method: "POST" },
@@ -475,3 +468,25 @@ export async function openExternal(url: string): Promise<void> {
window.open(url, '_blank')
}
}
+
+/** Git availability for the Codex coding view (v2.5.0). */
+export interface GitStatus {
+ installed: boolean
+ native: boolean
+ version?: string | null
+ hint?: string | null
+ download_url: string
+}
+
+/**
+ * Check whether `git` is available so the Codex view can show an install
+ * banner when it's missing. In a plain browser (dev without Tauri) we assume
+ * git is present so the banner never shows during web-only development.
+ */
+export async function checkGitInstalled(): Promise<GitStatus> {
+ if (!isTauri()) {
+ return { installed: true, native: true, download_url: 'https://git-scm.com/downloads' }
+ }
+ const invoke = await getInvoke()
+ return (await invoke('check_git_installed')) as GitStatus
+}
diff --git a/src/components/chat/AgentWorkspaceDialog.tsx b/src/components/chat/AgentWorkspaceDialog.tsx
index 7d051595..54b4d240 100644
--- a/src/components/chat/AgentWorkspaceDialog.tsx
+++ b/src/components/chat/AgentWorkspaceDialog.tsx
@@ -147,7 +147,7 @@ export function AgentWorkspaceDialog({
<WorkspaceOption
icon={<Folder size={16} className="text-amber-500" />}
title={picking ? 'Opening picker…' : 'Pick a folder…'}
- body="Choose a real directory. The agent edits files in there directly — like Codex."
+ body="Choose a real directory. The agent edits files in there directly — like the Coding Agent."
onClick={handlePick}
disabled={picking}
/>
diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx
index f6a9b988..83dec105 100644
--- a/src/components/chat/ChatInput.tsx
+++ b/src/components/chat/ChatInput.tsx
@@ -187,7 +187,7 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp
onChange={(e) => setInput(e.target.value)}
onKeyDown={handleKeyDown}
onPaste={handlePaste}
- placeholder={disabled ? "Claude Code not installed" : isDragOver ? "Drop images here..." : isTranscribing ? "Transcribing..." : isVoiceRecording ? "Recording..." : "Message..."}
+ placeholder={disabled ? "Unavailable" : isDragOver ? "Drop images here..." : isTranscribing ? "Transcribing..." : isVoiceRecording ? "Recording..." : "Message..."}
disabled={disabled}
rows={1}
className="flex-1 bg-transparent resize-none text-gray-800 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-600 focus:outline-none text-[0.75rem] leading-relaxed max-h-[200px] disabled:opacity-50 scrollbar-thin"
diff --git a/src/components/chat/ChatModeTabs.tsx b/src/components/chat/ChatModeTabs.tsx
index de8fc30e..f9ac8012 100644
--- a/src/components/chat/ChatModeTabs.tsx
+++ b/src/components/chat/ChatModeTabs.tsx
@@ -1,11 +1,11 @@
-import { MessageSquare, Code, Terminal } from 'lucide-react'
+import { MessageSquare, Code } from 'lucide-react'
import { useCodexStore } from '../../stores/codexStore'
import type { ChatMode } from '../../types/codex'
const TABS: { mode: ChatMode; label: string; icon: typeof Code; disabled?: boolean; tag?: string }[] = [
{ mode: 'lu', label: 'LU', icon: MessageSquare },
- { mode: 'codex', label: 'Codex', icon: Code },
- { mode: 'claude-code', label: 'Claude Code', icon: Terminal, tag: 'Ollama 0.14+' },
+ // 'codex' is the internal mode id; the user-facing label is "Code".
+ { mode: 'codex', label: 'Code', icon: Code },
]
export function ChatModeTabs() {
diff --git a/src/components/chat/ChatView.tsx b/src/components/chat/ChatView.tsx
index b2897001..ca761833 100644
--- a/src/components/chat/ChatView.tsx
+++ b/src/components/chat/ChatView.tsx
@@ -25,7 +25,6 @@ import { exportConversation } from '../../lib/chat-export'
import { PermissionOverrideBar } from './PermissionOverrideBar'
import { RealtimeCounter } from './RealtimeCounter'
import { CodexView } from './CodexView'
-import { ClaudeCodeView } from './ClaudeCodeView'
import { useCodexStore } from '../../stores/codexStore'
import { useRemoteStore } from '../../stores/remoteStore'
@@ -164,8 +163,6 @@ export function ChatView() {
<div className="flex-1 flex flex-col min-w-0 relative">
{chatMode === 'codex' ? (
<CodexView />
- ) : chatMode === 'claude-code' ? (
- <ClaudeCodeView />
) : (<>
{/* Top bar — compact (LU mode) */}
<div className="flex items-center gap-1.5 px-2 pt-0.5">
diff --git a/src/components/chat/ClaudeCodeView.tsx b/src/components/chat/ClaudeCodeView.tsx
deleted file mode 100644
index e3d12278..00000000
--- a/src/components/chat/ClaudeCodeView.tsx
+++ /dev/null
@@ -1,323 +0,0 @@
-import { useClaudeCode } from '../../hooks/useClaudeCode'
-import { useClaudeCodeStore } from '../../stores/claudeCodeStore'
-import { useChatStore } from '../../stores/chatStore'
-import { useSettingsStore } from '../../stores/settingsStore'
-import { ChatInput } from './ChatInput'
-import { ToolCallBlock } from './ToolCallBlock'
-import { ThinkingBlock } from './ThinkingBlock'
-import { MarkdownRenderer } from './MarkdownRenderer'
-import { TokenCounter } from './TokenCounter'
-import { RealtimeCounter } from './RealtimeCounter'
-import { PluginsDropdown } from './PluginsDropdown'
-import { FileTree } from './FileTree'
-import { User, Terminal, Shield, ShieldCheck, AlertTriangle, AlertCircle } from 'lucide-react'
-import { useEffect, useRef, useState } from 'react'
-import { backendCall } from '../../api/backend'
-import { CLAUDE_CODE_RECOMMENDED_MODELS } from '../../stores/claudeCodeStore'
-import { useModelStore } from '../../stores/modelStore'
-import { isClaudeCodeCompatible } from '../../lib/model-compatibility'
-
-export function ClaudeCodeView() {
- const { sendPrompt, stopSession, approvePermission, denyPermission, isRunning } = useClaudeCode()
- const activeConversationId = useChatStore((s) => s.activeConversationId)
- const conversations = useChatStore((s) => s.conversations)
- const session = useClaudeCodeStore((s) => activeConversationId ? s.sessions[activeConversationId] : undefined)
- const installed = useClaudeCodeStore((s) => s.installed)
- const version = useClaudeCodeStore((s) => s.version)
- const workingDirectory = useClaudeCodeStore((s) => s.workingDirectory)
- const claudeCodeModel = useSettingsStore((s) => s.settings.claudeCodeModel)
- const scrollRef = useRef<HTMLDivElement>(null)
-
- const activeModel = useModelStore((s) => s.activeModel)
- const modelCompatible = isClaudeCodeCompatible(claudeCodeModel || activeModel)
-
- const conversation = conversations.find(c => c.id === activeConversationId)
- const messages = conversation?.messages || []
-
- // Auto-scroll on new messages
- useEffect(() => {
- if (scrollRef.current) {
- scrollRef.current.scrollTop = scrollRef.current.scrollHeight
- }
- }, [messages, session?.events])
-
- // Detect Claude Code on mount
- useEffect(() => {
- detectClaudeCode()
- }, [])
-
- async function detectClaudeCode() {
- try {
- const result = await backendCall<{ installed: boolean; version: string; path: string }>('detect_claude_code')
- useClaudeCodeStore.getState().setInstalled(result.installed, result.version, result.path)
- } catch {
- // Not in Tauri mode or detection failed
- }
- }
-
- const isWaitingPermission = session?.status === 'waiting_permission'
-
- return (
- <div className="flex-1 flex overflow-hidden">
- {/* Main panel */}
- <div className="flex-1 flex flex-col min-w-0 relative">
- {/* Header */}
- <div className="flex items-center gap-1.5 px-3 py-1 border-b border-gray-200 dark:border-white/[0.04]">
- <Terminal size={11} className="text-gray-400" />
- <span className="text-[0.7rem] text-gray-700 dark:text-gray-300 font-medium">Claude Code</span>
- {claudeCodeModel && (
- <span className="text-[0.55rem] text-gray-500">{claudeCodeModel}</span>
- )}
- <div className="flex-1" />
- {installed && version && (
- <span className="text-[0.55rem] text-gray-500">{version}</span>
- )}
- <PluginsDropdown />
- <TokenCounter />
- </div>
-
- {/* Model compatibility warning */}
- {installed && !modelCompatible && (
- <div className="mx-3 mt-1.5 px-2.5 py-1.5 rounded-md bg-gray-100 dark:bg-white/[0.04] border border-gray-200 dark:border-white/[0.06] flex items-center gap-2">
- <AlertCircle size={12} className="text-gray-400 shrink-0" />
- <span className="text-[0.65rem] text-gray-600 dark:text-gray-400">
- {claudeCodeModel || activeModel || 'No model selected'} may not support tool calling. Recommended: GLM 5.1, Qwen 3.5 Coder, Hermes 3.
- </span>
- </div>
- )}
-
- {/* Ollama requirement — subtle, only on empty state */}
- {installed && messages.length === 0 && (
- <div className="mx-3 mt-1 px-2.5 py-1 flex items-center gap-1.5">
- <span className="text-[0.6rem] text-gray-500">
- Requires Ollama 0.14+ for local Anthropic API compatibility.
- </span>
- </div>
- )}
-
- {/* Messages */}
- <div ref={scrollRef} className="flex-1 overflow-y-auto scrollbar-thin">
- {!installed ? (
- // Not installed state
- <ClaudeCodeInstallPrompt onDetect={detectClaudeCode} />
- ) : messages.length === 0 ? (
- // Empty state — clean, professional
- <div className="flex flex-col items-center justify-center h-full text-center px-6">
- <Terminal size={28} className="text-gray-300 dark:text-gray-600 mb-3" />
- <p className="text-[0.85rem] text-gray-700 dark:text-gray-300 font-medium">Claude Code</p>
- <p className="text-[0.7rem] text-gray-500 dark:text-gray-500 mt-1 max-w-[340px] leading-relaxed">
- Run the official Claude Code agent locally. File editing, shell commands, code search — all on your machine.
- </p>
- {!workingDirectory && (
- <p className="text-[0.65rem] text-gray-400 mt-3">
- Set a working directory in the file tree panel to get started.
- </p>
- )}
- {!claudeCodeModel && (
- <div className="mt-4">
- <p className="text-[0.6rem] text-gray-500 mb-2">Recommended models</p>
- <div className="flex flex-wrap gap-1.5 justify-center max-w-[320px]">
- {CLAUDE_CODE_RECOMMENDED_MODELS.slice(0, 4).map(m => (
- <button
- key={m.name}
- onClick={() => useSettingsStore.getState().updateSettings({ claudeCodeModel: m.name })}
- className="text-[0.6rem] px-2.5 py-1 rounded-md bg-gray-100 dark:bg-white/[0.05] text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-white/[0.08] border border-gray-200 dark:border-white/[0.06] transition-colors"
- title={m.reason}
- >
- {m.label}
- </button>
- ))}
- </div>
- </div>
- )}
- </div>
- ) : (
- // Message list
- <div className="py-1">
- {messages.map((msg) => (
- <div
- key={msg.id}
- className={`flex gap-2 px-3 py-1 ${msg.role === 'user' ? 'flex-row-reverse' : ''}`}
- >
- <div className={`w-5 h-5 rounded flex items-center justify-center shrink-0 ${
- msg.role === 'user'
- ? 'bg-gray-100 dark:bg-white/8'
- : 'bg-purple-500/10'
- }`}>
- {msg.role === 'user'
- ? <User size={9} className="text-gray-400" />
- : <Terminal size={9} className="text-purple-400" />
- }
- </div>
- <div className="max-w-[85%] space-y-0.5">
- {/* Thinking */}
- {msg.role === 'assistant' && msg.thinking && (
- <ThinkingBlock thinking={msg.thinking} />
- )}
- {/* Tool call blocks */}
- {msg.role === 'assistant' && msg.agentBlocks && msg.agentBlocks.length > 0 && (
- <div className="space-y-0">
- {msg.agentBlocks
- .filter(b => b.phase === 'tool_call' && b.toolCall)
- .map(block => (
- <ToolCallBlock key={block.id} toolCall={block.toolCall!} />
- ))}
- </div>
- )}
- {/* Text content */}
- {msg.content && (
- <div className={`rounded-lg px-2.5 py-1.5 ${
- msg.role === 'user'
- ? 'bg-gray-100 dark:bg-white/[0.06] border border-gray-200 dark:border-white/[0.08]'
- : 'bg-white dark:bg-white/[0.02] border border-purple-500/10 dark:border-purple-500/10'
- }`}>
- <div className="text-[0.75rem] leading-relaxed">
- {msg.role === 'user' ? (
- <p className="text-gray-800 dark:text-gray-200 whitespace-pre-wrap">{msg.content}</p>
- ) : (
- <MarkdownRenderer content={msg.content} />
- )}
- </div>
- </div>
- )}
- </div>
- </div>
- ))}
-
- {/* Permission approval bar */}
- {isWaitingPermission && (
- <div className="mx-3 my-2 p-2 rounded-lg bg-amber-500/10 border border-amber-500/20 flex items-center gap-2">
- <Shield size={12} className="text-amber-400 shrink-0" />
- <span className="text-[0.65rem] text-amber-300 flex-1">
- Claude Code is requesting permission to proceed.
- </span>
- <button
- onClick={approvePermission}
- className="text-[0.55rem] px-2 py-0.5 rounded bg-green-500/20 text-green-400 hover:bg-green-500/30 transition-colors flex items-center gap-0.5"
- >
- <ShieldCheck size={9} />
- Approve
- </button>
- <button
- onClick={denyPermission}
- className="text-[0.55rem] px-2 py-0.5 rounded bg-red-500/20 text-red-400 hover:bg-red-500/30 transition-colors"
- >
- Deny
- </button>
- </div>
- )}
- </div>
- )}
- </div>
-
- {/* Realtime counter */}
- <RealtimeCounter isRunning={isRunning} />
-
- {/* Input */}
- <ChatInput
- onSend={(content) => sendPrompt(content)}
- onStop={stopSession}
- isGenerating={isRunning}
- disabled={!installed}
- />
- </div>
-
- {/* Right sidebar: File Tree */}
- <div className="w-48 shrink-0">
- <FileTree />
- </div>
- </div>
- )
-}
-
-// ── Install Prompt Component ──────────────────────────────────────────────
-
-function ClaudeCodeInstallPrompt({ onDetect }: { onDetect: () => void }) {
- const [installing, setInstalling] = useState(false)
- const [installLog, setInstallLog] = useState<string[]>([])
- const [error, setError] = useState('')
-
- async function handleInstall(method: 'npm' | 'native') {
- setInstalling(true)
- setError('')
- setInstallLog(['Starting installation...'])
-
- try {
- await backendCall('install_claude_code', { method })
-
- // Poll status
- const poll = setInterval(async () => {
- try {
- const status = await backendCall<{ status: string; logs: string[] }>('install_claude_code_status')
- setInstallLog(status.logs)
-
- if (status.status === 'complete') {
- clearInterval(poll)
- setInstalling(false)
- onDetect() // Re-detect
- } else if (status.status === 'error') {
- clearInterval(poll)
- setInstalling(false)
- setError(status.logs[status.logs.length - 1] || 'Installation failed')
- }
- } catch {
- clearInterval(poll)
- setInstalling(false)
- }
- }, 1000)
- } catch (err) {
- setInstalling(false)
- setError((err as Error).message)
- }
- }
-
- return (
- <div className="flex flex-col items-center justify-center h-full text-center px-6">
- <Terminal size={28} className="text-gray-300 dark:text-gray-600 mb-3" />
- <p className="text-[0.85rem] text-gray-700 dark:text-gray-300 font-medium mb-1">Claude Code not installed</p>
- <p className="text-[0.7rem] text-gray-500 max-w-[340px] mb-4 leading-relaxed">
- Install the Claude Code CLI to use this feature. Runs locally with Ollama 0.14+.
- </p>
-
- {!installing ? (
- <div className="flex gap-2">
- <button
- onClick={() => handleInstall('native')}
- className="text-[0.65rem] px-4 py-1.5 rounded-md bg-gray-800 dark:bg-white/10 text-white dark:text-gray-200 hover:bg-gray-700 dark:hover:bg-white/15 transition-colors border border-gray-700 dark:border-white/10"
- >
- Install (Native)
- </button>
- <button
- onClick={() => handleInstall('npm')}
- className="text-[0.65rem] px-4 py-1.5 rounded-md bg-gray-100 dark:bg-white/[0.04] text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-white/[0.08] transition-colors border border-gray-200 dark:border-white/[0.06]"
- >
- Install via npm
- </button>
- </div>
- ) : (
- <div className="w-full max-w-[320px]">
- <div className="text-[0.5rem] text-gray-500 space-y-0.5 text-left bg-black/20 rounded p-2 max-h-[120px] overflow-y-auto">
- {installLog.map((log, i) => (
- <p key={i}>{log}</p>
- ))}
- </div>
- </div>
- )}
-
- {error && (
- <div className="mt-2 flex items-center gap-1 text-[0.55rem] text-red-400">
- <AlertTriangle size={10} />
- <span>{error}</span>
- </div>
- )}
-
- <button
- onClick={onDetect}
- className="mt-3 text-[0.5rem] text-gray-600 hover:text-gray-400 transition-colors"
- >
- Already installed? Click to re-detect
- </button>
- </div>
- )
-}
-
diff --git a/src/components/chat/CodexView.tsx b/src/components/chat/CodexView.tsx
index f86e5a41..1804ef99 100644
--- a/src/components/chat/CodexView.tsx
+++ b/src/components/chat/CodexView.tsx
@@ -12,8 +12,9 @@ import { PluginsDropdown } from './PluginsDropdown'
import { TypingIndicator } from './TypingIndicator'
import { useSettingsStore } from '../../stores/settingsStore'
import { StagedChangesPanel } from './StagedChangesPanel'
-import { User, Code, Brain, Eye } from 'lucide-react'
-import { useEffect, useRef } from 'react'
+import { User, Code, Brain, Eye, GitBranch, Download, RefreshCw } from 'lucide-react'
+import { useEffect, useRef, useState } from 'react'
+import { checkGitInstalled, openExternal, type GitStatus } from '../../api/backend'
function stripChannelTags(text: string): string {
return text
@@ -43,6 +44,25 @@ export function CodexView() {
const codexReviewMode = useSettingsStore((s) => s.settings.codexReviewMode)
const updateSettings = useSettingsStore((s) => s.updateSettings)
+ // Git availability for the Codex view (v2.5.0). Codex shells out to git for
+ // git_status/diff/commit/log; if git is missing those tools fail. Probe on
+ // open and surface a minimal install banner when it's not on PATH.
+ const [gitStatus, setGitStatus] = useState<GitStatus | null>(null)
+ const [gitChecking, setGitChecking] = useState(false)
+ useEffect(() => {
+ let cancelled = false
+ setGitChecking(true)
+ checkGitInstalled()
+ .then((s) => { if (!cancelled) setGitStatus(s) })
+ .catch(() => {})
+ .finally(() => { if (!cancelled) setGitChecking(false) })
+ return () => { cancelled = true }
+ }, [])
+ const recheckGit = () => {
+ setGitChecking(true)
+ checkGitInstalled().then(setGitStatus).catch(() => {}).finally(() => setGitChecking(false))
+ }
+
return (
<div className="flex-1 flex overflow-hidden">
{/* Main panel */}
@@ -50,7 +70,7 @@ export function CodexView() {
{/* Codex header */}
<div className="flex items-center gap-1.5 px-2 py-0.5 border-b border-gray-200 dark:border-white/[0.04]">
<Code size={9} className="text-gray-500" />
- <span className="text-[0.55rem] text-gray-600 dark:text-gray-400 font-medium">Codex</span>
+ <span className="text-[0.55rem] text-gray-600 dark:text-gray-400 font-medium">Coding Agent</span>
{/* Code-Review Mode badge (B13) — makes it impossible to miss
that the agent is read-only. The toggle itself lives in
Settings → Codex Agent; clicking the badge jumps you there
@@ -58,7 +78,7 @@ export function CodexView() {
{codexReviewMode && (
<span
className="flex items-center gap-1 px-1.5 py-0 rounded border border-amber-500/30 text-amber-500 text-[0.55rem] bg-amber-500/[0.04]"
- title="Code-Review Mode is active. Codex will inspect the codebase but won't write files or run commands. Disable in Settings → Codex Agent."
+ title="Code-Review Mode is active. The coding agent will inspect the codebase but won't write files or run commands. Disable in Settings → Coding Agent."
>
<Eye size={9} />
<span>Review</span>
@@ -70,6 +90,33 @@ export function CodexView() {
<PluginsDropdown />
</div>
+ {/* Git-missing banner (v2.5.0). Codex shells out to git for
+ status/diff/commit/log — without it those tools fail. Minimal,
+ dismiss-by-installing: an Install button (opens the platform git
+ download page) + a Recheck button for after the install. */}
+ {gitStatus && !gitStatus.installed && (
+ <div className="flex items-center gap-2 px-3 py-1.5 border-b border-amber-500/20 bg-amber-500/[0.06]">
+ <GitBranch size={12} className="text-amber-500 shrink-0" />
+ <span className="text-[0.6rem] text-amber-600 dark:text-amber-400/90 flex-1 leading-tight">
+ Git isn't installed. The coding agent needs it for diffs, commits and history.
+ </span>
+ <button
+ onClick={() => openExternal(gitStatus.download_url)}
+ className="flex items-center gap-1 px-2 py-0.5 rounded text-[0.6rem] font-medium bg-amber-500/15 text-amber-600 dark:text-amber-300 hover:bg-amber-500/25 border border-amber-500/30 transition-colors"
+ >
+ <Download size={11} /> Install Git
+ </button>
+ <button
+ onClick={recheckGit}
+ disabled={gitChecking}
+ title="Re-check after installing Git"
+ className="flex items-center gap-1 px-1.5 py-0.5 rounded text-[0.6rem] text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 transition-colors disabled:opacity-50"
+ >
+ <RefreshCw size={11} className={gitChecking ? 'animate-spin' : ''} />
+ </button>
+ </div>
+ )}
+
{/* Stage-and-Approve queue (B10). Renders nothing when there
are no pending changes for the active chat, so non-stage-mode
users never see it. */}
@@ -80,9 +127,9 @@ export function CodexView() {
{messages.length === 0 ? (
<div className="flex flex-col items-center justify-center h-full text-center">
<Code size={24} className="text-gray-300 dark:text-gray-700 mb-2" />
- <p className="text-[0.7rem] text-gray-500 font-medium">Codex Coding Agent</p>
+ <p className="text-[0.7rem] text-gray-500 font-medium">Coding Agent</p>
<p className="text-[0.55rem] text-gray-400 dark:text-gray-600 mt-0.5 max-w-[300px]">
- Send a coding instruction. Codex will read your codebase, write code, and run commands.
+ Send a coding instruction. The coding agent will read your codebase, write code, and run commands.
</p>
{!thread?.workingDirectory && (
<p className="text-[0.55rem] text-amber-500/70 mt-2">
diff --git a/src/components/layout/AppShell.tsx b/src/components/layout/AppShell.tsx
index 615bb4b8..208f1113 100644
--- a/src/components/layout/AppShell.tsx
+++ b/src/components/layout/AppShell.tsx
@@ -39,7 +39,7 @@ export function AppShell() {
// ── Store backup/restore: survive NSIS updates that wipe WebView2 data ──
const STORE_KEYS = [
'chat-conversations', 'chat-settings', 'chat-models', 'lu-providers',
- 'create-store', 'locally-uncensored-codex', 'locally-uncensored-claude-code',
+ 'create-store', 'locally-uncensored-codex',
'locally-uncensored-permissions', 'locally-uncensored-mcp-servers',
'locally-uncensored-agent-mode', 'locally-uncensored-memory',
'locally-uncensored-agent-workflows', 'locally-uncensored-agent',
@@ -417,7 +417,7 @@ export function AppShell() {
if (!convId) {
const title = (chat_title && chat_title.trim())
? `${chat_title} ${tagged}`
- : `Mobile Codex ${tagged}`
+ : `Mobile Coding Agent ${tagged}`
const activeModel = useModelStore.getState().activeModel || model || ''
convId = chat.createConversation(activeModel, '', 'codex')
chat.renameConversation(convId, title)
diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx
index 341f384d..6a0100b1 100644
--- a/src/components/layout/Header.tsx
+++ b/src/components/layout/Header.tsx
@@ -6,7 +6,6 @@ import { useChatStore } from '../../stores/chatStore'
import { useCompareStore } from '../../stores/compareStore'
import { useModelStore } from '../../stores/modelStore'
import { ModelSelector } from '../models/ModelSelector'
-import { LuLogo } from './LuLogo'
import { UpdateBadge } from './UpdateBadge'
import { DownloadBadge } from './DownloadBadge'
import { CreateTopControls } from '../create/CreateTopControls'
@@ -193,9 +192,16 @@ export function Header() {
useCompareStore.getState().setComparing(false)
setView('chat')
}}
- className="flex items-center gap-1.5 text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white transition"
+ className="flex items-center shrink-0 transition"
+ title="LU Studio"
>
- <LuLogo size={22} />
+ {/* Brand wordmark in the top panel (David 2026-06-02): no logo here
+ (the big mark was too large) — just "LU Studio". The logo itself
+ lives in the titlebar above. */}
+ <span className="text-sm font-semibold tracking-tight">
+ <span className="text-violet-500">LU</span>{' '}
+ <span className="text-gray-700 dark:text-gray-200">Studio</span>
+ </span>
</button>
</div>
@@ -238,7 +244,7 @@ export function Header() {
? 'bg-red-500/30 border border-red-400/60 animate-pulse'
: isModelLoaded
? 'bg-green-500/25 border border-green-400/50'
- : 'bg-red-500/20 border border-red-400/40 hover:bg-red-500/30'
+ : 'bg-gray-200 dark:bg-white/10 border border-gray-300 dark:border-white/15 hover:bg-gray-300 dark:hover:bg-white/15'
}`}
>
<span
@@ -249,7 +255,7 @@ export function Header() {
? 'left-[1px] bg-red-500'
: isModelLoaded
? 'left-[18px] bg-green-400'
- : 'left-[1px] bg-red-400'
+ : 'left-[1px] bg-gray-400 dark:bg-gray-500'
}`}
>
{busy ? (
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx
index 35a6a036..ca23ddce 100644
--- a/src/components/layout/Sidebar.tsx
+++ b/src/components/layout/Sidebar.tsx
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react'
import { motion, AnimatePresence } from 'framer-motion'
-import { Plus, Search, Trash2, Edit3, Check, X, MessageSquare, Code, Terminal, ChevronDown, Radio, Copy, RefreshCw, Square, Wifi, Globe, QrCode } from 'lucide-react'
+import { Plus, Search, Trash2, Edit3, Check, X, MessageSquare, Code, Radio, Copy, RefreshCw, Square, Wifi, Globe, QrCode } from 'lucide-react'
import { useChatStore } from '../../stores/chatStore'
import { useUIStore } from '../../stores/uiStore'
import { useModelStore } from '../../stores/modelStore'
@@ -9,12 +9,6 @@ import { useCodexStore } from '../../stores/codexStore'
import { useRemoteStore, REMOTE_DEV_MODE_ERROR } from '../../stores/remoteStore'
import { backendCall, isTauri } from '../../api/backend'
import { formatDate, truncate } from '../../lib/formatters'
-import type { ChatMode } from '../../types/codex'
-
-const CODING_MODES: { mode: ChatMode; label: string; icon: typeof Code; disabled?: boolean; tag?: string }[] = [
- { mode: 'codex', label: 'Codex', icon: Code },
- { mode: 'claude-code', label: 'Claude Code', icon: Terminal, disabled: true, tag: 'soon' },
-]
export function Sidebar() {
const { conversations, activeConversationId, createConversation, deleteConversation, renameConversation, setActiveConversation } = useChatStore()
@@ -33,12 +27,11 @@ export function Sidebar() {
const [search, setSearch] = useState('')
const [editingId, setEditingId] = useState<string | null>(null)
const [editTitle, setEditTitle] = useState('')
- const [codingDropdownOpen, setCodingDropdownOpen] = useState(false)
const [countdown, setCountdown] = useState('')
const [dispatchPicker, setDispatchPicker] = useState(false)
const [qrModalOpen, setQrModalOpen] = useState(false)
- const isCodingMode = chatMode === 'codex' || chatMode === 'claude-code'
+ const isCodingMode = chatMode === 'codex'
const isRemoteMode = chatMode === 'remote'
// Filter conversations by current mode
@@ -216,81 +209,50 @@ export function Sidebar() {
exit={{ width: 0, opacity: 0 }}
transition={{ duration: 0.15 }}
>
- {/* Mode Tabs (Chat | Code | Remote) */}
+ {/* Mode Tabs (Chat | Code | Remote) — icon-only, like uselu.
+ Labels live in title/aria-label for accessibility. */}
<div className="flex items-center gap-0.5 px-2 pt-2 pb-1">
{/* Chat tab */}
<button
- onClick={() => { setChatMode('lu'); setActiveConversation(null); setView('chat'); setCodingDropdownOpen(false); setDispatchPicker(false) }}
- className={`flex items-center gap-1 px-2 py-1 rounded text-[0.6rem] font-medium transition-all flex-1 justify-center ${
+ onClick={() => { setChatMode('lu'); setActiveConversation(null); setView('chat'); setDispatchPicker(false) }}
+ title="Chat"
+ aria-label="Chat"
+ className={`flex items-center justify-center px-2 py-1 rounded font-medium transition-all flex-1 ${
!isCodingMode && !isRemoteMode
? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white border border-gray-300 dark:border-white/15'
: 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 border border-transparent'
}`}
>
- <MessageSquare size={9} />
- <span>Chat</span>
+ <MessageSquare size={11} />
</button>
- {/* Code tab — always opens dropdown */}
- <div className="relative flex-1">
- <button
- onClick={() => { setCodingDropdownOpen(!codingDropdownOpen); setDispatchPicker(false) }}
- className={`flex items-center gap-1 px-2 py-1 rounded text-[0.6rem] font-medium transition-all w-full justify-center ${
- isCodingMode
- ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white border border-gray-300 dark:border-white/15'
- : 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 border border-transparent'
- }`}
- >
- <Code size={9} />
- <span>Code</span>
- <ChevronDown size={7} className={`opacity-40 transition-transform ${codingDropdownOpen ? 'rotate-180' : ''}`} />
- </button>
-
- {/* Dropdown — glass effect, compact */}
- {codingDropdownOpen && (
- <>
- <div className="fixed inset-0 z-40" onClick={() => setCodingDropdownOpen(false)} />
- <div className="absolute left-0 top-full mt-0.5 z-50 rounded-lg bg-white/90 dark:bg-white/[0.06] backdrop-blur-xl border border-gray-200/50 dark:border-white/[0.08] shadow-lg overflow-hidden whitespace-nowrap min-w-[120px]">
- {CODING_MODES.map(({ mode, label, icon: Icon, disabled, tag }) => (
- <button
- key={mode}
- onClick={() => {
- if (disabled) return
- setChatMode(mode)
- setActiveConversation(null)
- setView('chat')
- setCodingDropdownOpen(false)
- }}
- className={`flex items-center gap-1.5 w-full px-2 py-1 text-[0.55rem] transition-colors ${
- disabled
- ? 'text-gray-400/40 dark:text-gray-600/60 cursor-default'
- : chatMode === mode
- ? 'bg-gray-200/60 dark:bg-white/10 text-gray-900 dark:text-white'
- : 'text-gray-500 dark:text-gray-400 hover:bg-gray-100/60 dark:hover:bg-white/[0.06]'
- }`}
- >
- <Icon size={9} />
- <span className="relative">
- {tag ? <span className="text-[0.4rem] text-red-400/80 font-semibold tracking-wider uppercase">{tag}</span> : label}
- </span>
- </button>
- ))}
- </div>
- </>
- )}
- </div>
+ {/* Code tab — direct switch to the coding agent (no dropdown).
+ Internal mode value 'codex' is kept for storage back-compat. */}
+ <button
+ onClick={() => { setChatMode('codex'); setActiveConversation(null); setView('chat'); setDispatchPicker(false) }}
+ title="Code"
+ aria-label="Code"
+ className={`flex items-center justify-center px-2 py-1 rounded font-medium transition-all flex-1 ${
+ isCodingMode
+ ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white border border-gray-300 dark:border-white/15'
+ : 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 border border-transparent'
+ }`}
+ >
+ <Code size={11} />
+ </button>
{/* Remote tab */}
<button
- onClick={() => { setChatMode('remote'); setActiveConversation(dispatchedConversationId); setView('chat'); setCodingDropdownOpen(false) }}
- className={`flex items-center gap-1 px-2 py-1 rounded text-[0.6rem] font-medium transition-all flex-1 justify-center ${
+ onClick={() => { setChatMode('remote'); setActiveConversation(dispatchedConversationId); setView('chat') }}
+ title="Remote"
+ aria-label="Remote"
+ className={`flex items-center justify-center px-2 py-1 rounded font-medium transition-all flex-1 ${
isRemoteMode
? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white border border-gray-300 dark:border-white/15'
: 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/5 border border-transparent'
}`}
>
- <Radio size={9} />
- <span>Remote</span>
+ <Radio size={11} />
</button>
</div>
diff --git a/src/components/layout/Titlebar.tsx b/src/components/layout/Titlebar.tsx
index b17dc6b6..0a194e2e 100644
--- a/src/components/layout/Titlebar.tsx
+++ b/src/components/layout/Titlebar.tsx
@@ -52,13 +52,7 @@ export function Titlebar() {
>
{/* Left: App icon + title */}
<div data-tauri-drag-region className="flex items-center gap-1.5 pl-3">
- <LuLogo size={14} className="pointer-events-none" />
- <span
- data-tauri-drag-region
- className="text-[0.6rem] tracking-widest font-medium text-gray-400 dark:text-gray-500 uppercase pointer-events-none"
- >
- Locally Uncensored
- </span>
+ <LuLogo size={21} className="pointer-events-none" />
</div>
{/* Right: Window controls */}
diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsx
index b911aa31..404273b9 100644
--- a/src/components/settings/SettingsPage.tsx
+++ b/src/components/settings/SettingsPage.tsx
@@ -21,7 +21,6 @@ import { MCPServerSettings } from './MCPServerSettings'
import { WorkflowList } from '../agents/WorkflowList'
import { WorkflowBuilder } from '../agents/WorkflowBuilder'
import { useUpdateStore, isNewerVersion } from '../../stores/updateStore'
-import { useClaudeCodeStore, CLAUDE_CODE_RECOMMENDED_MODELS } from '../../stores/claudeCodeStore'
import { backendCall } from '../../api/backend'
import { ArrowUpCircle } from 'lucide-react'
@@ -493,79 +492,14 @@ function ComfyUISettings() {
)
}
-// ── Claude Code Settings ────────────────────────────────────────
-
-function ClaudeCodeSettings() {
- const installed = useClaudeCodeStore((s) => s.installed)
- const version = useClaudeCodeStore((s) => s.version)
- const { settings, updateSettings } = useSettingsStore()
- const [detecting, setDetecting] = useState(false)
-
- async function handleDetect() {
- setDetecting(true)
- try {
- const result = await backendCall<{ installed: boolean; version: string; path: string }>('detect_claude_code')
- useClaudeCodeStore.getState().setInstalled(result.installed, result.version, result.path)
- } catch { /* ignore */ }
- setDetecting(false)
- }
-
- return (
- <div className="space-y-3">
- {/* Status */}
- <div className="flex items-center gap-2 text-[0.65rem]">
- <span className="flex items-center gap-1">
- <span className={`w-1.5 h-1.5 rounded-full ${installed ? 'bg-green-500' : 'bg-red-500'}`} />
- <span className="text-gray-500">{installed ? `Installed (${version || 'unknown'})` : 'Not installed'}</span>
- </span>
- <button onClick={handleDetect} disabled={detecting} className="text-[0.55rem] text-gray-500 hover:text-gray-300 transition-colors">
- {detecting ? 'Detecting...' : 'Re-detect'}
- </button>
- </div>
-
- {/* Model selector */}
- <div className="space-y-1">
- <label className="text-[0.6rem] text-gray-500">Model</label>
- <select
- value={settings.claudeCodeModel}
- onChange={(e) => updateSettings({ claudeCodeModel: e.target.value })}
- className="w-full text-[0.65rem] px-2 py-1 rounded bg-white dark:bg-white/5 border border-gray-200 dark:border-white/10 text-gray-800 dark:text-gray-200"
- >
- <option value="">Auto (default)</option>
- {CLAUDE_CODE_RECOMMENDED_MODELS.map(m => (
- <option key={m.name} value={m.name}>{m.label} — {m.reason}</option>
- ))}
- </select>
- </div>
-
- {/* Auto-approve toggle */}
- <InlineToggle
- label="Auto-approve all permissions"
- enabled={settings.claudeCodeAutoApprove}
- onChange={() => updateSettings({ claudeCodeAutoApprove: !settings.claudeCodeAutoApprove })}
- icon={<Shield size={10} className="text-amber-400" />}
- />
- {settings.claudeCodeAutoApprove && (
- <p className="text-[0.5rem] text-amber-400/70 ml-4">
- Warning: This allows Claude Code to execute any tool without asking. Use with caution.
- </p>
- )}
-
- <p className="text-[0.5rem] text-gray-600">
- Requires Ollama 0.14+ for local Anthropic API compatibility.
- </p>
- </div>
- )
-}
-
-// ── Codex Agent (v2.5.0) Settings ───────────────────────────────
+// ── Coding Agent (v2.5.0) Settings ──────────────────────────────
function CodexAgentSettings() {
const { settings, updateSettings } = useSettingsStore()
return (
<div className="space-y-3">
<div className="text-[0.6rem] text-gray-500 leading-relaxed pb-1">
- v2.5.0 codex / agent capabilities ported from the companion repo. All
+ v2.5.0 coding-agent capabilities ported from the companion repo. All
local-first by default — cloud usage requires the explicit toggle below.
</div>
@@ -585,7 +519,7 @@ function CodexAgentSettings() {
placeholder="ollama::qwen-coder:32b"
className="w-full px-2 py-1 rounded bg-transparent border border-white/8 text-[0.65rem] text-gray-700 dark:text-gray-300 font-mono focus:outline-none focus:border-white/20 disabled:opacity-40"
/>
- <p className="text-[0.55rem] text-gray-500">Empty = use the active Codex model.</p>
+ <p className="text-[0.55rem] text-gray-500">Empty = use the active coding agent model.</p>
</div>
<InlineToggle
label="Allow cloud architect models"
@@ -641,7 +575,7 @@ function CodexAgentSettings() {
//
// General → Appearance · Generation · Privacy · Onboarding · Updates
// AI Backends → Providers · Model Storage · ComfyUI
-// Agent → Personas · Memory · Claude Code · Agent Permissions ·
+// Agent → Personas · Memory · Agent Permissions ·
// Agent Workflows · MCP Servers · Search Provider
// Voice & Remote → Speech · Remote Access
//
@@ -950,10 +884,6 @@ export function SettingsPage() {
<MemorySettings />
</Section>
- <Section title="Claude Code">
- <ClaudeCodeSettings />
- </Section>
-
{FEATURE_FLAGS.AGENT_MODE && (
<Section title="Agent Permissions">
<PermissionSettings />
@@ -979,7 +909,7 @@ export function SettingsPage() {
)}
{FEATURE_FLAGS.AGENT_MODE && (
- <Section title="Codex Agent (v2.5.0)">
+ <Section title="Coding Agent (v2.5.0)">
<CodexAgentSettings />
</Section>
)}
diff --git a/src/hooks/__tests__/useCodex-prompt-contract.test.ts b/src/hooks/__tests__/useCodex-prompt-contract.test.ts
index e01c7eae..529f5660 100644
--- a/src/hooks/__tests__/useCodex-prompt-contract.test.ts
+++ b/src/hooks/__tests__/useCodex-prompt-contract.test.ts
@@ -53,8 +53,8 @@ describe('Desktop CODEX_SYSTEM_PROMPT (useCodex.ts)', () => {
expect(src).toContain('Chain tool calls')
})
- it('defines the model as Codex', () => {
- expect(src).toContain('You are Codex')
+ it('defines the model as the Coding Agent', () => {
+ expect(src).toContain('You are the Coding Agent')
})
})
diff --git a/src/hooks/useClaudeCode.ts b/src/hooks/useClaudeCode.ts
deleted file mode 100644
index 723c0f7f..00000000
--- a/src/hooks/useClaudeCode.ts
+++ /dev/null
@@ -1,288 +0,0 @@
-import { useCallback, useEffect, useRef, useState } from 'react'
-import { v4 as uuid } from 'uuid'
-import { backendCall, isTauri } from '../api/backend'
-import { useClaudeCodeStore } from '../stores/claudeCodeStore'
-import { useChatStore } from '../stores/chatStore'
-import { useSettingsStore } from '../stores/settingsStore'
-import { useProviderStore } from '../stores/providerStore'
-import type { ClaudeCodeEvent } from '../stores/claudeCodeStore'
-import type { AgentBlock, AgentToolCall } from '../types/agent-mode'
-import { log } from '../lib/logger'
-
-/**
- * Hook for running Claude Code sessions.
- *
- * Unlike useCodex (which runs an agentic loop in JS), this hook
- * spawns the Claude Code CLI as a Tauri subprocess and streams
- * JSON events back to the frontend. The CLI handles all tool
- * execution internally.
- *
- * Requires: Ollama 0.14+ (native Anthropic API compatibility).
- */
-export function useClaudeCode() {
- const [isRunning, setIsRunning] = useState(false)
- const unlistenRef = useRef<(() => void) | null>(null)
-
- // Cleanup event listener on unmount
- useEffect(() => {
- return () => {
- if (unlistenRef.current) {
- unlistenRef.current()
- unlistenRef.current = null
- }
- }
- }, [])
-
- const sendPrompt = useCallback(async (prompt: string) => {
- const claudeStore = useClaudeCodeStore.getState()
- const { settings } = useSettingsStore.getState()
- const chatStore = useChatStore.getState()
- const providerState = useProviderStore.getState()
-
- // Get Ollama base URL from provider store
- const ollamaConfig = providerState.providers.ollama
- const ollamaBaseUrl = ollamaConfig?.baseUrl || 'http://localhost:11434'
-
- // Get model: settings override → active Ollama model → fallback
- const { activeModel } = await import('../stores/modelStore').then(m => m.useModelStore.getState())
- const model = settings.claudeCodeModel || activeModel || 'glm5.1'
-
- // Get or create conversation
- let convId = chatStore.activeConversationId
- if (!convId) {
- convId = chatStore.createConversation(model, '', 'claude-code')
- }
-
- // Init session if needed
- // Use configured working directory, or user's home directory as fallback
- const workDir = claudeStore.workingDirectory || (typeof window !== 'undefined' && (window as any).__TAURI_INTERNALS__ ? '' : '.')
- // If no workDir, let Rust use the app's current directory
- if (!claudeStore.getSession(convId)) {
- claudeStore.initSession(convId, workDir)
- }
-
- // Caveman mode: prepend style directive to prompt for CLI
- let effectivePrompt = prompt
- if (settings.cavemanMode && settings.cavemanMode !== 'off') {
- const { CAVEMAN_PROMPTS } = await import('../lib/constants')
- const cavemanPrompt = CAVEMAN_PROMPTS[settings.cavemanMode as keyof typeof CAVEMAN_PROMPTS]
- if (cavemanPrompt) {
- effectivePrompt = `[Response style: ${cavemanPrompt}]\n\n${prompt}`
- }
- }
-
- // Add user message (show original prompt, not style-prefixed)
- chatStore.addMessage(convId, {
- id: uuid(), role: 'user', content: prompt, timestamp: Date.now(),
- })
-
- // Add empty assistant message (will be streamed into)
- const assistantMsgId = uuid()
- chatStore.addMessage(convId, {
- id: assistantMsgId, role: 'assistant', content: '', timestamp: Date.now(), agentBlocks: [],
- })
-
- // Add instruction event
- claudeStore.addEvent(convId, {
- id: uuid(), type: 'text', content: prompt, timestamp: Date.now(),
- })
-
- setIsRunning(true)
- claudeStore.setSessionStatus(convId, 'running')
-
- let fullContent = ''
- const blocks: AgentBlock[] = []
-
- // In Tauri mode: spawn CLI and listen for events
- if (isTauri()) {
- try {
- // Set up event listener BEFORE starting the process
- const { listen } = await import('@tauri-apps/api/event')
- const unlisten = await listen<Record<string, unknown>>('claude-code-event', (event) => {
- const data = event.payload as any
- const convIdCurrent = convId!
-
- // Create store event
- const storeEvent: ClaudeCodeEvent = {
- id: uuid(),
- type: data.type || 'text',
- content: data.content || '',
- timestamp: Date.now(),
- toolName: data.tool_name,
- toolArgs: data.tool_args,
- toolResult: data.tool_result,
- filePath: data.file_path,
- }
- claudeStore.addEvent(convIdCurrent, storeEvent)
-
- // Map to chat UI
- switch (data.type) {
- case 'text':
- case 'assistant': {
- const text = data.content || data.text || ''
- if (text) {
- fullContent += (fullContent ? '\n' : '') + text
- chatStore.updateMessageContent(convIdCurrent, assistantMsgId, fullContent)
- }
- break
- }
- case 'tool_use': {
- const toolCall: AgentToolCall = {
- id: uuid(),
- toolName: data.tool_name || data.name || 'unknown',
- args: data.tool_args || data.input || {},
- status: 'running',
- timestamp: Date.now(),
- }
- blocks.push({
- id: uuid(),
- phase: 'tool_call',
- content: `Running: ${toolCall.toolName}`,
- toolCall,
- timestamp: Date.now(),
- })
- chatStore.updateMessageAgentBlocks(convIdCurrent, assistantMsgId, [...blocks])
- break
- }
- case 'tool_result': {
- // Update the last tool call block with result
- const lastBlock = blocks[blocks.length - 1]
- if (lastBlock?.toolCall) {
- lastBlock.toolCall.status = 'completed'
- lastBlock.toolCall.result = data.content || data.output || ''
- lastBlock.toolCall.duration = Date.now() - lastBlock.timestamp
- lastBlock.content = `Completed: ${lastBlock.toolCall.toolName}`
- chatStore.updateMessageAgentBlocks(convIdCurrent, assistantMsgId, [...blocks])
- }
- break
- }
- case 'permission_request': {
- claudeStore.setSessionStatus(convIdCurrent, 'waiting_permission')
- blocks.push({
- id: uuid(),
- phase: 'tool_call',
- content: `Permission required: ${data.tool_name || 'action'}`,
- toolCall: {
- id: uuid(),
- toolName: data.tool_name || 'permission',
- args: data.tool_args || {},
- status: 'running',
- timestamp: Date.now(),
- },
- timestamp: Date.now(),
- })
- chatStore.updateMessageAgentBlocks(convIdCurrent, assistantMsgId, [...blocks])
- break
- }
- case 'error': {
- const errContent = data.content || 'Unknown error'
- fullContent += (fullContent ? '\n\n' : '') + `Error: ${errContent}`
- chatStore.updateMessageContent(convIdCurrent, assistantMsgId, fullContent)
- claudeStore.addEvent(convIdCurrent, {
- id: uuid(), type: 'error', content: errContent, timestamp: Date.now(),
- })
- break
- }
- case 'done': {
- setIsRunning(false)
- claudeStore.setSessionStatus(convIdCurrent, 'idle')
- claudeStore.setSessionPid(convIdCurrent, null)
- // Cleanup listener
- if (unlistenRef.current) {
- unlistenRef.current()
- unlistenRef.current = null
- }
- break
- }
- }
- })
-
- unlistenRef.current = unlisten
-
- // Determine permission mode
- const permissionMode = settings.claudeCodeAutoApprove ? 'auto-approve' : 'ask'
-
- // Start Claude Code subprocess
- const result = await backendCall<{ status: string; pid?: number }>('start_claude_code', {
- workingDir: workDir,
- model,
- prompt: effectivePrompt,
- ollamaBaseUrl,
- permissionMode,
- })
-
- if (result.pid) {
- claudeStore.setSessionPid(convId, result.pid)
- }
-
- if (result.status === 'already_running') {
- fullContent = 'A Claude Code session is already running. Stop it first.'
- chatStore.updateMessageContent(convId, assistantMsgId, fullContent)
- setIsRunning(false)
- claudeStore.setSessionStatus(convId, 'idle')
- }
- } catch (err) {
- const msg = typeof err === 'string' ? err : (err as Error).message || 'Failed to start Claude Code'
- fullContent = `Error: ${msg}`
- chatStore.updateMessageContent(convId, assistantMsgId, fullContent)
- setIsRunning(false)
- claudeStore.setSessionStatus(convId, 'error')
- }
- } else {
- // Dev mode (no Tauri) — show info message
- fullContent = 'Claude Code requires the Tauri desktop app (Ollama 0.14+). It is not available in browser dev mode.'
- chatStore.updateMessageContent(convId, assistantMsgId, fullContent)
- setIsRunning(false)
- claudeStore.setSessionStatus(convId, 'idle')
- }
- }, [])
-
- const stopSession = useCallback(async () => {
- try {
- await backendCall('stop_claude_code')
- } catch (err) {
- log.warn('[ClaudeCode] Stop failed', { err })
- }
- setIsRunning(false)
-
- // Cleanup listener
- if (unlistenRef.current) {
- unlistenRef.current()
- unlistenRef.current = null
- }
-
- // Update session status
- const convId = useChatStore.getState().activeConversationId
- if (convId) {
- useClaudeCodeStore.getState().setSessionStatus(convId, 'idle')
- useClaudeCodeStore.getState().setSessionPid(convId, null)
- }
- }, [])
-
- const approvePermission = useCallback(async () => {
- try {
- await backendCall('send_claude_code_input', { input: 'yes' })
- const convId = useChatStore.getState().activeConversationId
- if (convId) {
- useClaudeCodeStore.getState().setSessionStatus(convId, 'running')
- }
- } catch (err) {
- log.warn('[ClaudeCode] Approve failed', { err })
- }
- }, [])
-
- const denyPermission = useCallback(async () => {
- try {
- await backendCall('send_claude_code_input', { input: 'no' })
- const convId = useChatStore.getState().activeConversationId
- if (convId) {
- useClaudeCodeStore.getState().setSessionStatus(convId, 'running')
- }
- } catch (err) {
- log.warn('[ClaudeCode] Deny failed', { err })
- }
- }, [])
-
- return { sendPrompt, stopSession, approvePermission, denyPermission, isRunning }
-}
-
diff --git a/src/hooks/useCodex.ts b/src/hooks/useCodex.ts
index 7a79a81d..fcc914d5 100644
--- a/src/hooks/useCodex.ts
+++ b/src/hooks/useCodex.ts
@@ -23,7 +23,6 @@ import { computeUnifiedDiff } from '../lib/diff'
import { log } from '../lib/logger'
import type { CodexEvent } from '../types/codex'
import type { AgentBlock, AgentToolCall } from '../types/agent-mode'
-import { selectRelevantTools } from '../lib/tool-selection'
import { isThinkingCompatible, isPlainTextPlanner } from '../lib/model-compatibility'
import type { ChatMessage, ToolCall, ToolDefinition } from '../api/providers/types'
import { executeParallel, applyResultToToolCall, type ExecutionRequest } from '../api/agents/tool-executor'
@@ -34,6 +33,7 @@ import { budgetFromSettings } from '../api/agents/budget'
import { finalStripThinkingTags } from '../lib/thinking-stripper'
import { streamOllamaChatWithTools } from '../lib/ollama-stream-tools'
import { repairToolCallArgs, extractToolCallsFromContent, extractToolCallsWithRanges, stripRanges } from '../lib/tool-call-repair'
+import { selectRelevantTools } from '../lib/tool-selection'
import { compactMessages, getModelMaxTokens } from '../lib/context-compaction'
import { useMemoryStore } from '../stores/memoryStore'
import { extractMemoriesFromPair } from './useMemory'
@@ -52,7 +52,7 @@ 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 Codex in REVIEW MODE — a read-only code reviewer inside Locally Uncensored. 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 Locally Uncensored. 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.
@@ -60,7 +60,7 @@ REVIEW MODE CONTRACT (binding):
- 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 Codex, an autonomous coding agent inside Locally Uncensored. 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 Locally Uncensored. 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.
@@ -136,18 +136,23 @@ const lurulesReader: RulesReader = {
}
// Detect when the model emits a re-introduction of itself ("Hello, I am
-// Codex, an autonomous coding agent…") instead of the actual answer.
-// Gemma 4 + smaller models do this after a tool error — they re-spawn
-// the system-prompt echo as if the conversation just started. The user
-// asked to silence these: drop the content, do not render it, do not
-// persist it to the assistant message, and let the loop retry.
+// the Coding Agent, an autonomous coding agent…") instead of the actual
+// answer. Gemma 4 + smaller models do this after a tool error — they
+// re-spawn the system-prompt echo as if the conversation just started.
+// The user asked to silence these: drop the content, do not render it, do
+// not persist it to the assistant message, and let the loop retry.
+//
+// The self-name is "the Coding Agent" (see CODEX_SYSTEM_PROMPT), so the
+// guard matches "(the) Coding Agent" — the optional "the" covers both the
+// literal prompt echo ("You are the Coding Agent,") and the dropped-article
+// form small models tend to produce ("I am Coding Agent, an autonomous…").
function isSystemPromptEcho(content: string): boolean {
if (!content) return false
const head = content.trim().slice(0, 240)
return (
- /^(hello[!,.]?\s+|hi[!,.]?\s+|hey[!,.]?\s+)?(i['’]?m|i am|you are)\s+codex[,.]?\s+(an?\s+)?(autonomous\s+)?coding\s+agent/i.test(head) ||
- /^codex:?\s+(an?\s+)?autonomous\s+coding\s+agent/i.test(head) ||
- /^you are codex,/i.test(head)
+ /^(hello[!,.]?\s+|hi[!,.]?\s+|hey[!,.]?\s+)?(i['’]?m|i am|you are)\s+(the\s+)?coding\s+agent[,.]?\s+(an?\s+)?(autonomous\s+)?coding\s+agent/i.test(head) ||
+ /^(the\s+)?coding\s+agent:?\s+(an?\s+)?autonomous\s+coding\s+agent/i.test(head) ||
+ /^you are (the\s+)?coding\s+agent,/i.test(head)
)
}
@@ -370,7 +375,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 → Codex 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])
@@ -457,11 +462,23 @@ export function useCodex() {
let prevBatchSig: string | null = null
let sameBatchRepeats = 0
// Echo guard — small models occasionally re-emit the system prompt
- // ("Hello, I am Codex, an autonomous coding agent…") after a tool
- // error. The user asked to silence those silently rather than
+ // ("Hello, I am the Coding Agent, an autonomous coding agent…") after a
+ // tool error. The user asked to silence those silently rather than
// letting them surface as the assistant's reply. Cap silent
// retries so we never loop forever.
let echoRetriesRemaining = 3
+ // Agentic harness for SMALL local models (v2.5.0). qwen2.5-coder:7b and
+ // similar 7B/8B models frequently NARRATE the next step ("I'm about to
+ // read the source file.") or ASK for info they could discover themselves
+ // ("please provide the path to the source file") instead of emitting the
+ // next tool call — which ends the ReAct loop after a single step. Strong
+ // models (Cloud Opus/Sonnet, local 70B — what the uselu reference targets)
+ // don't need this; small LOCAL models (LU's whole point) do. When a turn
+ // produces text with NO tool call and NO genuine completion signal, push
+ // one synthetic "act, don't narrate" nudge and loop again instead of
+ // stopping. Capped so a model that simply refuses to act can't loop
+ // forever (budget + loop-detector are the other backstops).
+ let continueNudgesRemaining = 3
// Raised from 20 → 50 (v2.3.7): large refactors across 10+ files
// legitimately need >20 tool calls. Budget still caps via
// agentMaxToolCalls/agentMaxIterations.
@@ -530,6 +547,16 @@ export function useCodex() {
const codexTools = settings.codexReviewMode
? codexToolsAll.filter((t) => !REVIEW_MODE_FORBIDDEN_TOOLS.has(t.name))
: codexToolsAll
+ // Keep the tool list LEAN — exactly like the uselu reference. A small
+ // model (qwen2.5-coder:7b) handed the full ~24-tool category set every
+ // turn degrades fast: it lapses into prose narration or dumps raw
+ // tool-call JSON instead of emitting clean native tool_calls, and the
+ // ReAct loop then stops after one step. uselu narrows to a handful of
+ // keyword-relevant tools, which keeps small models on-rails; git/test
+ // operations go through shell_execute (the dedicated git_*/run_tests
+ // tools are intentionally not surfaced by the keyword router). This
+ // line is the single most important parity point with uselu — do NOT
+ // replace it with the full `codexTools` set (that was the regression).
const relevantDefs = selectRelevantTools(lastUserMsg, codexTools, permissions)
const tools: ToolDefinition[] = relevantDefs.map(t => ({
type: 'function' as const,
@@ -557,8 +584,8 @@ export function useCodex() {
// Echo guard: while a turn is streaming we keep updating the
// visible message — but if the partial content already
// matches the system-prompt echo pattern we stop pushing
- // updates so the "Hello, I am Codex…" line never lands in
- // the chat. The post-stream echoDetected branch then drops
+ // updates so the "Hello, I am the Coding Agent…" line never
+ // lands in the chat. The post-stream echoDetected branch then drops
// the buffer entirely and forces a silent retry.
let turn: { content: string; toolCalls: ToolCall[]; thinking: string }
const liveContent = (c: string) => {
@@ -716,8 +743,8 @@ export function useCodex() {
}
// Silent-retry on system-prompt echo — Gemma 4 sometimes
- // restarts with "Hello, I am Codex, an autonomous coding
- // agent…" after a tool error. Drop that content entirely
+ // restarts with "Hello, I am the Coding Agent, an autonomous
+ // coding agent…" after a tool error. Drop that content entirely
// (don't append, don't render) and force the loop to take
// another swing instead of letting the echo bubble up as
// the assistant's reply. Cap the silent retries so a model
@@ -759,8 +786,25 @@ export function useCodex() {
})
}
- // No tool calls → done
+ // No tool calls in this turn. For a strong model that means "task
+ // done". For a small local model it's usually a PREMATURE stop — it
+ // narrated the next step or asked for info instead of acting. Nudge it
+ // to continue (capped) before giving up, unless the text clearly signals
+ // genuine completion. The completion regex is deliberately CONSERVATIVE
+ // (only strong "is complete / all tests pass / committed" phrases, not
+ // forward-looking "to complete the fix") so we err toward nudging.
if (toolCalls.length === 0) {
+ const looksComplete = /\b(the (task|fix|change|work) is (now )?complete|task complete|all (the )?tests?(?: now)? pass(ed)?|i (?:have|'ve) (?:committed|fixed and committed)|successfully committed|committed the (?:fix|change|changes)|no (?:further|more) (?:changes|steps|action)s? (?:are )?(?:needed|required)|nothing (?:else|more) to do)\b/i.test(turnContent)
+ if (!looksComplete && continueNudgesRemaining > 0) {
+ continueNudgesRemaining--
+ void diagLog('continue-nudge', { iter: i, remaining: continueNudgesRemaining, turnContentLen: turnContent.length })
+ messages.push({
+ role: 'user',
+ content:
+ 'Continue working autonomously until the task is fully done. Do NOT narrate what you are about to do, and do NOT ask me for paths or details you can discover yourself — use file_list / file_search / file_read to find them. Emit the NEXT step as an actual tool call right now. Only stop once everything is finished and verified.',
+ })
+ continue
+ }
void diagLog('break-no-toolcalls', { iter: i, turnContentLen: turnContent.length, fullContentLen: fullContent.length })
break
}
@@ -1075,7 +1119,7 @@ export function useCodex() {
const parts: string[] = []
if (e?.code) parts.push(`[${e.code}]`)
if (typeof e?.statusCode === 'number') parts.push(`HTTP ${e.statusCode}`)
- parts.push(e?.message || String(err) || 'Codex error')
+ parts.push(e?.message || String(err) || 'Coding Agent error')
const msg = parts.join(' ')
// Surface common causes so the user can see WHY it failed instead of
// a bare "Connection error" — previously we only printed `.message`,
diff --git a/src/lib/__tests__/constants-validation.test.ts b/src/lib/__tests__/constants-validation.test.ts
index ee559fbd..990120b1 100644
--- a/src/lib/__tests__/constants-validation.test.ts
+++ b/src/lib/__tests__/constants-validation.test.ts
@@ -78,12 +78,6 @@ describe('constants-validation', () => {
it('has tavilyApiKey as string', () => {
expect(typeof DEFAULT_SETTINGS.tavilyApiKey).toBe('string')
})
-
- it('has Claude Code fields', () => {
- expect(typeof DEFAULT_SETTINGS.claudeCodeModel).toBe('string')
- expect(typeof DEFAULT_SETTINGS.claudeCodeAutoApprove).toBe('boolean')
- expect(typeof DEFAULT_SETTINGS.claudeCodePath).toBe('string')
- })
})
// ── BUILT_IN_PERSONAS ────────────────────────────────────────
diff --git a/src/lib/__tests__/model-compatibility-smoke.test.ts b/src/lib/__tests__/model-compatibility-smoke.test.ts
index 30ce64fb..d8a01b4a 100644
--- a/src/lib/__tests__/model-compatibility-smoke.test.ts
+++ b/src/lib/__tests__/model-compatibility-smoke.test.ts
@@ -8,7 +8,6 @@
* - isAgentCompatible (tool calling support)
* - isThinkingCompatible (native think parameter)
* - isPlainTextPlanner (Gemma 3/4 bypass logic)
- * - isClaudeCodeCompatible
* - getToolCallingStrategy (native vs hermes_xml)
* - getRecommendedAgentModels
* - Abliterated model handling
@@ -21,7 +20,6 @@ import {
hasNativeToolCalling,
isThinkingCompatible,
isPlainTextPlanner,
- isClaudeCodeCompatible,
getToolCallingStrategy,
getRecommendedAgentModels,
} from '../model-compatibility'
@@ -126,22 +124,6 @@ describe('isPlainTextPlanner', () => {
})
})
-// ── Claude Code Compatibility ───────────────────────────────────────────
-
-describe('isClaudeCodeCompatible', () => {
- it('returns true for Claude-Code-capable models', () => {
- expect(isClaudeCodeCompatible('qwen3-coder:30b')).toBe(true)
- expect(isClaudeCodeCompatible('hermes3:8b')).toBe(true)
- expect(isClaudeCodeCompatible('gemma4:12b')).toBe(true)
- expect(isClaudeCodeCompatible('deepseek-v3:latest')).toBe(true)
- })
-
- it('returns false for incompatible models', () => {
- expect(isClaudeCodeCompatible('llama3.1:8b')).toBe(false)
- expect(isClaudeCodeCompatible('mistral:7b')).toBe(false)
- })
-})
-
// ── Tool Calling Strategy ───────────────────────────────────────────────
describe('getToolCallingStrategy', () => {
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index a62952c1..aac4bb09 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -19,10 +19,6 @@ export const DEFAULT_SETTINGS: Settings = {
searchProvider: 'auto',
braveApiKey: '',
tavilyApiKey: '',
- // Claude Code
- claudeCodeModel: '',
- claudeCodeAutoApprove: false,
- claudeCodePath: '',
// Agent budget — bumped in v2.5.0 (uselu live-test 2026-05-25, commit
// 1af958b2): on a real scaffold-install-fix-verify loop with a 35B
// local model, 25 iterations / 50 tool calls fired the cap while the
diff --git a/src/lib/context-compaction.ts b/src/lib/context-compaction.ts
index dfeb8275..c796735f 100644
--- a/src/lib/context-compaction.ts
+++ b/src/lib/context-compaction.ts
@@ -1,7 +1,7 @@
/**
* Context Compaction — prevents "Failed to fetch" from context window exhaustion.
*
- * Strategy (from Claude Code / Claw Code pattern):
+ * Strategy:
* - Keep the last N messages intact (recent context matters most)
* - Summarize older messages into compact one-liners
* - Tool call + result pairs become: "Used tool_name('args') → result_snippet"
diff --git a/src/lib/memory-extraction.ts b/src/lib/memory-extraction.ts
index d0a2570d..c991cceb 100644
--- a/src/lib/memory-extraction.ts
+++ b/src/lib/memory-extraction.ts
@@ -4,7 +4,7 @@
* After each conversation turn, optionally asks the LLM to analyze the exchange
* and extract information worth remembering across conversations.
*
- * Categories (Claude Code-inspired):
+ * Categories:
* - user: User preferences, role, knowledge level
* - feedback: Corrections and confirmations ("don't do X", "yes, keep doing Y")
* - project: Ongoing work context, goals, decisions
diff --git a/src/lib/model-compatibility.ts b/src/lib/model-compatibility.ts
index f7f52e49..b9e36d05 100644
--- a/src/lib/model-compatibility.ts
+++ b/src/lib/model-compatibility.ts
@@ -173,30 +173,6 @@ export function isPlainTextPlanner(modelName: string | null): boolean {
return containsFamily('gemma3', baseName) || containsFamily('gemma4', baseName)
}
-/**
- * Models recommended for Claude Code (Anthropic API compat via Ollama 0.14+).
- * These models handle agentic tool-use loops well with the Claude Code CLI.
- */
-const CLAUDE_CODE_COMPATIBLE = [
- 'glm5', 'glm-5', 'glm4.7', 'glm-4.7',
- 'qwen3.6',
- 'qwen3.5-coder', 'qwen3-coder',
- 'qwen3.5', 'qwen3',
- 'hermes3', 'hermes-3', 'hermes',
- 'deepseek-v3', 'deepseek-v2.5',
- 'gemma4', 'gemma3',
-]
-
-/**
- * Check if a model works well with Claude Code via Ollama 0.14+.
- * Only relevant for Ollama provider since Claude Code uses Anthropic API format.
- */
-export function isClaudeCodeCompatible(modelName: string | null): boolean {
- if (!modelName) return false
- const baseName = normalizeFamily(modelName)
- return CLAUDE_CODE_COMPATIBLE.some(f => containsFamily(f, baseName))
-}
-
export type ToolCallingStrategy = 'native' | 'template_fix' | 'hermes_xml'
/**
diff --git a/src/stores/__tests__/chatStore-operations.test.ts b/src/stores/__tests__/chatStore-operations.test.ts
index 4db3ef41..5fc3c54d 100644
--- a/src/stores/__tests__/chatStore-operations.test.ts
+++ b/src/stores/__tests__/chatStore-operations.test.ts
@@ -2,7 +2,7 @@
* Smoke tests for chatStore — the central conversation state manager.
*
* Tests all critical store operations that underpin Chat, Codex, Agent, and Remote:
- * - createConversation (all modes: lu, codex, claude-code, remote)
+ * - createConversation (all modes: lu, codex, remote)
* - addMessage / updateMessageContent / updateMessageThinking
* - insertMessageBefore (Codex continue capability)
* - deleteConversation / renameConversation
@@ -41,15 +41,10 @@ describe('chatStore — conversation CRUD', () => {
it('creates Codex conversation with correct title', () => {
const id = useChatStore.getState().createConversation('qwen3-coder:30b', '', 'codex')
- expect(useChatStore.getState().conversations[0].title).toBe('Codex Chat')
+ expect(useChatStore.getState().conversations[0].title).toBe('Coding Agent')
expect(useChatStore.getState().conversations[0].mode).toBe('codex')
})
- it('creates Claude Code conversation', () => {
- useChatStore.getState().createConversation('hermes3:8b', '', 'claude-code')
- expect(useChatStore.getState().conversations[0].title).toBe('Claude Code')
- })
-
it('auto-numbers remote conversations', () => {
useChatStore.getState().createConversation('gemma4', '', 'remote')
useChatStore.getState().createConversation('gemma4', '', 'remote')
@@ -82,8 +77,8 @@ describe('chatStore — conversation CRUD', () => {
it('does NOT auto-rename Codex/Remote chats', () => {
const id = useChatStore.getState().createConversation('gemma4', '', 'codex')
useChatStore.getState().addMessage(id, msg({ content: 'Build a website' }))
- // Codex Chat title stays — auto-rename only kicks on title === 'New Chat'
- expect(useChatStore.getState().conversations[0].title).toBe('Codex Chat')
+ // "Coding Agent" title stays — auto-rename only kicks on title === 'New Chat'
+ expect(useChatStore.getState().conversations[0].title).toBe('Coding Agent')
})
})
diff --git a/src/stores/__tests__/sessionStores.test.ts b/src/stores/__tests__/sessionStores.test.ts
index e79a2552..e47cd6f7 100644
--- a/src/stores/__tests__/sessionStores.test.ts
+++ b/src/stores/__tests__/sessionStores.test.ts
@@ -1,7 +1,5 @@
import { describe, it, expect, beforeEach } from 'vitest'
import { useCodexStore } from '../codexStore'
-import { useClaudeCodeStore } from '../claudeCodeStore'
-import type { ClaudeCodeEvent } from '../claudeCodeStore'
import { useVoiceStore } from '../voiceStore'
import type { CodexEvent } from '../../types/codex'
@@ -132,143 +130,6 @@ describe('codexStore', () => {
})
})
-// ── claudeCodeStore ──────────────────────────────────────────
-
-describe('claudeCodeStore', () => {
- beforeEach(() => {
- useClaudeCodeStore.setState({
- installed: false,
- version: null,
- cliPath: null,
- sessions: {},
- workingDirectory: '',
- })
- })
-
- describe('initSession', () => {
- it('creates a new session for the conversation', () => {
- const id = useClaudeCodeStore.getState().initSession('conv-1', '/workspace')
- expect(id).toMatch(/^claude-code-/)
- const session = useClaudeCodeStore.getState().sessions['conv-1']
- expect(session).toBeDefined()
- expect(session.conversationId).toBe('conv-1')
- expect(session.workingDirectory).toBe('/workspace')
- expect(session.status).toBe('idle')
- expect(session.pid).toBeNull()
- expect(session.events).toEqual([])
- })
-
- it('overwrites an existing session for the same conversation', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/a')
- const id2 = useClaudeCodeStore.getState().initSession('conv-1', '/b')
- expect(useClaudeCodeStore.getState().sessions['conv-1'].id).toBe(id2)
- })
- })
-
- describe('addEvent', () => {
- it('appends an event to the correct session', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/ws')
- const event: ClaudeCodeEvent = {
- id: 'e1',
- type: 'text',
- content: 'Hello',
- timestamp: Date.now(),
- }
- useClaudeCodeStore.getState().addEvent('conv-1', event)
- expect(useClaudeCodeStore.getState().sessions['conv-1'].events).toHaveLength(1)
- })
-
- it('gracefully returns state when session does not exist', () => {
- const event: ClaudeCodeEvent = { id: 'e1', type: 'error', content: 'err', timestamp: Date.now() }
- useClaudeCodeStore.getState().addEvent('nonexistent', event)
- expect(useClaudeCodeStore.getState().sessions['nonexistent']).toBeUndefined()
- })
-
- it('preserves event order', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/ws')
- useClaudeCodeStore.getState().addEvent('conv-1', { id: 'a', type: 'text', content: '1', timestamp: 1 })
- useClaudeCodeStore.getState().addEvent('conv-1', { id: 'b', type: 'tool_use', content: '2', timestamp: 2, toolName: 'file_read' })
- const events = useClaudeCodeStore.getState().sessions['conv-1'].events
- expect(events.map(e => e.id)).toEqual(['a', 'b'])
- })
- })
-
- describe('clearSession', () => {
- it('removes the session for the conversation', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/ws')
- useClaudeCodeStore.getState().clearSession('conv-1')
- expect(useClaudeCodeStore.getState().sessions['conv-1']).toBeUndefined()
- })
-
- it('does not affect other sessions', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/a')
- useClaudeCodeStore.getState().initSession('conv-2', '/b')
- useClaudeCodeStore.getState().clearSession('conv-1')
- expect(useClaudeCodeStore.getState().sessions['conv-2']).toBeDefined()
- })
-
- it('is a no-op for non-existent conversation', () => {
- useClaudeCodeStore.getState().clearSession('nonexistent')
- expect(Object.keys(useClaudeCodeStore.getState().sessions)).toHaveLength(0)
- })
- })
-
- describe('getSession', () => {
- it('returns the session for the conversation', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/ws')
- expect(useClaudeCodeStore.getState().getSession('conv-1')).toBeDefined()
- })
-
- it('returns undefined for non-existent conversation', () => {
- expect(useClaudeCodeStore.getState().getSession('nope')).toBeUndefined()
- })
- })
-
- describe('setSessionStatus', () => {
- it('updates the session status', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/ws')
- useClaudeCodeStore.getState().setSessionStatus('conv-1', 'running')
- expect(useClaudeCodeStore.getState().sessions['conv-1'].status).toBe('running')
- })
-
- it('is a no-op for non-existent session', () => {
- useClaudeCodeStore.getState().setSessionStatus('nonexistent', 'error')
- expect(useClaudeCodeStore.getState().sessions['nonexistent']).toBeUndefined()
- })
- })
-
- describe('setSessionPid', () => {
- it('sets the pid on the session', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/ws')
- useClaudeCodeStore.getState().setSessionPid('conv-1', 12345)
- expect(useClaudeCodeStore.getState().sessions['conv-1'].pid).toBe(12345)
- })
-
- it('can clear pid to null', () => {
- useClaudeCodeStore.getState().initSession('conv-1', '/ws')
- useClaudeCodeStore.getState().setSessionPid('conv-1', 123)
- useClaudeCodeStore.getState().setSessionPid('conv-1', null)
- expect(useClaudeCodeStore.getState().sessions['conv-1'].pid).toBeNull()
- })
- })
-
- describe('setInstalled', () => {
- it('sets installed status with version and path', () => {
- useClaudeCodeStore.getState().setInstalled(true, '1.0.0', '/usr/bin/claude')
- const state = useClaudeCodeStore.getState()
- expect(state.installed).toBe(true)
- expect(state.version).toBe('1.0.0')
- expect(state.cliPath).toBe('/usr/bin/claude')
- })
-
- it('sets null for missing version and path', () => {
- useClaudeCodeStore.getState().setInstalled(false)
- expect(useClaudeCodeStore.getState().version).toBeNull()
- expect(useClaudeCodeStore.getState().cliPath).toBeNull()
- })
- })
-})
-
// ── voiceStore ───────────────────────────────────────────────
describe('voiceStore', () => {
diff --git a/src/stores/chatStore.ts b/src/stores/chatStore.ts
index f41a3230..8c834349 100644
--- a/src/stores/chatStore.ts
+++ b/src/stores/chatStore.ts
@@ -29,7 +29,7 @@ export function migratePersistedChat(state: any): any {
interface ChatState {
conversations: Conversation[]
activeConversationId: string | null
- createConversation: (model: string, systemPrompt: string, mode?: 'lu' | 'codex' | 'openclaw' | 'claude-code' | 'remote') => string
+ createConversation: (model: string, systemPrompt: string, mode?: 'lu' | 'codex' | 'openclaw' | 'remote') => string
deleteConversation: (id: string) => void
renameConversation: (id: string, title: string) => void
setActiveConversation: (id: string | null) => void
@@ -58,8 +58,9 @@ export const useChatStore = create<ChatState>()(
const id = uuid()
// Auto-number remote chats so users can distinguish sessions in the sidebar
let title: string
- if (mode === 'codex') title = 'Codex Chat'
- else if (mode === 'claude-code') title = 'Claude Code'
+ // 'codex' is the internal back-compat mode id; the user-facing
+ // default title is "Coding Agent".
+ if (mode === 'codex') title = 'Coding Agent'
else if (mode === 'remote') {
const state = get()
const nextNum = state.conversations.filter((c) => c.mode === 'remote').length + 1
diff --git a/src/stores/claudeCodeStore.ts b/src/stores/claudeCodeStore.ts
deleted file mode 100644
index 7dacdfc2..00000000
--- a/src/stores/claudeCodeStore.ts
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * Claude Code Store — manages Claude Code sessions and state.
- *
- * Tracks CLI installation status, active sessions, working directory,
- * and streamed events from the Claude Code subprocess.
- * Requires Ollama 0.14+ (native Anthropic API compatibility).
- */
-
-import { create } from 'zustand'
-import { persist } from 'zustand/middleware'
-
-// ── Types ──────────────────────────────────────────────────────
-
-export type ClaudeCodeEventType =
- | 'text' // assistant text content
- | 'tool_use' // tool invocation (file read, write, shell)
- | 'tool_result' // tool execution result
- | 'permission_request'// needs user approval
- | 'error' // error occurred
- | 'done' // task complete
-
-export interface ClaudeCodeEvent {
- id: string
- type: ClaudeCodeEventType
- content: string
- timestamp: number
- toolName?: string
- toolArgs?: Record<string, unknown>
- toolResult?: string
- filePath?: string
- diff?: string
-}
-
-export interface ClaudeCodeSession {
- id: string
- conversationId: string
- events: ClaudeCodeEvent[]
- status: 'idle' | 'running' | 'waiting_permission' | 'error'
- workingDirectory: string
- pid: number | null
-}
-
-// ── Recommended models for Claude Code ─────────────────────────
-
-export const CLAUDE_CODE_RECOMMENDED_MODELS = [
- { name: 'glm5.1', label: 'GLM 5.1', reason: 'Latest GLM, strong tool calling, 128K context' },
- { name: 'qwen3.5-coder', label: 'Qwen 3.5 Coder', reason: 'Best open-source coding model, native tool calling' },
- { name: 'qwen3.5-coder-abliterated', label: 'Qwen 3.5 Coder (Uncensored)', reason: 'Abliterated variant, no refusals' },
- { name: 'glm4.7', label: 'GLM 4.7 Flash', reason: '128K context, MoE, runs on 16GB RAM' },
- { name: 'qwen3-coder', label: 'Qwen 3 Coder', reason: 'Strong coding, 128K context' },
- { name: 'hermes3', label: 'Hermes 3', reason: 'Uncensored, good tool calling' },
-] as const
-
-// ── Store ──────────────────────────────────────────────────────
-
-interface ClaudeCodeState {
- installed: boolean
- version: string | null
- cliPath: string | null
- sessions: Record<string, ClaudeCodeSession>
- workingDirectory: string
-
- setInstalled: (installed: boolean, version?: string, path?: string) => void
- setWorkingDirectory: (dir: string) => void
-
- getSession: (conversationId: string) => ClaudeCodeSession | undefined
- initSession: (conversationId: string, workingDir: string) => string
- addEvent: (conversationId: string, event: ClaudeCodeEvent) => void
- setSessionStatus: (conversationId: string, status: ClaudeCodeSession['status']) => void
- setSessionPid: (conversationId: string, pid: number | null) => void
- clearSession: (conversationId: string) => void
-}
-
-export const useClaudeCodeStore = create<ClaudeCodeState>()(
- persist(
- (set, get) => ({
- installed: false,
- version: null,
- cliPath: null,
- sessions: {},
- workingDirectory: '',
-
- setInstalled: (installed, version, path) =>
- set({ installed, version: version || null, cliPath: path || null }),
-
- setWorkingDirectory: (dir) => set({ workingDirectory: dir }),
-
- getSession: (conversationId) => get().sessions[conversationId],
-
- initSession: (conversationId, workingDir) => {
- const id = `claude-code-${Date.now()}`
- set((state) => ({
- sessions: {
- ...state.sessions,
- [conversationId]: {
- id,
- conversationId,
- events: [],
- status: 'idle',
- workingDirectory: workingDir,
- pid: null,
- },
- },
- }))
- return id
- },
-
- addEvent: (conversationId, event) =>
- set((state) => {
- const session = state.sessions[conversationId]
- if (!session) return state
- return {
- sessions: {
- ...state.sessions,
- [conversationId]: {
- ...session,
- events: [...session.events, event],
- },
- },
- }
- }),
-
- setSessionStatus: (conversationId, status) =>
- set((state) => {
- const session = state.sessions[conversationId]
- if (!session) return state
- return {
- sessions: {
- ...state.sessions,
- [conversationId]: { ...session, status },
- },
- }
- }),
-
- setSessionPid: (conversationId, pid) =>
- set((state) => {
- const session = state.sessions[conversationId]
- if (!session) return state
- return {
- sessions: {
- ...state.sessions,
- [conversationId]: { ...session, pid },
- },
- }
- }),
-
- clearSession: (conversationId) =>
- set((state) => {
- const { [conversationId]: _, ...rest } = state.sessions
- return { sessions: rest }
- }),
- }),
- {
- name: 'locally-uncensored-claude-code',
- partialize: (state) => ({
- installed: state.installed,
- version: state.version,
- cliPath: state.cliPath,
- workingDirectory: state.workingDirectory,
- }),
- }
- )
-)
diff --git a/src/stores/codexStore.ts b/src/stores/codexStore.ts
index eed0271d..1e351a25 100644
--- a/src/stores/codexStore.ts
+++ b/src/stores/codexStore.ts
@@ -93,11 +93,15 @@ export const useCodexStore = create<CodexState>()(
}),
}),
{
+ // Persist key kept as 'locally-uncensored-codex' for storage
+ // back-compat — renaming it would orphan every existing user's
+ // coding working-directory. Internal id only; user-facing label is
+ // "Coding Agent".
name: 'locally-uncensored-codex',
// chatMode is intentionally NOT persisted: newcomers should always land in
// the Chat tab on startup, not whatever tab they left off in. If a user
- // wants to stay in Codex or Claude Code, they pick it from the sidebar
- // each session. workingDirectory still persists so Codex remembers the
+ // wants to stay in the Coding Agent, they pick it from the sidebar
+ // each session. workingDirectory still persists so it remembers the
// last project path.
partialize: (state) => ({
workingDirectory: state.workingDirectory,
diff --git a/src/types/__tests__/message-types.test.ts b/src/types/__tests__/message-types.test.ts
index c8614ca1..395aa963 100644
--- a/src/types/__tests__/message-types.test.ts
+++ b/src/types/__tests__/message-types.test.ts
@@ -86,8 +86,8 @@ describe('Message interface — field support', () => {
})
describe('Conversation interface', () => {
- it('supports all 5 chat modes', () => {
- const modes: Conversation['mode'][] = ['lu', 'codex', 'openclaw', 'claude-code', 'remote']
+ it('supports all 4 chat modes', () => {
+ const modes: Conversation['mode'][] = ['lu', 'codex', 'openclaw', 'remote']
for (const mode of modes) {
const c: Conversation = {
id: `conv-${mode}`, title: 'Test', messages: [],
@@ -127,11 +127,10 @@ describe('Message type source integrity', () => {
expect(src).toContain('images?: ImageAttachment[]')
})
- it('Conversation has mode with all 5 options', () => {
+ it('Conversation has mode with all 4 options', () => {
expect(src).toContain("'lu'")
expect(src).toContain("'codex'")
expect(src).toContain("'openclaw'")
- expect(src).toContain("'claude-code'")
expect(src).toContain("'remote'")
})
diff --git a/src/types/agent-mode.ts b/src/types/agent-mode.ts
index 3722ae60..1ee7f0c7 100644
--- a/src/types/agent-mode.ts
+++ b/src/types/agent-mode.ts
@@ -1,7 +1,7 @@
// Agent Mode — Type Definitions
// Part of the Agent Mode feature (coding-orch branch)
-// Permission tiers (Claude Code pattern)
+// Permission tiers (auto-approve reads, confirm writes)
export type ToolPermission = 'auto' | 'confirm'
// Tool definition for internal use
@@ -129,7 +129,7 @@ export interface MemoryEntry {
source?: string // e.g. "agent:web_search", "user:manual", "auto:extraction"
}
-// ── Enhanced Memory System (Claude Code-inspired) ─────────────
+// ── Enhanced Memory System ────────────────────────────────────
export type MemoryType = 'user' | 'feedback' | 'project' | 'reference'
diff --git a/src/types/chat.ts b/src/types/chat.ts
index c139353b..94964a70 100644
--- a/src/types/chat.ts
+++ b/src/types/chat.ts
@@ -32,7 +32,7 @@ export interface Conversation {
messages: Message[]
model: string
systemPrompt: string
- mode?: 'lu' | 'codex' | 'openclaw' | 'claude-code' | 'remote'
+ mode?: 'lu' | 'codex' | 'openclaw' | 'remote'
/** Per-chat persona toggle. Mirrors the mobile chat's `personaEnabled`
* flag so the user can flip the persona on/off for each chat
* individually without losing the selection in Settings. Undefined
diff --git a/src/types/codex.ts b/src/types/codex.ts
index 6b55d362..5d51ea5c 100644
--- a/src/types/codex.ts
+++ b/src/types/codex.ts
@@ -1,4 +1,9 @@
-export type ChatMode = 'lu' | 'codex' | 'openclaw' | 'claude-code' | 'remote'
+// NOTE: the 'codex' value is kept as a stable internal id for storage
+// back-compat (zustand persist key 'locally-uncensored-codex' + per-chat
+// mode tag). It is an invisible identifier — the user-facing label is
+// "Coding Agent" (see CodexView / Sidebar). Renaming it would wipe existing
+// users' coding chats + working-dir on upgrade.
+export type ChatMode = 'lu' | 'codex' | 'openclaw' | 'remote'
export type CodexEventType = 'instruction' | 'file_change' | 'terminal_output' | 'reasoning' | 'error' | 'done'
diff --git a/src/types/settings.ts b/src/types/settings.ts
index 9b5f5937..9751a602 100644
--- a/src/types/settings.ts
+++ b/src/types/settings.ts
@@ -17,10 +17,6 @@ export interface Settings {
searchProvider: SearchProvider
braveApiKey: string
tavilyApiKey: string
- // Claude Code
- claudeCodeModel: string
- claudeCodeAutoApprove: boolean
- claudeCodePath: string
// Agent budget (Phase 10 v2.4.0) — hard caps that halt a runaway agent.
/** Hard cap on tool calls per user turn. 0 = unlimited (not recommended). */
agentMaxToolCalls: number