mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
4db44e2ede1996cd52f48c422fd78a34322f0d13
52
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
642bf03ea7 |
fix(mcp): recognize unbracketed space-separated Bash prompts as idle (#4176)
Accept space-separated Bash $ prompts while preserving delimiter and pending-input guards. Add recognition and extraction regression coverage. Fixes #4175 Co-authored-by: Codex <codex@openai.com> |
||
|
+1 |
16061720e6 |
feat(ai): add safe OSC 133 shell readiness (#4110)
* fix(terminal): clear sticky broadcast latch on vim ex (#4107) (#4109) Fixes #4107. Merge gate: GitHub Codex clean on tip b7efbe347; local CLEAN residual (unknown colon-prefixed alt-screen challenges) left as documented thrash; CI green (lint-and-test / windows-fido / windows-broadcast-ssh); Electron smoke PASS NC_OUT=/workspace/netcatty-smoke-shots/pr-4109-b7efbe347-20261104-122316 (both panes exited vim via toolbar broadcast :q!). * perf(ai): stop freezing the app during agent discovery and chat backups (#4116) Both paths ran synchronous I/O on the Electron main process, which freezes every window and the terminal keystroke relay while it runs: - Agent discovery (opening the AI panel or Settings > AI) probed auth with execFileSync: `security find-generic-password` (4 s timeout), `gh auth status` (network, 5 s), `which cursor-agent` (4 s) and `cursor-agent status` (8 s), one after another. The probes now use a non-rejecting async execFile helper with the same result shape; discovery awaits them. - Cursor SDK detection evaluated `import("@cursor/sdk")` (~4 MB of ESM plus its transport stack) only to check that it is installed, and kept it resident afterwards. It now checks for the ESM entry that the dynamic import loads; the SDK itself still loads on first use. The package does not export package.json and its CJS build is stripped from releases, so the check walks require.resolve.paths() instead of using require.resolve. - The AI chat backup wrote the whole history (often several MB) with writeFileSync on every debounced change. Writes now use fs.promises and are serialized so generations cannot interleave. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * perf(ui): stop whole-shell re-renders on clicks, focus, typing and modifiers (#4117) Several everyday interactions re-rendered the entire shell (AppView, TopTabs, TerminalLayer and every pane) even though nothing they show had changed: - Clicking or focusing a split pane always replaced the workspaces array (twice per click: onClick + onFocusCapture), cascading through the whole app and re-saving the session restore snapshot. setWorkspaceFocusedSession and moveFocusInWorkspace now keep the same array when focus is unchanged (domain/workspace.ts setWorkspaceFocusedSessionId). - Every window focus/visibility change resynced app lock and produced a new runtime state object even when nothing changed, re-rendering the provider tree. Equal states keep the current object and useAppLockState's result is memoized. - Quick switcher keystrokes went through AppSideEffects state and the app-local UI store, re-rendering AppSideEffects, every host island, AppShell, AppView and TopTabs per character. QuickSwitcherOverlay now owns the query and host results; the overlay unmounts on close, which resets the query exactly where setQuickSearch('') used to. - Pressing/releasing Ctrl/Cmd (every ⌘C/⌘V/Ctrl+C) re-rendered the whole tab bar to toggle shortcut number badges. The held flag now lives in a small store read only by each tab's TabIconSlot. - AppView passed fresh inline callbacks that defeated TopTabs' memo comparator and every open editor tab; TextEditorTabView is now memoized. TopTabs memoizes per-workspace session lists and hoists the root tab icons. - Workspace drag previews only update state when the drop hint actually moves. React commits / render time for 10 repetitions in the real app (profiling build, 2 split panes, 300 hosts), main -> this change: window focus 42 / 17.1 ms -> 2 / 0.4 ms press/release Cmd 50 / 41.9 ms -> 22 / 6.6 ms click focused pane 42 / 69.6 ms -> 3 / 0.4 ms quick switcher typing 41 / 61.3 ms -> 16 / 34.8 ms Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * perf(terminal): cap live WebGL contexts, release them eagerly, bound note undo history (#4122) * perf(terminal): cap live WebGL contexts and stop the context-loss cascade Chromium keeps at most 16 WebGL contexts per renderer and force-loses the one that drew least recently past that. Hidden terminal panes keep their WebGL renderer unless hibernation is on, so with more than 16 terminal tabs every forced loss was rebuilt 50 ms later, evicting another context. With 20 local tabs, half of all tab switches landed on a lost context (xterm waits 3 s before falling back), and terminals that lost three contexts within a minute were parked on the DOM renderer for good. - Add a shared context budget (12). Past it, renderers of panes hidden for at least 3 s are released, least recently seen first. Visible panes are never released or refused; a released pane rebuilds when shown. - A context lost while hidden waits for the reveal instead of rebuilding at once, and no longer counts toward the breaker. - The short-hide CSS reveal path now also asks for the renderer (a no-op while it is live). - Disposing the addon left its context alive until GC. Lose it explicitly so GPU memory and the Chromium slot come back right away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * perf(notes): bound the source editor's undo history Every undo step in the markdown source editor holds a full copy of the note, and the stack never shrank. A long session on a large note kept every intermediate version alive (a 100 KB note with 1,000 steps holds ~200 MB of UTF-16 text). Keep the 200 most recent steps and at most 8M characters across them, dropping the oldest first. The newest step always survives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * perf(terminal): stop per-second churn while connecting and while idle (#4118) * perf(terminal): stop per-second churn while connecting and while idle - Connecting sessions: the 200 ms progress animation and 1 s countdown were Terminal state threaded into the TerminalView ctx, so every connecting session (hidden tabs and startup restores included) re-rendered Terminal + TerminalView up to six times a second. Terminal now only publishes the timeout deadline and real progress events; the connection dialog animates and counts down locally (connectionTicker.ts). HostConnectionTestDialog keeps passing progress/timeLeft as before. - Monitor runtime: polled every second unconditionally and woke every subscriber each time because takenAt always changes. It now polls at 1 s only while something is monitored (here or in another window), 10 s otherwise, and skips notifying for unchanged idle replies. - Auto-reconnect progress log: capped at the newest 300 lines (it grew by a few lines every 5 s retry for as long as an outage lasted). - App Lock: report activity at most once a second instead of an IPC per keystroke / wheel tick / pointer event. - Tray/Dock: the renderer resends hosts only when the host list changed, and the main process rebuilds the macOS Dock menu (sort + one native item per host) only then, not on every session status change. Real app, profiling build, main -> this change: 3 SSH sessions connecting (3 s) 14 commits / 35.3 ms -> 8 / 1.7 ms idle (10 s) 13 commits / 3.1 ms -> 2 / 0.1 ms Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(terminal): update observe-popup reconnect deps assertion for capped progress logs CI failed because #4118 wrapped setProgressLogs in useCallback to apply capConnectionProgressLogs and added it to scheduleAutoReconnect deps. The observe-popup source assertion still expected the old deps list. The attachExistingSession early-return behavior is unchanged; only the stale dependency regex needed updating. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * perf(state): stop handler churn on session updates and repeated JSON work (#4121) * perf(state): stop handler churn on session updates and repeated JSON work - Shell handlers: AppSideEffects registers ~58 glue callbacks for the Host islands. Several close over sessions/workspaces/hosts (split/copy/duplicate, close tabs, delete host, keyboard-interactive, connect...), so every session status change and host update (connect bursts, last-connected times) re-notified the bridge and rebuilt all four shell bags, re-rendering AppView and TopTabs. They are now registered behind per-key stable wrappers that call the latest implementation (stabilizeAppHandlers); local callbacks and their effects are unchanged. All registered entries are actions, setters or refs, never read during render. - Session actions: moveFocusInWorkspace, copySession and copyWorkspace read workspaces / orphan sessions / log views through refs at call time (the same snapshot the closure captured), so they keep a stable identity. Getters read during render (isBroadcastEnabled, getOrderedWorkTabs, ...) are untouched. - AI history: the live store was parsed five times when the AI state root mounted; parseSessionsStore parses once per call (two parses total). - AI history writes: the synced branch serializes once and reuses the string for the disk mirror, and rewriting the same immutable sessions array (save path, then cloud-sync collection) is skipped while storage still holds that exact write in the same mode. - Command history: saving after each Enter parsed the whole store (up to 10k entries) only to read its clear generation, and every other window parsed it again on the storage event. The generation is now serialized first and read from the raw string (full parse only to adopt a peer clear), and the debounced write runs when the renderer is idle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: retrigger CI after cancelled lint-and-test run Previous lint-and-test was cancelled mid-run. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: binaricat <binaricat@users.noreply.github.com> * chore: fix outstanding ESLint warnings (#4112) * chore: fix outstanding ESLint warnings - useSftpFollowTerminalCwd: drop activeSessionId/focusedSessionId from the syncFollowToTerminalCwd deps; the callback reads them through refs and the only consumer effect already re-runs on those ids. - useSftpPaneDialogs: list the stable setShowDeleteConfirm callback in the handleDelete/openDeleteConfirm deps. - csvProxy: remove the unnecessary `\[` escapes inside character classes (same matches under the `u` flag). - Remove unused test imports/variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: retrigger CI after runner SIGTERM cancel Previous lint-and-test was cancelled by runner shutdown, not a real failure. * chore: retrigger CI after second runner cancel Lint had already passed; plugin-contract step was cancelled by the runner. * chore: retrigger CI after third runner cancel Lint and schema steps passed; plugin-contract step was cancelled by the runner again. Empty commit to re-queue lint-and-test. * chore: retrigger CI after repeated runner cancel plugin-contract step keeps being cancelled by the Actions runner (not a test failure). Empty commit to re-queue; Actions rerun API denied for this PAT. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: binaricat <binaricat@users.noreply.github.com> * perf: add opt-in startup timeline and real-app startup harness (#4114) * perf: add opt-in startup timeline and real-app startup harness - electron/perfTrace.cjs records first-occurrence startup marks in the main process when NETCATTY_PERF_TRACE=1 (a no-op otherwise), then writes the main-window renderer timeline (navigation, paint, netcatty:* marks, JS heap) and app.getAppMetrics() to JSON after the first renderer-ready signal. - Marks: main.cjs entry / modules loaded / whenReady, main window creation, registerBridges and plugin-host start/end, loadURL, did-finish-load, renderer ready, window shown. The renderer adds three performance.mark() calls (entry evaluated, App mounted, renderer ready), also visible in DevTools. - scripts/perf-startup.live.cjs (npm run perf:startup) launches the built app N times against a throwaway --user-data-dir profile with ssh:// deep-link registration disabled, optionally seeds synthetic hosts over CDP, and reports cold plus warm p50/p90. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * perf(harness): add --profile option to reuse a startup profile Lets the harness keep one profile across invocations, e.g. to compare warm V8 code caches across builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: retrigger CI after flaky monitorRuntimeIsolation failure Previous lint-and-test failed on known-preexisting `useEffect is not defined` in monitorRuntimeIsolation.test.ts. * chore: retrigger CI after monitorRuntimeIsolation useEffect flake Known pre-existing flake: monitor controls test fails with `useEffect is not defined`. Empty commit to re-run once. * test(app): bind React hooks in monitorRuntimeIsolation VM sandbox Extracting component declarations drops their React imports, leaving bare hooks such as useEffect undefined in the VM. Inject common React hooks and APIs while preserving explicit binding overrides to prevent intermittent monitor isolation failures in CI. Stub the startup performance mark through App test bindings so the mount effect can execute without browser globals. Production components remain unchanged. Validation: monitorRuntimeIsolation passed five consecutive runs. Plain npm run lint found 17 existing errors in git-ignored scratch files; excluding only _t.mjs and sim-4107.mjs passed with zero errors and eight existing warnings. * chore: retrigger CI after plugin-contract runner cancel Lint/schema passed; plugin-contract step cancelled by the runner (not a test failure). Empty commit to re-queue. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: binaricat <binaricat@users.noreply.github.com> * perf(main): stop blocking the first window on validator compilation (#4115) The main process ran ~1.4 s of synchronous work in registerBridges before the main window could start loading (app:// assets are served from the main thread too), even for users without plugins: - contractValidator: every createDefinitionValidator() built a fresh Ajv instance and re-registered the 200 KB plugin contract (~17 ms each, ~90 of them across the plugin host at startup, plus one per plugin view resource request). Share one Ajv per process, compile each definition on first use and memoize it; each validator still exposes its own `.errors`. - distributionSnapshot: compile the three distribution schemas lazily on the shared contract Ajv instead of a second Ajv at module load (273 ms -> 37 ms). - pluginBridge: hoist the PluginViewResourceRequest validator to module scope. - cloudSyncBridge: load webdav / @aws-sdk/client-s3 / @smithy/node-http-handler on first sync instead of at startup (108 ms -> 4 ms). - app:// scheme: enable codeCache so V8 reuses compiled renderer bundles across launches and windows. A same-length in-place edit of the cached entry chunk runs the new code, so stale cache is not reused after upgrades. Startup harness (2000 hosts, 10 runs, warm p50): registerBridges 1421 -> 116 ms, plugin host 871 -> 30 ms, renderer ready 2147 -> 723 ms, total memory 923 -> 823 MB. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(ai): keep sessions past 2MB localStorage budget via overflow (#4123) Urgent fix for #4123: retain AI chat history past the 2MiB primary localStorage budget via overflow chunks + pre-split disk backup, with disk-only recovery markers, aggregate-quota degradation, import live-state retention, and count-cap marker resolution. Gate: local Codex CLEAN (no P1) on 084ed813; CI green on acabe0bbc; Electron smoke PASS (pr-4124-acabe0bbc). Residual P2s noted (cross-window reconcile; vault-restore marker clear; retention-cap during pending recovery). No release. * perf(renderer): cut the startup bundle by a third (#4120) * perf(renderer): cut the startup bundle by a third Every window parsed ~6.1 MB of JavaScript before the first render. The entry chunk carried all five UI locales, and the whole AI SDK chunk was preloaded even though the AI panel is lazy. - i18n: only English stays in the entry; other dictionaries load on demand (plus their same-base fallback, e.g. zh-TW -> zh-CN). index.tsx awaits the saved language before the first render, and I18nProvider re-renders when a runtime switch finishes loading. - AI runtime: aiStateSnapshots cleaned up chats through getAgentRuntime(), and the plugin AI/agent hosts created their runtimes on mount, which pulled the Catty harness and @ai-sdk providers into startup. Cleanup now goes through a light handle that the runtime registers (the reversible privacy flag and main-process privacy mapping are still cleared without a runtime), and both plugin hosts create their runtime on the first request, re-checking liveness after the async load. - Chunking: manualChunks' object form also moved Vite's dynamic-import preload helper into vendor-ai (the AI SDK itself uses import()), so the entry imported it from there and vendor-ai (649 KB) was preloaded on every launch. Vendor chunks now use the function form and the helper gets its own 1 KB chunk. - jsqr is loaded when a QR image is imported instead of with the host editor. - startupBundle.architecture.test.ts guards these invariants. Startup JS (index.html): 5.29 MB entry + 649 KB vendor-ai + 138 KB radix -> 3.80 MB entry + 1 KB helper + 174 KB radix (-35%). Startup harness, 2000 hosts, 10 runs, warm p50: loadURL -> renderer entry evaluated 321 -> 207 ms, loadURL -> renderer ready 481 -> 323 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(i18n): preload locale messages before static rendering * test(i18n): preload locales in remaining zh-CN UI tests Non-English dictionaries now load lazily, so I18nProvider can initially render English before its effect finishes loading zh-CN. Explicitly await loadLocaleMessages before rendering these localized UI tests to fix the remaining CI failures without timing-based waits or production changes. * chore: retrigger CI after locale preload fix Previous tip 38108ce66 was on the branch but the PR head stayed stuck on d49ad024e after a GitHub 500 during push. Empty commit to refresh the PR head and re-queue checks. * chore: retrigger CI after plugin-contract runner cancel --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * perf(terminal): cache ligature font parses across terminals (#4126) * fix(pty): forward childProcesses queries to terminal worker (#4127) Worker-owned PTY sessions register their PIDs in the worker, leaving the main process map empty during close-busy checks. Forward child-process queries to the terminal worker and register a worker handler for string and object payloads. Fall back to the main process tree if the worker is unavailable or returns a non-array result. * fix(ui): keep follow-system themeSource from chrome override (#4131) When Interface Theme is Follow System, chrome refresh called setTheme(light|dark) and locked nativeTheme.themeSource, so OS appearance flips no longer updated the UI. Keep setTheme('system') on system chrome preference. Fixes #4130 Gate: GH Codex CLEAN on |
||
|
|
c01d057a7d |
fix(mcp): recognize Oh My Zsh ➜ idle prompts (#4079)
* fix(mcp): recognize Oh My Zsh ➜ idle prompts Oh My Zsh robbyrussell paints idle prompts like `➜ ~` / `➜ ~ git:(main) ✗`. The POSIX idle whitelist never matched leading Unicode ➜, so MCP terminal_execute stayed SHELL_NOT_READY after a session switched into zsh. Accept common robbyrussell ➜ lines (two-space theme form and `➜ ~`) and still reject pending input and bare ➜. Fixes #4078 * chore: retrigger CI after unrelated PluginAIContextHost flake * chore: retrigger CI (lint-and-test hung after cancelled plugin-verify step) * chore: empty commit to retrigger CI --------- Co-authored-by: binaricat <binaricat@users.noreply.github.com> |
||
|
|
cd6e1c6990 |
fix(mcp): recognize Powerlevel10k ❯ idle prompts (#4076)
Powerlevel10k paints idle prompts like `~ ❯` / `alice@host ~/src ❯`. The POSIX idle whitelist never matched Unicode ❯, so MCP terminal_execute stayed SHELL_NOT_READY while bash `$` worked. Accept common p10k ❯ lines and still reject pending input and bare ❯. Fixes #4075 |
||
|
|
631d04b654 |
Fix Deck parenthesized prompt readiness (#4029)
* fix: recognize parenthesized Deck shell prompts * fix: recognize Deck prompts with special path characters |
||
|
|
e98e236d54 |
fix(ai): recognize macOS zsh default prompts for PTY readiness (#3980)
Continuation of #3969 by @hexart (Joseph Hau). Preserves original commit recognition and adds spaces / %#→# coverage so idle macOS zsh terminals accept AI commands. Codex CLEAN (gpt-6.1-terra) vs main. CI green. No release. Co-authored-by: Joseph Hau <hexart@gmail.com> |
||
|
|
a0cf2b487c |
fix(mcp): recognize Oh My Zsh ys two-line idle prompts (#4008)
The two-line idle prompt check only accepted a classic user@host host line, so Oh My Zsh ys (`# user @ host ...` then a bare $/#) never became ready and terminal_execute sent nothing. Match that host line narrowly and still reject a lone marker. Fixes #4007 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> |
||
|
|
04ee9afa7f |
fix(mcp): match two-line idle prompts against live PTY CR bytes (#3963)
Related #3958 / follow-up to #3961. hasExpectedPromptSuffix must match live PTY \r\r\n against a cached two-line idle prompt (CR→LF form) so cancel/completion matching works after readiness. No release / no tag. |
||
|
|
32e75b6ace |
fix(mcp): recognize two-line user@host idle prompts (#3961)
Fixes #3958. extractTrailingIdlePrompt now accepts two-line user@host[:path] + bare $/ # idle prompts (including CR-normalized live PTY form) so MCP terminal_execute getReadyPrompt no longer times out. No release/tag. |
||
|
|
8d15a29bc6 |
fix(mcp): recognize Python env-prefixed idle POSIX prompts (#3948)
Idle SSH Bash prompts that start with a Python virtualenv, conda, or BT-panel name such as `(3.12.12) ` were not recognized. Recognition now strips one optional leading `(name) ` prefix, then tests the existing POSIX and Alpine prompt patterns. Fixes #3947 |
||
|
|
62798393c3 |
fix(mcp): send commands when a PowerShell prompt is only visible (#3928)
Fixes #3927 Gate: Codex thrash (mid-CSI truncate edge) after real P2 alt-screen fix; CI lint-and-test red only on unrelated TERM-SSHD flake; smoke PASS /workspace/netcatty-smoke-shots/pr-3928-20261025-223624. |
||
|
|
d382f7bd4f |
fix(ai): recognize Alpine default shell prompts (#3925)
Recognize Alpine ash default host:path prompts (e.g. localhost:~# ) so AI/pty exec readiness accepts idle Alpine sessions without changing PS1. CI lint-and-test red on tip was unrelated: TERM-SSHD failed transfer releases the physical channel (transferBridge.termSshd.test.cjs). Local shellUtils + readiness suite and synthetic Alpine prompt smoke PASS. |
||
|
|
c44633231a |
fix(mcp): recognize RHEL-family bash prompts as idle (#3915)
Extend POSIX_PROMPT_PATTERN for Oracle/RHEL/CentOS/Fedora [user@host path][#$] (incl. whitespace and ] in \W). Fixes #3914. |
||
|
|
1e79dadbe5 | fix(ai): let the Copilot SDK own its native runtime directly | ||
|
|
d298275378 | Merge remote-tracking branch 'origin/main' into codex/pr-3624-fix | ||
|
|
b81b27f817 | fix(ai): preserve terminal replies between OSC contexts (#3678) | ||
|
|
6a79400112 |
fix(ai): address review feedback on the model catalog PR
- keep an already-qualified {provider, model} default in getOpenCodeDefaultModelIds
instead of prefixing the provider twice
- resolve npm's copilot.ps1 wrapper to the JS entry on Windows like .cmd/.bat
- when serving a last-known-good catalog, remap a persisted current id that has
no row to the first visible row for every backend (null still means default),
so the picker and the send preflight agree
- reconcile the catalog warning banner from the result of every refresh, so a
panel that joined another panel's in-flight load also shows it
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SX3d2XMHxBEpU7VqpvXbdm
|
||
|
|
258d72bdca |
fix(ai): restore copilot loader-first resolution and add copilot/mimo preset fallbacks
Revert d2b1d5fa2's default preference of the native copilot.exe: the 1.0.59-era native CLI bootstraps %LOCALAPPDATA%\copilot\pkg\ on first start, starts slowly, and leaves a conhost child alive after app-side timeout/abort (console window stays open; CLI server exited unexpectedly with code 0). Loader-first (npm-loader.js) is the default again; the native binary is opt-in via NETCATTY_COPILOT_PREFER_NATIVE=1. Also: - Add COPILOT_MODEL_PRESETS (auto) so a live listModels failure no longer leaves the Copilot picker empty. - Sync MIMO_MODEL_PRESETS to the 6 verified live-catalog models (v2.6/v2.5 pro-ultraspeed/pro/flash); auto channel stays filtered driver-side. - Reap the Copilot CLI child on abort/stop: stopCopilotClient() races graceful client.stop() with a 3s grace and falls back to the SDK's forceStop() (SIGKILL) so the spawned process does not linger. |
||
|
|
d2b1d5fa20 |
fix(ai): prefer the native copilot.exe over npm-loader.js in SDK resolution
npm-loader.js re-spawns the native binary via spawnSync WITHOUT windowsHide, flashing a console window when the Copilot SDK runs inside Electron's GUI main process on Windows. When the platform-native binary (@github/copilot-<platform>-<arch>/copilot.exe) exists next to the resolved package, hand it to RuntimeConnection.forStdio directly — the SDK spawns it itself with windowsHide:true. Fall back to npm-loader.js when the native package is absent (e.g. optional deps omitted). |
||
|
|
f0169ad632 |
fix(ai): resolve copilot .cmd shim before spawning SDK
RuntimeConnection.forStdio({ path }) makes the Copilot SDK spawn the
CLI through node WITHOUT shell:true. Windows npm installs expose
copilot as a .cmd shim, and Node >= 18.20 throws spawn EINVAL for
.cmd/.bat in milliseconds, so listCopilotModels()/runCopilotTurn()
could never start the runtime via the PATH-resolved shim.
Add resolveCopilotExecutableForSdk() to shellUtils (same per-CLI
resolver pattern as claude/codex/codebuddy): resolve the shim to the
package's real npm-loader.js entry via the npm layout shortcut, then
by parsing the shim, and pass .exe/.js entries through unchanged.
Apply it at both RuntimeConnection.forStdio call sites; unresolvable
shims keep the original path so behavior is unchanged.
Harness: PATH-resolved copilot.cmd -> npm-loader.js, catalog [auto]
returned in 3.0-3.6s (was: EINVAL in 1-2ms, empty catalog).
|
||
|
|
3a0528bbd4 |
fix(terminal): bound asynchronous Windows PATH refresh (#3608)
* fix(terminal): bound asynchronous Windows PATH refresh Replace blocking per-terminal registry queries with parallel async reads, a one-second deadline, and a shared five-second snapshot. Preserve machine before user PATH ordering and place guessed CLI directories last. Retain per-hive successful values when registry reads fail, and honor explicit PATH overrides without querying the registry. * fix(terminal): cancel pending local starts through boot epochs Register the existing pending boot controller before awaiting PATH refresh. Honor tab close and reconnect cancellation before spawning, and clear only the matching controller so stale completion cannot erase a newer boot. Regression tests reproduce both the closed-tab PTY spawn and stale-close ownership failures against the prior revision. * fix(terminal): abort pending starts before worker close queue Propagate an owned close to the existing pending boot controller before waiting for its serialized start. Keep transport cleanup ordered and keep stale boot-epoch closes from cancelling replacements. Exercise both fire-and-forget and awaited close messages through the real worker dispatcher and local-session bridge with a controlled PATH wait. * fix(terminal): cancel superseded worker starts before queuing Signal the existing boot-abort controller when a replacement arrives, reject stale boot epochs, and recheck queued epochs before startup. Only the latest reconnect may spawn after a pending PATH refresh. Cover repeated reconnect requests and delayed old starts/closes through the real worker dispatcher and local-session bridge. |
||
|
|
025ce741c2 |
fix(terminal): refresh local session PATH from the Windows registry (#3470)
A local terminal inherited the PATH snapshot the Electron main process captured at launch. A GUI-launched or auto-started Netcatty keeps that snapshot for its entire lifetime, so a CLI installed or upgraded afterwards is missing inside Netcatty while resolving fine in an external cmd/PowerShell. The upgrade case is the worst: installers that rewrite a versioned user-PATH entry leave the captured entry pointing at a directory the upgrade deleted, so the command disappears entirely. Reuse the registry re-read the AI harness already performs for its shell env. resolveWindowsLivePath() merges the HKCU/HKLM PATH (with %VAR% expanded) and the well-known npm/pnpm/Yarn bin dirs ahead of the captured PATH, and buildLocalSessionEnv() applies it to local sessions on Windows only, degrading to today's behaviour off Windows or when the registry cannot be read. An explicit PATH in the session payload is never widened, and PATH/Path duplicates are collapsed so the effective value stays deterministic. |
||
|
|
2f701c1605 |
fix(ai): detect Cursor CLI login on Windows cmd shims
Settings → AI → Cursor Check ran `cursor-agent status` via execFileSync on the path from `where`, which is a .cmd installer shim. Node cannot spawn .cmd files directly (EINVAL), so the probe reported logged-out even when the terminal showed authenticated. Run the status probe, turns, and model listing through the existing Windows shim spawn helper, without unwrapping cursor-agent.cmd to node.exe (that would drop index.js). Also accept status JSON wrapped in cmd noise. Closes #3003 |
||
|
|
a9faf92494 | fix: address Codex review on PR #2960 | ||
|
|
730203c84a | fix(#2959): automated Cursor CLI fix | ||
|
|
3b3145358d |
fix(ai): resolve nvmd Windows Codex shims to native codex.exe (#2032)
Settings can probe ~/.nvmd/bin/codex.cmd, but the SDK path needs the real native binary under versions/<ver>/. Without that override, packaged builds fall back to optional platform deps we deliberately exclude. Fixes #2027 Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
6cb68bf6fc |
Run agent commands in a subshell so failures cannot close the session (#1945)
* Run agent commands in a subshell so failures cannot close the session
Agent-generated commands were eval'd directly in the user's active login
shell, so a generated script containing `set -e` (or `exit`) terminated
the whole SSH session on the first failure. Wrap the eval in a subshell
unconditionally instead of trying to detect dangerous commands — the
detection approaches from PRs #1852/#1882 grew into shell parsing and
were abandoned. Output stays live in the user's terminal; the trade-off
is that cd/export no longer persist between calls, which the tool
descriptions now tell the model about.
Also fix multi-line command display: synthetic echo now normalizes line
breaks to CRLF (no more staircase indentation in xterm), and the POSIX
wrapper rebuilds newlines via printf so the typed command stays on one
physical line and PS2 continuation echoes ("> ...") no longer leak past
the marker filter.
Fixes #1850
Co-authored-by: Cursor <cursoragent@cursor.com>
* Move shellUtils require to module scope in cattyExecHandlers
The inline require("./ai/shellUtils.cjs") inside the with(ctx) block did
resolve correctly at runtime (bare `require` hits ctx.require, based in
electron/bridges/), but the path only works through that indirection and
reads as wrong relative to this file. Require at module scope with the
unambiguous ../ai path instead.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
|
||
|
|
66de2db912 | Fix CodeBuddy Windows CLI discovery (#1448) | ||
|
|
7b4f046001 |
[codex] Optimize AI settings agent performance (#1416)
* Optimize AI settings agent performance * Address AI settings review feedback * Retry interrupted agent discovery * Harden agent CLI probe timeout cleanup * Avoid duplicate agent discovery retries * Ensure timed-out CLI probes are killed |
||
|
|
ba784b8b35 |
fix: resolve .cmd shim to native exe on Windows to avoid spawn EINVAL (#1350) (#1351)
Windows + Node >= 24: spawning .cmd files with shell=false causes EINVAL. Claude Code v2.1.169 ships as native binary (no cli.js), npm global install creates only claude.cmd. Netcatty detected claude.cmd but spawned it with shell:false -> EINVAL. Changes: - resolveWindowsShimToNativeExe: new function that reads .cmd/.bat shims and resolves to the real .exe using "%~dp0\...\*.exe" pattern matching - prepareCommandForSpawn: tries native exe resolution first, falls back to shell:true wrapping - resolveClaudeCodeExecutableForSdk: when cli.js not found, looks for bin/claude.exe native binary - 3 new tests for shim resolution and spawn spec - Codex CLI unaffected (already handles native exe resolution) Test: 38/38 shellUtils tests pass, npx tsc --noEmit clean |
||
|
|
3662b45121 |
fix(ai): resolve Windows Codex npm shims before SDK spawn (#1337)
* fix(ai): resolve Windows Codex npm shims before SDK spawn Codex SDK spawns codexPathOverride without shell:true, so passing codex.cmd triggers spawn EINVAL on Node 18+. Rewrite npm shims to the native codex.exe (mirroring #1102 for Claude) on SDK paths only. Fixes #1101 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ai): drop unused ctx export and restore test file encoding Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ai): harden Windows Codex SDK executable resolution --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
3fc56df111 | refactor(ai): migrate agent backends from ACP to official SDKs (claude/codex/copilot) (#1229) | ||
|
|
456ddcfe68 |
chore(ai): upgrade ACP packages and unwrap Skill+CLI command in tool-call panel (#1128)
* chore(ai): upgrade ACP packages and unwrap Skill+CLI command in tool-call panel
Package bumps:
- @zed-industries/claude-agent-acp 0.22.2 → @agentclientprotocol/claude-agent-acp 0.37.0
(old npm package is deprecated; scope rename)
- @zed-industries/codex-acp 0.10.0 → 0.15.0
- @mcpc-tech/acp-ai-provider 0.2.8 → 0.3.3
- electron-builder asarUnpack glob + bridge require.resolve switched to the new scope
After the upgrade Codex tool-call cards started showing the local
worktree path for every step — "Run /Users/.../netcatty-tool-cli session
--session …" — instead of the remote command. Three things lined up:
1. The new acp-ai-provider maps ACP's `title` to `toolName`, and Codex's
title is the full shell invocation it's about to run.
2. Codex local_shell ships args as ["/bin/zsh","-lc","<full>"], so the
old `typeof args.command === 'string'` branch in ToolCall never fired
and we fell through to printing `name` (i.e. the title).
3. The bridge serializes tool args under `args`, but the ACP adapter
only read `event.input`, so even when args were available the
renderer received {}.
Fixes:
- acpAgentAdapter: read tool input from both `event.input` and
`event.args` so bridge-serialized chunks and direct AI SDK chunks
both work.
- ai-elements/tool-call: new extractDisplayCommand() unwraps the shell
array, then the netcatty-tool-cli wrapper (exec/job-start … -- <cmd>),
and renders the real remote command. session/env/job-poll/etc. fall
back to short labels ("netcatty: inspect session", …) instead of
exposing the binary path.
- shellUtils.cjs: defensive JSON-parse the ACP wrapper input in case
the AI SDK ever stops auto-parsing it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(build): exclude bundled Claude CLI binaries from the installer
@anthropic-ai/claude-agent-sdk@0.3.x bundles the native Claude Code CLI
(~211MB per arch) as optional sibling packages. Including them would
silently regress Netcatty's "bring your own Claude" design — the project
has always required users to install Claude Code locally, and the entire
path-discovery flow exists precisely to honor that contract:
- useAgentDiscovery.ts scans the user's PATH for `claude` and writes
the absolute path into the agent config's CLAUDE_CODE_EXECUTABLE env.
- aiBridge.cjs runs normalizeClaudeCodeExecutableEnvForAcp on every ACP
spawn, forwarding the env var to the child process.
- The @agentclientprotocol/claude-agent-acp wrapper's claudeCliPath()
(acp-agent.js) prefers process.env.CLAUDE_CODE_EXECUTABLE over the
bundled binary and only falls back to sibling-package resolution when
the env var is empty.
So the right place to enforce the design is electron-builder: exclude
node_modules/@anthropic-ai/claude-agent-sdk-* from `files`. Dev mode is
unaffected (optional deps still install for `npm run dev`); only the
packaged installer drops the binaries, saving ~150MB. Users without
Claude Code installed get the same SDK error they got pre-upgrade.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
2a283a4f83 |
fix(ai): run bundled claude-agent-acp via Electron's Node (#1127)
@zed-industries/claude-agent-acp ships dist/index.js with a `#!/usr/bin/env node` shebang. We bundle the package and unpack it from asar, but Windows ignores the shebang entirely and macOS/Linux only honours it when `node` is on the user's PATH. When `node` was missing, the resolver fell back to spawning the bare `claude-agent-acp` command, which only works if the user manually ran `npm install -g @zed-industries/claude-agent-acp` — see #1118. Run the bundled script through `process.execPath` with `ELECTRON_RUN_AS_NODE=1` (matching `resolveMcpServerRuntimeCommand` in the MCP server bridge) so the embedded Electron acts as the Node runtime. This makes the bundled copy work with zero external deps on every supported platform. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
1aa96c3490 | Fix Claude ACP Windows shim launch (#1102) | ||
|
|
a91fbcdd68 |
fix #1062: treat SSH shell TMOUT auto-logout as a timeout, not a normal exit (#1067)
* fix #1062: treat SSH shell TMOUT auto-logout as a timeout, not a normal exit A shell-level TMOUT idle auto-logout makes bash/csh exit cleanly (numeric exit code, no signal), which is byte-for-byte indistinguishable from a user-typed `exit` at the SSH protocol level. PR #1057 keyed the close-vs-keep decision on `streamExited` (numeric code + no signal), so TMOUT exits were reported as reason "exited" and the tab was auto-closed — reintroducing the problem from #977. Verified against a real server that bash TMOUT exits with code 0 / no signal and prints "timed out waiting for input: auto-logout" to the channel before it closes. Since exit code/signal can't distinguish it from an intentional exit, detect that banner in the session's existing rolling output tail (_promptTrackTail) and report reason "timeout" instead, which routes to the existing markDisconnected path (keep tab + reconnect). A normal `exit`/`logout` (no "auto-" prefix) still auto-closes the tab, so PR #1057's behavior is preserved. zsh's TMOUT raises SIGALRM (a signal), so it already took the keep-tab/reconnect path and is unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Anchor TMOUT auto-logout match to the banner's final line (Codex review) The detector matched "auto-logout" as an unanchored substring within the last 256 chars, so command output that merely mentions it (e.g. `grep auto-logout /etc/profile` while investigating TMOUT) followed by an intentional `exit` could be misclassified as a timeout and wrongly keep the tab open. Anchor on the final non-empty line of output instead — the banner the shell prints right before exiting — which loses no true positives (verified against the real-server output shape) while rejecting mid-stream mentions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
4ced32257e |
fix: handle Windows agent paths with spaces
When the executable file is installed in a directory containing spaces, the Codex and Claude path/version detection do not work. |
||
|
|
470d9b5aae | [codex] Improve ACP agent error diagnostics (#880) | ||
|
|
d1e6857f76 |
Drop stale lastIdlePrompt before forcing PowerShell wrapper (#852)
Follow-up to #851 (Codex review comment on
|
||
|
|
eccb9f2cfc |
[codex] Fix PowerShell MCP command execution (#851)
* Fix PowerShell MCP command execution * Harden PowerShell prompt detection and document its scope - Annotate isPowerShellPrompt and the matching regex in shellUtils with a "default prompt only" caveat, so future readers know custom prompt themes (oh-my-posh, starship, custom prompt functions) are out of scope on purpose, and keep the two regexes in sync. - Cover edge cases that the original tests left implicit: trailing whitespace after the `>`, ANSI-coloured prompts, bare `PS>` with no working directory, empty/undefined inputs, and command output that merely starts with `PS` (e.g. `PSO>`, `ZIPS>`) so we don't regress into mis-wrapping non-PowerShell sessions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Address multi-agent review findings on PowerShell prompt detection - Refuse to override an explicit non-PowerShell shellKind. The override is only useful when the session has no confirmed shell type (the issue #841 case is an SSH session, where shellKind is undefined). On a confirmed bash/zsh/fish session a malicious remote process emitting a `PS ...>` line could otherwise coerce one mis-wrapped command; this closes that foothold while still fixing the original bug. - Tighten the regex to /^PS(?:\s+\S.*)?>$/ so a literal `"PS >"` line is rejected. The default PowerShell prompt never emits that shape, so it's a clean spoof signal to ignore. - Treat `\r` as a line break, not a stripped character, when extracting the last idle line. PSReadLine / ConPTY emit bare `\r` to repaint the current line; without this, `"PS C:\\old>\rPS C:\\new>"` would match as one long doubled prompt that never round-trips through the live PTY tail. - Hoist the regex into shellUtils as `isDefaultPowerShellPromptLine` so prompt extraction and wrapper selection share one source of truth. - Drop a redundant optional-chain on `String.prototype.split().pop()`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Drop dead 'powershell' entry from override set; document shellKind universe Round-2 review noted that listing "powershell" in SHELL_KINDS_OPEN_TO_PROMPT_OVERRIDE was a no-op: when the configured shell kind is already powershell, the override path returns "powershell" on a match and the fall-through returns "powershell" on a miss, so the entry only mattered if reverse PS-to-POSIX detection were added later. Removing it makes the gate's intent ("override only when there's no confirmed shell type") obvious from the data alone. Also enumerate the full universe of shellKind values in a comment next to the set so the next reader doesn't have to grep terminalBridge and localShell.cjs to know what's excluded and why ("raw" sessions bypass buildWrappedCommand entirely; "cmd"/"fish" are confirmed and shouldn't flip to PowerShell on a spoofed remote line). Add a regression test that locks the current behavior for an explicit shellKind="powershell" session whose visible prompt looks POSIX (e.g. nested into WSL/bash) — we keep powershell wrapping. Lock this so a future maintainer doesn't accidentally introduce reverse detection without also handling the cross-shell quoting implications. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
4090483738 |
Fix Security Issues (#799)
* chore(deps): bump fast-xml-parser and @aws-sdk/xml-builder Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) and [@aws-sdk/xml-builder](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/packages-internal/xml-builder). These dependencies needed to be updated together. Updates `fast-xml-parser` from 5.3.4 to 5.5.8 - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.3.4...v5.5.8) Updates `@aws-sdk/xml-builder` from 3.972.4 to 3.972.18 - [Release notes](https://github.com/aws/aws-sdk-js-v3/releases) - [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/packages-internal/xml-builder/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js-v3/commits/HEAD/packages-internal/xml-builder) --- updated-dependencies: - dependency-name: fast-xml-parser dependency-version: 5.5.8 dependency-type: indirect - dependency-name: "@aws-sdk/xml-builder" dependency-version: 3.972.18 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump follow-redirects from 1.15.11 to 1.16.0 Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.11 to 1.16.0. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.11...v1.16.0) --- updated-dependencies: - dependency-name: follow-redirects dependency-version: 1.16.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump hono from 4.12.7 to 4.12.14 Bumps [hono](https://github.com/honojs/hono) from 4.12.7 to 4.12.14. - [Release notes](https://github.com/honojs/hono/releases) - [Commits](https://github.com/honojs/hono/compare/v4.12.7...v4.12.14) --- updated-dependencies: - dependency-name: hono dependency-version: 4.12.14 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump vite from 7.3.1 to 7.3.2 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.1 to 7.3.2. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v7.3.2/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v7.3.2/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 7.3.2 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump flatted from 3.3.3 to 3.4.2 Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2. - [Commits](https://github.com/WebReflection/flatted/compare/v3.3.3...v3.4.2) --- updated-dependencies: - dependency-name: flatted dependency-version: 3.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump minimatch from 3.1.2 to 3.1.5 Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump lodash from 4.17.23 to 4.18.1 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.23...4.18.1) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.18.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump @hono/node-server from 1.19.11 to 1.19.14 Bumps [@hono/node-server](https://github.com/honojs/node-server) from 1.19.11 to 1.19.14. - [Release notes](https://github.com/honojs/node-server/releases) - [Commits](https://github.com/honojs/node-server/compare/v1.19.11...v1.19.14) --- updated-dependencies: - dependency-name: "@hono/node-server" dependency-version: 1.19.14 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump rollup from 4.57.1 to 4.60.2 Bumps [rollup](https://github.com/rollup/rollup) from 4.57.1 to 4.60.2. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v4.57.1...v4.60.2) --- updated-dependencies: - dependency-name: rollup dependency-version: 4.60.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump electron from 40.1.0 to 40.8.5 Bumps [electron](https://github.com/electron/electron) from 40.1.0 to 40.8.5. - [Release notes](https://github.com/electron/electron/releases) - [Commits](https://github.com/electron/electron/compare/v40.1.0...v40.8.5) --- updated-dependencies: - dependency-name: electron dependency-version: 40.8.5 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump path-to-regexp from 8.3.0 to 8.4.2 Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) from 8.3.0 to 8.4.2. - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v8.3.0...v8.4.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-version: 8.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump picomatch from 2.3.1 to 2.3.2 Bumps [picomatch](https://github.com/micromatch/picomatch) from 2.3.1 to 2.3.2. - [Release notes](https://github.com/micromatch/picomatch/releases) - [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2) --- updated-dependencies: - dependency-name: picomatch dependency-version: 2.3.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump yaml from 2.8.2 to 2.8.3 Bumps [yaml](https://github.com/eemeli/yaml) from 2.8.2 to 2.8.3. - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](https://github.com/eemeli/yaml/compare/v2.8.2...v2.8.3) --- updated-dependencies: - dependency-name: yaml dependency-version: 2.8.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump @xmldom/xmldom from 0.8.11 to 0.8.13 Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.8.11 to 0.8.13. - [Release notes](https://github.com/xmldom/xmldom/releases) - [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md) - [Commits](https://github.com/xmldom/xmldom/compare/0.8.11...0.8.13) --- updated-dependencies: - dependency-name: "@xmldom/xmldom" dependency-version: 0.8.13 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump brace-expansion from 1.1.12 to 1.1.14 Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.12 to 1.1.14. - [Release notes](https://github.com/juliangruber/brace-expansion/releases) - [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.12...v1.1.14) --- updated-dependencies: - dependency-name: brace-expansion dependency-version: 1.1.14 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps-dev): bump tar from 7.5.7 to 7.5.13 Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.7 to 7.5.13. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/isaacs/node-tar/compare/v7.5.7...v7.5.13) --- updated-dependencies: - dependency-name: tar dependency-version: 7.5.13 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Security Fixes Security fixes: Added input validation for uncontrolled command lines. Added Proper Shell Escaping for useTerminalAutocomplete Fixed 4 race condition alerts by atomic stat+read(s) without following symlinks. Misc: Use Crypto randomness instead of Math.random() (Not a security issue but convenient) * Fix OS quirk fallbacks * Review fix - use lstat before open to skip FIFO/devices early to prevent blocks - SFTP skip UUID tag could be dubiously long * allow symlinks alongside regular files. * Use acutal target size for reading * Fix Destructed import / fix to use full shellEscape charset - Destructed import - Guard now matches full shellEscape charset * Supress Codex complaints Replaced manual fd.read with fs.promises.readFile(fd) to ensure complete file reads to EOF. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
1c9c4fcec3 |
fix: address second-round review feedback
- Extract fail-loud check to shared getCodexCustomConfigPreflightError so
the list-models handler (aiBridge.cjs:2149) enforces the same up-front
error as the stream handler. Previously a user whose config.toml
env_key was unexported would get the targeted message on chat send but
a generic "Missing env var" from model-list probes (once the probe was
rewired for Codex in a future change).
- Wire Settings "Refresh Status" to also invalidate the shell-env cache.
New invalidateShellEnvCache() helper in shellUtils; aiCodexGetIntegration
now accepts an optional { refreshShellEnv } flag; the button passes it
so a user who just exported OPENROUTER_API_KEY in their rc file can
click Refresh instead of having to restart netcatty.
- Declare authHash in CodexCustomProviderConfig (types.ts + global.d.ts)
so renderer TS actually sees the field instead of needing a cast.
- DRY the 360 magic number in ChatInput: extract
MODEL_PICKER_MAX_WIDTH, use it in both the className max-width and the
left-clamp math so the two can't drift.
- Move codexCustomConfigResolved useState declaration next to its
companion codexConfigModel, above the effect that invokes its setter,
and drop the duplicate declaration further down. Pure code-organization
cleanup but removes a use-before-declaration nit.
No functional changes beyond the fail-loud parity and the refresh-shell-env
path. ACP behavior when authMethodId is omitted still requires a
real-world OpenRouter config.toml validation, which the user is running.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
4b8b0ed74c |
fix: reject .app directories in CLI path normalization
normalizeCliPathForPlatform used existsSync which returns true for directories like /Applications/Codex.app. Added statSync.isFile() check on non-Windows platforms so .app bundles are not mistaken for CLI executables. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
0b2d1b613b | Tighten prompt fallback matching | ||
|
|
4971f18bbe | Fix AI terminal execution completion and tool UI | ||
|
|
cabc82e1df | Fix Windows Codex CLI resolution | ||
|
|
56a4fe905d |
fix: handle Windows spawn for Claude ACP bundled JS binary (#405)
* fix: handle Windows spawn for Claude ACP bundled JS binary
On Windows, child_process.spawn does not interpret shebangs, so spawning
a .js file directly (like claude-agent-acp's dist/index.js) fails with
ENOENT. The @mcpc-tech/acp-ai-provider uses raw spawn() internally.
Change resolveClaudeAcpBinaryPath to return { command, prependArgs } so
that on Windows the resolved .js script is invoked via process.execPath
(Node) with the script path prepended to args. On macOS/Linux the
shebang works natively so the script is spawned directly as before.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use system Node instead of process.execPath on Windows
In packaged Electron builds, process.execPath points to the app binary
(e.g. Netcatty.exe), not a Node runtime. Additionally, main.cjs deletes
ELECTRON_RUN_AS_NODE at startup and the agent spawn handler blocks it
in DANGEROUS_ENV_KEYS.
Resolve the real `node` from PATH instead. If Node is not installed,
fall back to the bare `claude-agent-acp` command name so the system
can find the npm-generated .cmd wrapper.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use script path for display and probe version correctly on Windows
In discovery, when resolveClaudeAcpBinaryPath returns { command: node,
prependArgs: [scriptPath] }, use the script path for UI display and
dedup, and probe version with the full command (node script --version)
instead of running node --version.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|
|
b17775307f |
fix: bundle claude-code-acp to prevent crash when binary is missing (#404)
* fix: bundle claude-code-acp to prevent crash when binary is missing (#400) When users select Claude Code in the AI module, the app spawns `claude-code-acp` via ACP. Previously only the `claude` CLI was checked during agent discovery, so if `claude-code-acp` was not on PATH the spawn would fail with ENOENT and crash the Electron main process. - Add `@zed-industries/claude-code-acp` as a bundled dependency - Add `resolveClaudeAcpBinaryPath()` that checks PATH first, then falls back to the npm-bundled binary (mirrors Codex pattern) - Use the resolver in both the primary and fallback ACP provider paths - Update agent discovery to detect agents via bundled ACP binary when the standalone CLI is not installed Closes #400 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add claude-code-acp and its deps to asarUnpack In packaged Electron builds, files inside app.asar cannot be executed by child_process.spawn. Add claude-code-acp and its runtime dependencies to asarUnpack so the binary is accessible in production. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: migrate from deprecated claude-code-acp to claude-agent-acp The @zed-industries/claude-code-acp package has been renamed to @zed-industries/claude-agent-acp (bin: claude-agent-acp). Update all references across the codebase: - package.json: replace dep with @zed-industries/claude-agent-acp@0.22.2 - electron-builder.config.cjs: update asarUnpack entries, remove stale deps (diff, minimatch) no longer needed by the new package - shellUtils.cjs: update binary name and require.resolve path - aiBridge.cjs: update acpCommand, ALLOWED_AGENT_COMMANDS, isClaudeAgent - settings types, i18n locales: update command references Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
4e26852482 |
feat: support multimodal attachments in AI chat (#397)
* feat: support multimodal attachments (images, PDFs, files) in AI chat Previously uploaded images were displayed in the UI but never sent to the AI model, and non-image files (PDF, text) were silently rejected. - Rename useImageUpload → useFileUpload; accept image/*, PDF, and text/* - Rename ChatMessageImage → ChatMessageAttachment with filePath support - Build multimodal SDK messages (ImagePart/FilePart) for Catty Agent - Fix ACP agent path: images inline, non-image files via local path hint so ACP agents (Claude Code, etc.) read them with native file access - Use Electron webUtils.getPathForFile() for reliable file path capture - Compact user message bubble padding Closes #294 (AI file upload issues) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: show real tool names in AI chat instead of ACP wrapper names - Unwrap ACP dynamic tool calls in serializeStreamChunk to extract real tool name, args, and toolCallId from chunk.input - Simplify MCP tool name prefixes (mcp__server__tool → tool) - Pass toolCallId from ACP tool-call events to match tool results - Prevent onToolResult from overwriting correct names with wrapper name - Build toolCallNames map in ChatMessageList for tool result display Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: backward-compatible fallback for legacy `images` field in chat messages Persisted sessions may still have `images` instead of `attachments`. Add `?? m.images` fallback in SDK message builder and renderer so historical image attachments are not silently dropped after upgrade. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: broaden file type support and handle pasted files without path - Accept all file types except video/audio (instead of allowlist) so .json, .yaml, .sh, etc. are not silently rejected - For ACP agents, save pasted/virtual files (no filePath) to temp directory so the agent can still read them Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use managed temp dir for pasted ACP attachments Use tempDirBridge.getTempFilePath() instead of manual os.tmpdir() path so pasted file attachments are tracked by the app's cleanup system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|
|
808d021ebe |
fix: address security, correctness, and performance issues from code review
- Use crypto.randomBytes for PTY markers instead of Math.random - Replace execSync with execFileSync to prevent command injection - Fix sftp_write_file missing safety check (pass path to guardWriteOperation) - Add IPC input validation for handleExec, handleSftpRead, handleMultiExec - Add maxBytes bounds validation in executor, tools, and MCP server - Fix approval race condition (clear ref after destructuring, strict messageId match) - Shorten API key plaintext lifetime in memory - Fix stream cancellation race with AbortController registered before request - Delay revokeObjectURL for download timing - Extract shared limitConcurrency to infrastructure/ai/concurrency.ts - Add execStream null check in execViaChannel Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |