* fix(port-forwarding): preserve exhaustion across duplicate failures
* fix(port-forwarding): reset exhausted state on active adoption
* fix(port-forwarding): confirm adoption before clearing exhaustion
Add a Move to group action for the selected hosts, reusing existing group moves and saving the selection once. Omit the hidden synthetic General destination.
Related to #3194; marquee selection and dragging a selection are outside this change.
65 focused checks, lint, build and real grid/list mouse/keyboard/cancel/reload/single-host drag checks pass. Current-head remote review and both CI jobs pass.
Preserve the original local shell name and icon when a saved host is edited and a terminal is copied.
Related to #3615 and #3616.
Validated with 70 focused checks, lint, production build and actual terminal copy flows. Current-head remote review and CI pass.
Related to #3615 (stays open: hiding/restoring running sessions is separate work).
Merged by judgment after ~49 Codex findings; remaining P2 (Copy Tab name/icon snapshot when host shell is edited after launch) is a cosmetic edge case for a follow-up.
Report a closed SFTP channel instead of leaving a download waiting for a source-file open callback that cannot arrive. Keep existing upload and reconnect policies.
Related to #3406. The original connection-loss cause and reporter environment remain unconfirmed; keep the issue open.
Validation: 42 download checks and 7 lifecycle/cancellation checks; real 1 GiB normal download, pause/continue, and interrupted retry with full checksums; exact-head Codex review clean; current test and four platform package jobs successful.
Keep the initial live-shell probe short and omit unused Bash history-cleanup input after a confirmed zsh reply. Preserve the existing bounded task wrapper, Bash cleanup, history and cancellation behavior.
Related to #3575. This repairs a confirmed controlled failure; the reporter-specific startup contrast remains open for confirmation and release delivery.
Validated through real configured zsh and Bash terminals, quoted/multiline and 3,000-character commands, the complete local test suite, exact-head Codex review and current automated checks.
Match host reuse to the actual Telnet login, ET hop ports and serial/local session settings. Preserve already-scoped reconnecting tabs when other sessions remain live, and reject Telnet proxy settings consistently before reusing a connection.
Follow-up to #3614. Related to #3613; no claim of a released fix or full PR3616 inherited-default coverage.
Validated with focused checks, real Electron/TCP Telnet connections, build/lint, exact-head Codex review and current automated test/package checks.
Handle unsupported copyFile operations on writable GVFS/FUSE destinations using the existing exclusive bounded copy path. New files accept the mount's creation permissions; replacing an existing file still requires equivalent protection, and failures retain recoverable data.
Only explicitly optional permission/timestamp updates may tolerate permission refusal. Content writes, close errors, required protection, and rollback preservation remain strict. Current-head review and required checks were verified before merging.
Related to #3611. Keep the report open pending delivery and actual environment confirmation.
Allow ssh2 to continue to another authentication method when a system SSH agent is unavailable, for both target and jump-host connections. Keep the authentication deadline and fatal-error handling intact.
Validated with real SSH servers and Unix agent sockets through normal terminal startup, including forwarding, successful password fallback, real authentication failures, and timeouts. 118 focused checks and lint passed. Current-head review and required CI were checked before merging.
Related to #3640. Keep the report open for the reporter's environment and delivery validation.
Report transport closure without inventing a successful remote exit status, while preserving any actual exit code or signal already received. Reuse the existing exit classification to keep normal exits from being treated as reconnectable disconnects.
Related to #3631. This changes the diagnostic message only; the frequent-disconnection report remains open.
Validation: 458 focused checks, lint, production build, real Electron/local SSH disconnect workflow, current-head Codex review, and repository CI passed.
hasExpectedPromptSuffix ran for every PTY chunk and normalised the whole
retained output (up to 256K chars of ANSI/CR stripping) just to test whether
it ends with the prompt. During an output flood with CRLF line endings that
kept the terminal worker busy for seconds at a time, delaying cancel
requests, timers and keepalive handling (#3443). Look at a bounded tail
window instead; the result is unchanged for any prompt that fits in it.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Report delivered-byte rz progress while parked on SSH backpressure, and race each progress poll against drain so upload resumes immediately when the channel drains.
Fixes#3663
Recreate cursor-line markers/decorations when xterm disposes them externally, and treat empty decoration sets as intact so fully colored rows do not churn markers every frame.
Fixes#3656
Clamps the window layout minimum to the current display work area so small screens (e.g. 1366×768 at 125%) can fit and shrink. Restores terminal keyboard focus after OS resize/maximize, without stealing from active editable fields.
Fixes#3647
Merged by judgment: four Codex rounds already addressed the real bugs and multi-monitor sync; the latest P2 (protect every non-editable focusable control on resize) is edge-case thrash.
Classify SSH exit-signal as signaled so auto-reconnect does not fight admin idle kicks. Bare transport closed and error still reconnect.
Related to #3617.
* feat(terminal): disable auto-close-on-exit by default
Remote graceful channel closes (VPN half-close, server-side idle kick) can be reported as a clean exit with code 0, so with auto-close enabled the tab gets destroyed exactly when the user needs it kept - bypassing the SSH auto-reconnect loop, which intentionally skips exited events.
Keep tabs on exit by default; users who want close-on-exit can enable it in Settings > Terminal > Behavior. Attach-mode close behavior is unchanged.
* fix(terminal): keep session tabs when the auto-close setting is unavailable
The resolver's own default and the TerminalLayer call-site fallback still
treated a missing terminal setting as auto-close enabled. Remote graceful
channel closes (a jump host reaping an idle session) are reported as a
clean exit, so before the settings store had loaded, those closes silently
deleted the session tab and its scrollback. This completes the opt-in
default introduced above: only an explicit autoCloseOnExit true closes tabs.
* fix(terminal): migrate the materialized auto-close-on-exit default once
Builds before the default flip shipped autoCloseOnExit: true as the
default and materialized it into netcatty_term_settings_v1 on any
settings write, so most upgraders carry a value they never chose and
the new default-off never reaches them: bastion and idle-harvesting
servers reporting clean exits keep silently deleting their tabs.
Reset that materialized true exactly once behind a marker key before
the settings blob is first ingested, then persist the marker so every
later stored value is treated as the user's own choice. The cost is
documented: a user who deliberately enabled auto-close before this
release must re-enable it once.
* fix(terminal): keep synced legacy auto-close from coming back
A device that already wrote the one-shot migration marker was accepting
a pre-migration cloud or backup payload with autoCloseOnExit true.
Unversioned true is rewritten to false. Payloads that record the
migration still sync an explicit opt-in, including across a three-way
merge that would otherwise glue the local marker onto a legacy true.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: xu <tbqyomnnnbltzxy2t@aliyun.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* feat(terminal): enable SSH auto-reconnect by default
Unexpected transport drops (VPN / Wi-Fi blips) are recoverable events, not
shell exits: the tab stays and the 5s in-place reconnect loop keeps the same
session id, so AI sessions and long-running work continue once the link is
back. With the previous default (off), a dropped link left the tab parked on
'Press Enter to reconnect', which reads as 'the session closed'.
Clean shell exits still close the tab; explicit opt-out in Settings is
preserved. mosh/et sessions self-heal and are unaffected by this gate.
* fix(terminal): skip auto-reconnect after idle timeouts
SSH auto-reconnect stays on by default for transport drops. A timeout
exit (TMOUT, server idle logout, or connect timeout) leaves the tab
disconnected instead of logging back in every 5 seconds.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: yuyang2230 <yuyang2230@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* feat(ai): raise default AI session idle timeout from 30m to 24h
Sessions opened via host_open are auto-closed after 30 minutes without
terminal/file activity. In production use over flaky links this silently
destroyed in-flight agent work: the AI reopens a host, the link drops, the
session sits disconnected (counts as idle), and the reaper closes it
mid-workflow with no error surfaced anywhere. 24h is the normalize clamp
maximum; users can still choose a shorter window in Settings → AI, and the
idle manager still skips sessions with active executions.
* fix(ai): preserve 24-hour session default during renderer sync
* style(ai): keep session idle manager comment ASCII-only
Replace the unicode arrow in the Settings pointer comment with ASCII per the repo AGENTS.md convention (Maintain ASCII-only unless required by existing file content).
* fix(ai): default AI session idle timeout to 8 hours
480 minutes still covers a workday of flaky-link agent work without
sitting on the 24h clamp. Stored values are left untouched.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: yuyang2230 <yuyang2230@users.noreply.github.com>
Co-authored-by: 陈奇 <16399091+binaricat@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ai): shed oversized tool output before evicting visible chat history
Under localStorage quota pressure the AI sessions serializer degraded
replay ciphertext fine-grained but never shed tool result payloads, so
AI-driven terminal chats (whose persisted bulk is terminal output)
forced the ladder to evict whole oldest sessions and finally collapse
persistence to the newest chat alone. After a restart the history list
looked empty.
Extend the per-message degradation pass to cap oversized tool result
content at a bounded head+tail with a truncation marker, mirroring the
existing ciphertext-shedding tradeoff: every visible conversation now
survives storage pressure at the cost of full tool output on affected
messages.
* fix(ai): keep tool-result truncation strictly smaller than the original
Codex review P2: for tool results only slightly over the cap, the
truncation marker (with JSON-escaped newlines) could make the degraded
copy serialize at the same size or larger than the original, breaking
the ladder's assumption that the degraded representation is the
smallest and sending quota retries farther off.
Drop the marker newlines and shrink the retained head+tail until the
whole copy fits the 8 KiB cap, so a truncated result is always
strictly shorter than its source.
---------
Co-authored-by: xu <tbqyomnnnbltzxy2t@aliyun.com>
The `Freeze trusted helper` step in the `sandbox_smoke` job used a plain
multi-line YAML scalar:
run: cp scripts/ai-automation.cjs "$RUNNER_TEMP/ai-automation.cjs"
chmod 0444 "$RUNNER_TEMP/ai-automation.cjs"
YAML folds the continuation line into the same scalar, so the step ran:
cp scripts/ai-automation.cjs "$RUNNER_TEMP/ai-automation.cjs" chmod 0444 "$RUNNER_TEMP/ai-automation.cjs"
`cp` then sees four operands and treats the last one as the destination
directory, which does not exist:
cp: target '/home/runner/work/_temp/ai-automation.cjs': No such file or directory
The job fails in 7s at step 3, and the remaining 12 steps are skipped.
Reuse the existing `&freeze_ai_helper` anchor, which is what the other eight
`Freeze trusted helper` steps in this workflow already do. It also picks up
`set -euo pipefail` and `test -f scripts/ai-automation.cjs`, so a missing
helper now fails with a clear message instead of a confusing `cp` error.
Observed on a fork mirror running commit b2ed83ae: runs 36847532363 and
36991962473 both failed at this step.
Unit tests stub execFileSync and only found ssh via /usr/bin/ssh, so the
PATH wrapper was skipped on images without that path. Prefer an absolute
findExecutable result, then command -v, then the well-known locations.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Stats latency already pings the authenticated session. Lock that in with
a unit test that fails if getServerStats dials the session host, which
is what produced kex_exchange_identification every ~30s (#3630).
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Match argument snippets conservatively and remove stale snippet rows on input edits before the debounced refresh.
Related to #3622; the email-entry/editor concern remains unverified and the issue stays open.
Preserve pending local notes and conflicting external content across failed writes and successful retries.
Retain explicit clear/import replacement ownership until the current generation persists.
Add a detached multi-tab editor window with acknowledged content ownership, focused Monaco shortcuts, and shared close/save confirmation. Preserve source contents until handoff acknowledgement and block edits or incoming transfers during ownership changes.
Continuation of #3439. Original implementation by pplulee.
Co-authored-by: pplulee <hi@pplulee.me>
Co-authored-by: Cursor <cursoragent@cursor.com>
* 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.
Use xterm's native synchronized output state for viewport preservation, remove the redundant mode tracker, and exercise the production callback path in regression tests.
Fixes#3595
Co-authored-by: si1enteee <si1enteee@users.noreply.github.com>
* feat(vault): add host connection test to the host editor
Add a 'Test' button next to Save in the host editor that opens a dialog reusing the terminal's connection progress/auth/host-key UI, and runs a headless connection probe:
- Main process: netcatty:test-connection reuses startSSHSession in a testMode that authenticates then tears down without opening a shell, reports via netcatty:test:result, and supports cancellation (netcatty:test-connection:cancel).
- Renderer: useHostConnectionTest hook + HostConnectionTestDialog component; single-credential auth (no agent/default-key fallback) with short test timeouts (8s TCP / 15s auth).
- Reuses terminal chain progress, host-key verification, and auth prompts; success keeps the same dialog with retry/close.
* fix(ssh): cancel test connections during chain/proxy dial
Register the headless test-connection transport before connectThroughChain / createProxySocket runs, and update its pendingConn / chainConnections as hops and proxy sockets are established. This lets cancelTestConnection abort a slow/unreachable bastion or proxy dial instead of leaving it running until timeout.
* fix(ssh): address host connection test review feedback
- Route jump-host keyboard-interactive prompts through the external scope in test mode
- Always offer keyboard-interactive for requiresMfa hosts in test mode, including key/certificate-only auth
- Derive the renderer test deadline from the probe options and cancel the attempt on timeout
- Run the macOS Local Network preflight before connection tests
- Add regression tests for jump-host MFA, MFA auth order, test deadline, and macOS preflight
Author: yangheng
Model: claude-opus-5
---------
Co-authored-by: yangheng <492238647@qq.com>
* feat(ai): scope external MCP approvals to connection or host
* test(ai): keep MCP fixture in Netcatty temp directory
* fix(ai): refine external MCP approval UI and grant safety
* fix(ai): wrap long approval targets and support Node 22
* fix(ai): keep automatic scripts in observer mode
* fix(sftp): release preflight markers after transfer
* fix(sftp): retain preflight cap through conflict resolution
* Keep SFTP preflight cap across panel remount
* Update worker terminal metadata expectations
* Persist SFTP preflight skip state across restart
* Limit persistent host approvals to saved hosts
* Scope host-open approvals to the selected saved host
* Exclude serial hosts from persistent approval scopes
* fix(terminal): commit live IME transcription once
xterm sends a rewritten dictation hypothesis as the interim, the full
final string, and the tail. Keep the pending textarea diff from firing
again when composition starts, and send only the part that is not
already on the PTY.
* fix(terminal): retype rewritten IME tails as separate backspaces
A shared suffix has to be deleted and typed again because the cursor
stays at the end of the line. One-character hypotheses are real
prefixes, and each backspace is its own input event so Ctrl-H hosts
still erase.
* fix(terminal): rewrite a revised IME hypothesis in place
A composition that replaces the snapshot, instead of extending it,
sends the cancelled textarea edit. Deletions are counted in graphemes
so a surrogate pair is one backspace.
* fix(terminal): send a new IME word that shares a finished prefix
A composition that starts at or after the snapshot is a new word.
Sharing the first character with text already on the PTY is not
enough to treat it as the same hypothesis.
* fix(terminal): remember a rewritten IME hypothesis in full
A 229 rewrite stored only the inserted tail, so a later
compositionend with no composition marker sent the revised
line again. Remember the whole revised textarea instead.
* fix(terminal): preserve IME rewrite state across delayed commits
Observer mode stays on AI-started scripts that write to the terminal. Compose bar, connect, and panel runs are explicit user actions and no longer read that setting.
* fix(#3559): automated AI fix
* fix: address Codex review on PR #3560
* fix: address Codex review on PR #3560
* fix: address Codex review on PR #3560
* fix: address Codex review on PR #3560
* fix: keep listing size out of the dual-pane transfer plan
A stat-less source can show the pane listing in the overwrite dialog, but that size must not be written back as totalBytes or a short listing truncates the file again. Files past the preflight cap stay on an unknown plan and are not statted a second time.
* fix: stop preflight after a timeout and honor cancel
A half-open browse session no longer walks the whole selection at 10 seconds per file. Cancel during the overwrite size stat is checked before an apply-to-all replace deletes the existing target.
* fix: do not stat remote files again after a failed preflight
A stat that returns no usable size, times out, or never runs is not repeated for the whole selection. The transfer plan stays unknown so the bridge measures the live size.
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(ui): apply the chosen app icon to the Windows tray
Settings already swap the taskbar icon. On Windows, the notification
area now follows that choice. Original keeps the multi-size tray ico;
other variants are scaled to the small-icon size Windows asks for.
* fix(ui): crop the app-icon margin before sizing the Windows tray
The variant PNGs keep a transparent inset, so scaling them straight into
the notification slot made every non-original style smaller than the
full-bleed tray ico. Crop to the opaque artwork first.
* test(sftp): update the side-panel reuse source lock
The single-channel change replaced the connected-only sourceSessionId
ternary with reuseTerminalTransport. The source lock still expected the
old expression, so lint-and-test fails on main.
When /proc/<pid>/cwd is unreadable, accept an lsof name ending in (verb: message) only if that path is an existing directory. This drops the AL2023 record "/proc/<pid>/cwd (readlink: Permission denied)" instead of using it as the SFTP follow or upload target. Real directories with parenthesized names stay usable.
Fixes#3493.
Add a host and group toggle for bastions that allow one session channel per TCP connection. After the handshake, BHostSSH, TERM-SSHD, and CLOUDBILITY take that path automatically. File transfer uses a separate SFTP login, and the interactive terminal is not given another exec, SFTP, copy/split, or port-forward channel.
The manual toggle remains for bastions that still advertise OpenSSH.
fontLigatures already defaulted to on, but the terminal never loaded
the ligatures addon, so Fira Code and Maple Mono kept drawing != as two
cells. Activate the addon after open and before WebGL, and rebuild the
WebGL atlas when the setting changes so glyphs are not rasterized
without the calt feature.
The addon bundles lru-cache's node:diagnostics_channel import. Alias
that builtin to a no-op channel in the Vite renderer build and in the
Electron live-test bundles.
Closes#3543
* feat(ai): add MiMo Code (mimo) agent support scaffolding
Registry/wiring only: discovery entry, managed-agent metadata, model presets, icon, i18n and Settings UI for Xiaomi's MiMo Code CLI (an OpenCode fork). The SDK driver is intentionally not wired yet - it depends on the pending @mimo-ai/sdk parity probe, so DRIVER_REGISTRY keeps a TODO and run-turn/list-models reject the mimo backend until then.
* feat(ai): add MiMo Code (mimo) agent support
Adds Xiaomi's MiMo Code CLI as a managed agent backend, mirroring the existing
OpenCode integration (discovery, managed-agent metadata, model presets, icon,
i18n, Settings UI) and adding the SDK driver that was left as a TODO in the
scaffolding commit.
Driver notes:
- New electron/bridges/aiBridge/sdk/mimoDriver.cjs reuses the pure translation
helpers exported by opencodeDriver.cjs (config/prompt building, event
translation, model mapping) because MiMo Code is an OpenCode fork and speaks
the same wire protocol.
- It does NOT use @mimo-ai/sdk's createOpencode(). On 0.1.15 that helper spawns
a binary named "opencode", waits for an "opencode server listening" banner,
and passes config via OPENCODE_CONFIG_CONTENT; the mimo CLI prints
"mimocode server listening on <url>", reads MIMOCODE_CONFIG_CONTENT, and ships
as "mimo"/"mimo.exe". So createOpencode() can only ever time out. The driver
runs "mimo serve" itself, parses the readiness URL, and attaches the SDK's
createOpencodeClient({ baseUrl }).
- Binary resolution honours binPath, MIMOCODE_BIN and MIMOCODE_BIN_PATH, then
falls back to PATH via resolveCliFromPath (the npm shim is mimo.cmd on
Windows, which Node cannot spawn directly).
- @mimo-ai/sdk ^0.1.15 added as a dependency.
Verified on Windows against mimo 0.1.15 + @mimo-ai/sdk 0.1.15:
- "mimo serve --port" boots and reports its URL; driver parses it.
- SDK symbols used all exist: createOpencodeClient, client.config.providers(),
client.global.event() (SSE stream), client.session.create/abort/promptAsync.
- Live provider catalog reads 2 providers (xiaomi, mimo); MIMO_MODEL_PRESETS
updated to the real lower-case provider-prefixed ids and its TODO removed.
- Server process is killed on close (taskkill tree kill), no orphan processes.
Not yet verified at runtime:
- A full end-to-end turn (no prompt was sent, so no tokens were spent): text /
reasoning / tool-part streaming and abort handling are untested against a
live model.
- MIMOCODE_CONFIG_CONTENT accepting the OpenCode config schema (permission,
mcp, model, share, autoupdate) end-to-end; only that the env var exists in
the binary has been confirmed.
- Whether the loopback server needs MIMOCODE_SERVER_PASSWORD when the API
client attaches.
- The placeholder public/ai/agents/mimo.svg still needs an official asset.
- Multi-turn resume (resumeSessionId) and MCP injection against the live CLI.
* feat(ai): inject MIMOCODE_BIN for discovered MiMo Code agents
Mirror the OpenCode OPENCODE_BIN handling so a discovered or re-detected
mimo binary path reaches the driver, and cover it with the same assertion
shape as the opencode managed-agent env test.
* fix(ai): use MiMo branding in the mimo driver
* test(ai): cover the mimo driver
Add a unit test file for the MiMo Code driver, matching the existing
opencode driver test in shape, runner (node:test via node --test) and
`.test.cjs` extension. It is the last driver in the registry without
one.
Coverage:
- spawn/launch: `mimo serve --hostname/--port` argv, binary resolution
(explicit binPath / MIMOCODE_BIN / MIMOCODE_BIN_PATH), pass-through
env and MIMOCODE_CONFIG_CONTENT; `child_process.spawn` is stubbed, so
no real `mimo` process is ever started.
- readiness: parsing of `mimocode server listening on <url>` from
stdout (including split chunks) and stderr, the OpenCode spelling,
and the MIMO_SERVE_TIMEOUT_MS timeout path (asserts the rejection and
that the child is killed).
- abort/cleanup: stopMimoProcess kill/idempotency/swallow, the Windows
taskkill tree kill, server.close() teardown, and abort mid-turn with
a throwing close().
- branding: OpenCode -> MiMo Code for the busy/idle/status, failed and
tool-failure fallback strings, with tool output and non-brand
technical errors left verbatim.
- happy path: session create -> streamed event translation -> done,
plus listMimoModels catalog mapping and the empty/aborted paths.
* fix(ai): filter MiMo events by session and stop the server behind the npm shim
Address review on #3500:
- The global SSE stream carries every session on the server, and
runMimoTurn translated all of them, so another session's text could leak
into the reply and its session.idle could end the turn early. Skip events
whose session id is not ours, reusing the OpenCode driver's
getOpenCodeSessionIdFromEvent (now exported). Covered by a test with
interleaved sessions.
- On macOS/Linux the official @mimo-ai/cli `mimo` is a Node shim that runs
the native binary through spawnSync, so killing the shim left the server
listening. `mimo serve` is now spawned detached on POSIX and
stopMimoProcess signals its whole process group (SIGTERM, then SIGKILL
after a grace period). Windows keeps taskkill /T.
Verified against the real @mimo-ai/cli@0.1.15 npm shim: on Linux (WSL
Ubuntu 22.04) the listener is the native .mimocode child; before this change
it was still listening 3s after close(), now the port is released within 1s
and no mimo process remains. On Windows the .cmd shim path also releases the
port within 1s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: harden MiMo CLI integration before merge
* fix: wait for MiMo events and handle setup cancellation
* fix: finish MiMo stream handling and scope skill access
* fix: preflight MiMo skill paths before one server startup
* fix: scope MiMo skill reads to trusted roots
* fix: allow MiMo skills from ancestor project roots
* fix: honor MiMo observer and confirm command permissions
* fix: clear MiMo approval when its service exits
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* feat(vault): let Skills + CLI operate notes with the same approval as MCP
Expose vault note list, read, write, and markdown import on the tool CLI so agents can save generated documents only after the user approves.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): keep explicit empty note fields in the CLI
A supplied empty string was treated as an omitted flag, so note clears and empty markdown imports never reached the note service.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): allow an explicit empty note body on CLI create
notes create --content "" was rejected as a missing flag, so it did not match vault_notes_create.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): stop echoing imported note bodies and recognize leading CLI flags
A batch import resent every document over IPC, and a leading --json hid the notes command from artifact inference.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): make note CLI import safe and fail writes cleanly
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
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.
* feat(terminal): Add configurable terminal bar cursor width
Adds a configurable bar-cursor width for the terminal so thin vertical cursors are easier to find, particularly when vi/vim switches to insert mode.
* Add terminal bar cursor width setting
This adds the terminal bar cursor width control to the settings UI with an aria-label for accessibility and a matching test. It also adds localized labels/descriptions and search catalog entries so the setting is discoverable in both English and Chinese.
* Fix terminal cursor width override bug
Prevent width-only cursor updates from clearing DEC/vi cursor overrides by tracking the last applied shape/blink snapshot. The runtime now resets the snapshot on teardown, skips full cursor reapplication for width-only changes, and preserves remote bar/underline cursor styles. Added regression tests covering boot-time and later width updates.
* Fix terminal cursor preference lifecycle
Preserve DEC/vi cursor overrides during the first width-only terminal update after runtime creation. The runtime now records the user cursor preference snapshot when a term is published and applies width-only updates without clearing active cursor style or blink overrides. This prevents regressions when terminal settings change before the panel has fully booted.
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* terminal: allow Shift+Enter text inside ConPTY Win32 input mode
Win32 input mode (PR #3247) delivers Shift+Enter to ConPTY as a lossless
INPUT_RECORD, which CLIs reading console records natively (Codex, Grok) can
use. Node/Bun CLIs read input through libuv, which drops modifier state when
translating INPUT_RECORD to VT bytes, so Claude Code and CodeBuddy still see a
bare CR and submit instead of inserting a newline (anthropics/claude-code#92771,
reproducing on 2.1.278).
While the mode is active, Netcatty also skips its Shift+Enter text fallback and
Kitty encoding, so shiftEnterNewlineText had no effect on local Windows
sessions at all.
Add shiftEnterForceText (default false): when enabled, Shift+Enter sends the
configured text even inside Win32 input mode, and consumes the keydown so no
native record is emitted as well. Add `\e` (ESC) to the escape decoder so the
text can carry the legacy Alt+Enter encoding, which is the only sequence that
survives the ConPTY input path.
Defaults keep the #2974 behaviour untouched for Codex/Grok.
* docs: record libuv input findings and the Win32 input mode opt-out
* fix(terminal): don't swallow Shift+Enter when there is no text to send
The Shift+Enter send-text interception resolved its text after already
calling preventDefault/stopPropagation, and returned false outside the
`if (shiftEnterText)` guard. When resolveShiftEnterText() yields an empty
string (e.g. a persisted empty setting) the keydown was therefore consumed
with nothing written, and the handler never fell through to the Win32
bookkeeping or Kitty paths below, so no Enter reached the session either.
The result was indistinguishable from a dead feature.
Resolve the text first and only enter the interception block when it is
non-empty; empty text now falls through exactly as it did before the
`shiftEnterForceText` setting existed, so a normal Enter is still produced.
The opt-out semantics for the non-empty case are unchanged.
Also tighten the source-shape test so it verifies the real intent: the
interception (preventDefault through return false) must live inside the
empty-text guard, which fails against the previous code.
* fix(terminal): scope Shift+Enter force-text to Win32 mode, honor it per broadcast target
Address review on #3464:
- The force-text opt-out could override a negotiated Kitty encoding that
preserves Shift+Enter in non-Win32 sessions. The keydown decision now
lives in shouldClaimShiftEnterForText: under Win32 input mode it follows
shiftEnterForceText, otherwise only the existing collapse fallback
applies. Covered by a regression test for a non-Win32 session whose Kitty
encoding already preserves the chord.
- Broadcast Win32 targets returned the native record without consulting
their own shiftEnterForceText. They now send their configured text for
Shift+Enter when opted in, whether the source forwarded a key chord or a
native Win32 record, and drop the paired release so ConPTY never sees a
key-up without its key-down. Targets without the opt-out keep the native
press/release pair. Tests cover source and target settings that differ.
ShiftEnterEvent now accepts KittyKeyboardEvent's optional type/modifier
fields so broadcast events can be checked with the same helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The flaky Windows run timed out in where.exe inside startMoshSession,
before any wait started. findExecutable then fell back to the in-box
OpenSSH, which never prints the fixture's MOSH CONNECT line, so no ready
event could arrive no matter how long the test waited.
Pass the existing findExecutable option so the test always uses its
compiled fake ssh.exe without shelling out, and keep the 15s wait: locally
the whole handoff finishes in about 7s.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix: prevent cloud sync version inflation when idle
Three bugs combine to cause an infinite upload loop where the sync
version increments every ~2.5 minutes even with no user interaction:
1. Smart merge unconditionally uploads (useAutoSync.ts):
`if (mergeResult.payload)` is always true since payload is an object.
Now checks `cloudSyncPayloadsEqual(portableMerge, remotePayload)`
before uploading — if merged result matches remote, skip the upload
and mark data as synced.
2. Download-remote re-uploads to same single provider (useAutoSync.ts):
When only one cloud provider is connected, downloading the remote
payload and immediately re-uploading it to the same provider bumps
the version unnecessarily. Now checks `readyProviders.length > 1`
before round-tripping.
3. applySyncableSettings bumps versions unconditionally (syncPayload.ts):
customAccent, terminalFontSize, and customKeyBindings handlers always
bump their storage version counters even when incoming values are
identical to existing values. This fires LOCAL_STORAGE_ADAPTER_CHANGED_EVENT
and triggers a debounced syncNow(). Now guarded with change detection:
- customAccent: compare parsed color values
- terminalFontSize: compare fontSize numbers
- customKeyBindings: compare JSON-serialized bindings
Observed impact: lastSyncVersion reached 7796+ with LevelDB compaction
every ~155 seconds matching getRuntimeRemoteCheckIntervalMs(5).
* fix(sync): avoid repeated versioned setting writes
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Requiring mcpServerBridge from node --test inherited the production
netcatty-tool-cli/discovery.json path, so cleanup() removed the running
app's bridge pointer. Resolve the discovery path on demand and isolate the
affected tests via NETCATTY_TOOL_CLI_DISCOVERY_FILE.
Rebased onto #3502, which now owns the self-heal (live-host reuse, status
and content validation); this change only adds on-demand path resolution to
those helpers and drops the separate 30s missing-file sweep.
The subprocess regression test redirects HOME/USERPROFILE as well as
APPDATA/XDG_CONFIG_HOME, since macOS derives the default path from
os.homedir(), and refuses to plant its canary anywhere outside the
throwaway root, so it can never write the real app path on any OS.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(#3496): automated AI fix
* fix: address Codex review on PR #3499
* fix: address Codex review on PR #3499
* fix: keep live model catalogs scoped and surface discovery failures
* fix: isolate Claude catalog profiles and support xhigh effort
* fix: handle missing external model catalog state
* fix: isolate Claude model catalogs by credentials
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(terminal): keep broadcast going on vim ex command-line
Broadcast pauses on fail-closed colon prompts so passwords are not
copied to peers. Vim command mode's last line is a bare `:`, which
matched that heuristic. Exempt lines that start with `:` so `:w` and
friends stay in sync; `Password:` is unchanged.
* fix(terminal): only treat a bare colon as vim command-mode
Codex: exempting every `:`-prefixed line would broadcast into custom
prompts such as `sudo -p ':'`. The hang is the first `:` key; later
`:w` no longer matches the trailing-colon heuristic.
* fix(terminal): exempt vim colon only on the alternate screen
A bare `:` on the primary screen can be `sudo -p ':'`. Vim command mode
uses DEC 1049, so require alternateScreen before treating `:` as ex.
* test(terminal): allow alternateScreen in prompt-security options
* fix(mcp): drop mustache braces from tool descriptions
Hosts that interpolate {{name}} in tools/list text treat the literal
{{variables}} snippet wording as a missing template variable and abort
the turn. Use plain language instead and regenerate the committed specs.
* fix(mcp): describe snippet placeholders without mustache tokens
Keep agents informed that snippets use two curly braces on each side,
without emitting a literal {{name}} token that template hosts interpolate.
* fix(#3455): automated AI fix
* fix: address Codex review on PR #3456
* fix: address Codex review on PR #3456
* fix: address Codex review on PR #3456
* fix: address Codex review on PR #3456
* fix: address Codex review on PR #3456
* fix: address Codex review on PR #3456
* fix: address Codex review on PR #3456
* fix(terminal): let explicit SFTP auto-open beat the saved layout
A JumpServer SFTP deep link or host.autoOpenSftpPanel must still open
file transfer when the saved default layout omitted SFTP.
* fix(terminal): skip saved layout only when SFTP auto-open is available
Telnet/plugin hosts can carry autoOpenSidePanel=sftp even though the
protocol cannot serve SFTP. Those sessions should still get the saved
default with the SFTP pane pruned.
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Interactive bash prints PS2 on the probe's backslash continuations, so
strict startsWith checks miss `_Q`/`_P:` and silent PTY execs hang until
the command timeout. Strip common prompt prefixes in the parser; keep
the existing short-line probe for OpenWrt.
* Add local shell side panel auto-open settings with i18n support
- Add settings to control side panel behavior for local shell sessions
- Support auto-opening side panel when local shell is launched
- Allow users to choose which pane (Files, SFTP, Scripts, etc.) opens by default
- Add complete i18n translations for en, zh-CN, zh-TW, es, ru locales
* fix: wire local shell side panel settings
* fix: restore undefined check for local shell protocol detection
Local shell sessions may have protocol=undefined, not just 'local'.
Restore the original condition to auto-open sidebar for both cases.
* fix: enable SFTP sidebar for local shell sessions
Local shell now supports SFTP (for local file browsing).
Update sftpAvailable to include local shell so the auto-open
sidebar setting works correctly for PowerShell/bash sessions.
* chore: bump version to 1.1.83-fork.1
Distinguish fork from upstream (1.1.83) and previous 0.0.0 dev version.
* feat: show SFTP button in local shell toolbar
Local shell sessions now display the 'Open SFTP' button in the toolbar,
allowing users to browse local files via SFTP sidebar, consistent with
the auto-open behavior added earlier.
* feat: 本地Shell侧边栏支持追随终端目录功能
- 追随终端目录现在支持本地 POSIX shell(bash/zsh/fish)
- 排除 PowerShell 和 cmd(因为它们的 cd 命令和路径格式不同)
- 串口连接仍然不支持(它们根本没有 SFTP)
- 定位路径到终端功能已支持本地 Shell(无需修改)
* feat: support PowerShell and CMD in session restore
- Accept Windows absolute paths (C:\...) in isRestoreCwdPathEligible
- Add shell-specific cd commands:
* PowerShell: Set-Location -LiteralPath with '' quote escaping
* CMD: cd /d with "" quote escaping
* bash/POSIX: cd -- with '\'' quote escaping
- Remove PowerShell/CMD restrictions in cwd injection eligibility
- Fix line terminator in SFTP locate path (use \r\n for Windows PTY)
* fix: bound local shell panel preferences and synchronize settings
---------
Co-authored-by: HHXXYY123 <HHXXYY123@outlook.com>
Co-authored-by: binaricat <binaricat@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* Default WSL launches to Linux $HOME
When launching WSL on Windows, ensure the distro starts in the Linux home if no explicit working directory was provided. Adds isWslExecutable and getWslLaunchArgs which append `--cd ~` for wsl.exe calls that lack an explicit cwd or --cd option. startLocalSession now uses getWslLaunchArgs when building shell args. Exports getWslLaunchArgs and adds a unit test verifying the behavior. This prevents WSL from failing early when the parent Windows cwd isn't mounted or accessible to the chosen distro.
* Insert --cd before WSL command/--exec
Ensure WSL launch uses Linux home by inserting --cd "~" before the first bare command or --exec/-e boundary so the option is consumed by WSL rather than passed to the invoked shell/command. Early-return when not a WSL executable, when an explicit cwd is supplied, or when --cd is already present. Also account for WSL options that take a separate value (--distribution/-d, --user/-u). Adds a unit test verifying --cd is placed before --exec.
* fix(terminal): preserve WSL command argument boundaries
* fix(terminal): retain legacy WSL distribution selectors
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Introduce a new TerminalTabDoubleClickBehavior setting (duplicate | copy | disabled) with default 'duplicate'. Add model field, normalization, default, and sync key (tabDoubleClickBehavior). UI: TerminalBehaviorSettings adds a Select; AppView and TopTabs pass the setting through; TopTabItems implements createTopTabSessionDoubleClickHandler to perform duplicate/copy with a safe fallback. Add i18n strings, settings search entry, and update tests to cover behavior and serialization. Improves user control over double-click actions on session tabs.
* fix: bound AI command input for OpenWrt BusyBox
* fix: address Codex review on PR #3342
* fix: preserve custom prompts and split command history
* fix: preserve zsh history suppression for split AI input
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
* fix(ai): keep AI command execution connected through bastion hosts (#3146)
Approving an AI assistant command after jumping to a target through a
menu-driven bastion (BHostSSH, QiZhi TERM-SSHD) disconnected the session.
Two separate failures were involved:
1. The AI probe/wrapper was written to the interactive PTY as one
multi-character channel write. Strict bastions treat one SSH channel
write as a single keystroke and silently drop multi-character writes, so
the wrapper never ran; the inactivity timeout then sent Ctrl+C, which the
bastion read as "exit". Type the probe and wrapper one Unicode code point
per write to match human keystrokes.
2. ensureSessionShellKindForExec opened a second SSH channel (exec) to probe
the login shell. Bastions bind the transport to the first interactive
session and tear it down when a second channel opens. Skip the
exec-channel probe for bastion banners and let the PTY live shell probe
determine the wrapper instead.
* fix(ai): preserve paced delivery and scope bastion keystrokes
* fix(ai): pace bastion input for Windows shells too
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix: unify host system detection and simplify host details
* fix: retain detected systems for temporary terminal hosts
* fix: detect remote systems after Mosh becomes ready
* fix: show the effective device mode in host system details
* fix(terminal): align history preview with rendered cell dimensions
* fix(terminal): fit wide history rows without changing copied text
* fix(terminal): select every history preview row
* fix(port-forwarding): reconnect auto-start rules after inactive status
* fix(port-forwarding): honor current auto-start setting during reconnect
* fix(port-forwarding): ignore retries from replaced connections
* fix(port-forwarding): preserve exhausted retries after close
* fix(port-forwarding): schedule one retry per failed connection
* fix(port-forwarding): retain pending retry status after repeated errors
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Allow global broadcast hotkeys for visible orphan sessions and centralize target resolution with coverage for workspace, global, and direct-target modes.
Keep stored boolean updates pure and propagate global broadcast state through terminal panes so orphan sessions can toggle and receive broadcasts correctly.
Select default command-safety rules from the live session shell so legal
PowerShell subexpressions are allowed and PowerShell-native dangerous
commands are blocked. Untouched pre-shell-aware lists gain the new
defaults on read.
Closes#3256
The original bug is: lock + display sleep moves a secondary-display window
to the primary, and unlock never puts it back. Review follow-ups had grown
a general display-identity machine far beyond that.
Restore only while the session is locked/asleep, or shortly after unlock.
Keep user moves authoritative. Drop Win+Shift destination tracking and
multi-unknown-display correlation.
Hosts were hardcoded to os 'linux' at every creation and update entry
point, so Windows hosts were always reported as linux by the AI
environment (get_environment) and nothing could correct them.
- buildVaultHostFromDraft parses draft.os with a strict allowlist
(linux/windows/macos, common aliases included) and defaults to linux
- applyVaultHostUpdate accepts os with the same validation
- the AI host.update field list and the MCP vault host tool schemas
expose os so agents can set and correct it
Empty pane arrays are not a first-visit signal; they also happen after
the user closes every tab. Route every Open SFTP request through the
planner, and do not forceNewTab on an empty side.
The empty-left shortcut was racing first-visit auto-connect, but it also
fired after the user closed every left tab. Open SFTP then skipped the
planner and could replace the right pane. Only skip the planner when
both sides are still empty.
A matching hostId in error or disconnected state is not a live session.
Treat only connected/connecting panes as reusable so Open SFTP reconnects
in place instead of selecting a dead tab.
Skipping realpath on plain directories also dropped them from the ancestor
set, so a symlink back to a non-root ancestor duplicated that subtree.
Compose the resolved parent path with the child name instead, and still
realpath directory links.
Address the SFTP UX list in #3240: wider bookmark management with
confirm/reorder/rename, a compact file-list density, a host-list shortcut
into the existing local/remote dual pane, faster local folder discovery,
and higher small-file upload concurrency.
Tree view already supports double-click to enter directories, so that
item is left as-is.
Keychain identities can change after the host copied username. Use the
same resolveHostAuth username as sudo autofill so a stale host.username
does not skip or force elevation.
Keychain identities clear host.password. Reuse the same host-auth
resolution as sudo autofill so those saved identity passwords can
elevate a terminal drop into /root.
After sudo -i, terminal drag into /root uses the host's saved password for
SFTP sudo. If no usable password is saved, the drop fails with guidance to
enable host Sudo elevation or return to the user directory.
Automatic SFTP reconnect still prefers the originating session, then falls
through to a fresh open so a dead channel after sudo -i can re-elevate.
Do not treat a lagging split-pane focus as the user leaving the drop
origin, and do not bind a Mosh/ET drop to the still-focused SSH session.
First-open follow treats a missing SSH id as bound to the live focused
terminal so a probe from A cannot apply after focus moves to B.
A follow sync that started probing session A must not navigate after
focus moves to session B. Capture the expected session before the
await and reuse the same guard already used for go-to-terminal-cwd.
Keep confirmed active-shell destinations, originating-session bind, sudo
fidelity, and the longer ZMODEM start wait. Remove the dormant queue,
routeSessionId identity, and source-regex contracts that only locked
that extra routing in.
Add Duplicate Session as an explicit fresh-login alternative to Copy Tab. Keep authenticated transport reuse for Copy Tab and double-clicks, preserve fresh intent across session restoration, and avoid sending a previous target's directory command to a fresh bastion login.
Verified with focused and full tests, lint/build, independent local reviews, and real Electron menu operations against a local SSH server.
Fixes#3221.
Release consumed second-instance argument buffers after deriving connection requests from an independent ordered copy. This closes the late password-retention finding on #3220 without changing connection or Explorer path routing.
Verified with regression tests, the full local suite, lint/build, two independent local reviews, and a real two-process Electron SSH connection that checks credential delivery and removal of both transport copies.
Related to #3218 and #3220.
Restore full height through the AppLockGate background wrapper, which otherwise lets the tray content collapse to about half of its window height. Preserve the existing lock-screen interaction restrictions.
Add real Electron regression coverage for repeated opening, session lists, lock/unlock, short windows, and Escape. Run it on macOS and Windows, including 100% and 200% device scale on Windows, and trigger it for the relevant renderer changes.
Fixes#3181
A wrong master password can decrypt to a NUL mid-buffer and leave a short
printable UTF-8 prefix. Treat only a trailing NUL pad as a C string so
vectors like wrong25 no longer save garbage host passwords.
AES-CFB has no authentication, so a mistyped master password can decrypt
to printable Latin-1 junk that was previously saved as a host password.
Require valid UTF-8 plaintext, fail closed if any ciphertext does not
decrypt, and keep leading or trailing whitespace in the master password.
Sanitize lastConnectedAt in convergent equality, change summaries, and
v1-to-v2 conversion so legacy telemetry cannot block migration or leak
into CRDT state.
Bound the post-commit remote chmod with the same best-effort timeout
used for destination mtime stamps. A stalled chmod after promotion
now warns and lets completion/cleanup continue instead of pinning
the transfer, SFTP lease, and admission slot.
Drop the extra pre-transaction mode stat so cancel can settle and
existing call-count tests keep their first stat as the planner/final
size check. Restore replace mode from the transactional upload plan
snapshot instead, and hang the in-place cancel regression on the
post-OPEN size verification.
Replace uploads recreate the remote file via fastPut / pipelined WRITE
with umask defaults, which dropped executable and other mode bits.
Capture the existing remote mode before the transfer and chmod it back
on the published final path after success.
Fixes#2954
Vendor bastion/network-device CLIs disconnect when live-preview injects
Ctrl-U or backspaces while typing cd/cat. Keep the popup, but treat
network-device sessions as preview-off until the user accepts.
Fixes#1193
Claude Code Ajv does not load that dialect, so every triage died before
the model ran: no issue reply and no diagnosis. Strip $schema/$id before
--json-schema.
Route and several other jobs required $RUNNER_TEMP/ai-automation.cjs after
checking the helper out to the workspace, so GitHub never reached classify.
#3181 dispatch failed immediately with MODULE_NOT_FOUND.
Unindented Brave helper heredocs made GitHub reject ai-automation.yml.
The workflow never registered issues/opened, so new issues only got the
format check and template triage label.
Arm a one-shot window/document capture listener on non-primary
pointerdown so releasing over the portalled context menu still
restores draggable, and share the helper across both surfaces.
Identity recovery cleared the temp-root cache but kept the in-memory
signing key from the old inode. Drop that promise so the next load
picks up the replacement key file instead of signing with a stale key.
Point spawnSync children at isolated TEMP/TMP/TMPDIR so Windows cannot
rm the real Netcatty temp root. Keep the old inode allocated via rename
so the replacement test cannot pass against recycled inodes.
A resolved cursor-agent binary is a user install even when status JSON
is missing, unrecognized, or the status command throws. Login still
requires parsed authenticated status output.
Right-clicking a script package in the terminal scripts tree now shows
Rename and Delete. Vault package and snippet cards use asChild triggers
and ignore non-primary drags so Windows context menus are not swallowed.
Netcatty ships @cursor/sdk, so probing it from the Electron main process
always succeeded and Settings showed Cursor installed even with no
Cursor Agent CLI on the machine. Treat installed as CLI presence or
proven CLI login; keep sdkInstalled for API-key mode.
Swap issue triage, implement, follow-up, and Codex-fix jobs from Cursor
CLI to Claude Code against Ollama Cloud (glm-5.3-flash:cloud). Isolated
research now uses Brave Search. Automation files and repo variables use
an ai- prefix; existing cursor-* HTML markers and cursor/issue-*
branches still parse so in-flight work is not reprocessed.
SFTP downloads fail when the cached Netcatty temp root still exists but
its inode changed (Windows temp cleaner, worker mkdir race). Treat that
identity mismatch like ENOENT: clear the cache, re-run full safety
checks, and rebind instead of aborting the transfer.
Keep the retry markdown override only while the parent prop still contains
the stale body that originally failed MDX import. Once NotesManager's
source-draft debounce catches up, the editor goes back to normal prop
synchronization instead of keeping an old retry seed around.
Co-Authored-By: Claude <noreply@anthropic.com>
Codex review follow-ups for the unrenderable-markdown fallback:
- Retry now seeds the MDX import from the editor's latest accepted source
draft. NotesManager debounces source drafts (300 ms), so retrying right
after fixing the markdown could remount the rich editor with the stale
pre-fix `value` prop and drop straight back into the fallback.
- The read-only preview fallback no longer mutates the note: NoteSourceEditor
skips its custom Tab insertion, undo/redo handling and imperative
insertAction when readOnly is set (the DOM readOnly attribute alone did
not block those paths).
Co-Authored-By: Claude <noreply@anthropic.com>
The Vault notes rich editor parses note content as MDX. Some valid
CommonMark is not valid MDX — most commonly an unbalanced angle tag such
as `mysql -h <host> -u <user>` written in prose. When mdxeditor fails to
import the markdown it clears the lexical document and only reports the
failure through its onError callback, which netcatty never wired up. The
note then rendered as an empty editor with just the placeholder, while
the content was still intact in the vault (export/copy still worked).
This is exactly the note-view half of #3167: the AI wrote a skill
document into Vault → Notes, the note showed no content, and exporting
it produced a complete markdown file.
The editor now listens to MDXEditor's onError and falls back to the raw
markdown source view with a short notice, so the content is always
visible (and editable) instead of silently blank. Recovery is
deterministic: switching note or editor mode retries the rich import,
and the notice offers an explicit retry.
Co-Authored-By: Claude <noreply@anthropic.com>
Strict bastion prompts (QAX/奇安信) treat one SSH channel write as a single keystroke and silently drop every multi-character chunk, so an IME commit of two or more hanzi and a Chinese paste both reach the bastion's search prompt as nothing at all. Single characters work, which is why typing them one at a time is the only path that works today.
Split plain multi-character text at the send boundary instead of adding a setting: the write side of handleTerminalInputData now iterates one chunk per Unicode code point, and all bookkeeping (command buffer, script recorder, autocomplete, sudo autofill, broadcast, scroll) still sees the original payload exactly once. IME commits split whenever the committed text has more than one code point; raw (non-bracketed) onData splits up to 32 characters and longer pastes keep the single write. Anything containing an escape sequence - bracketed paste wrappers, CSI-u composition, forwarded Kitty key sequences, cursor reports - is never split, and broadcast peers still receive the original string once.
Each chunk carries the same writeToSession options as the original single write, so the sensitive marker and automation flags are kept per character. Bridge writes stay one channel write per IPC call, which reproduces what Xshell sends on the same bastion (#3077).
Co-Authored-By: Claude <noreply@anthropic.com>
When the punctuation keyup was dropped and a previously held key was released
next, the recovery flushed the deferred key (recording a Kitty press) but then
released only the unrelated key, leaving the deferred press forwarded until
focus loss.
Replace the sentinel-rewrite predicate with resolveDeferredKeyupRelease, which
enumerates all three cases: sentinel releases take over the deferred key's
release identity, the deferred key's own release pairs the press directly, and
an unrelated release keeps its identity while the deferred press gets a
synthesized release.
Clearing a history object reused by a new session kept the previous
session's cell column, so a leading tab in the fresh output padded to the
wrong tab stop.
Co-Authored-By: Claude <noreply@anthropic.com>
Follow-ups on the alternate-screen preview transcript:
- Cap the pending escape tail on its introducer, so an oversized control
string split across chunks is not re-parsed as transcript text.
- Write spans in bounded pieces, committing a full line at the character cap,
instead of clipping a span and dropping its remainder.
- Track the cursor in terminal cells (not UTF-16 length) so tab stops land
correctly after wide glyphs.
- Apply erase-in-line (CSI 0K / 2K) to the open line, so a shorter progress
redraw leaves no stale suffix text behind.
Co-Authored-By: Claude <noreply@anthropic.com>
A modified keydown (Ctrl+C, Alt+...) is a command, not the continuation of the
lost punctuation keystroke. Leaving the deferral armed across it meant the next
ordinary keydown flushed the pending character in front of the user's input,
right after the interrupt or shortcut ran.
Discard the stale deferral when the next keydown carries Ctrl/Alt/Meta; an
active composition still resolves it via insertText.
Follow-ups on the alternate-screen preview transcript:
- C1 control-string introducers (DCS/SOS/OSC/PM/APC) were filtered as stray
control bytes, leaving their payload as transcript text; consume them
through the BEL / ESC-\ / C1 ST terminator like their ESC-based forms.
- Tabs were kept as-is, so a row's cell width under-counted against how the
preview pre element renders tab stops and long tabbed lines were clipped
instead of wrapping. Expand each tab to the next 8-column stop while
writing, and route tab padding through the same open-line budget as text
spans.
Co-Authored-By: Claude <noreply@anthropic.com>
The keydown recovery for a swallowed punctuation keyup flushes the deferred
key, which records a Kitty press locally and for broadcast peers. Since that
branch only runs when the release will never arrive, the press stayed
forwarded and the TUI saw the key held until focus loss or session reset.
Extract the forwarded-press release pairing into releaseForwardedKittyPress and
call it from the recovery with a release synthesized from the deferred physical
key, so the press/release pair completes in the same keystroke.
Two robustness gaps in the alternate-screen preview transcript:
- A cursor-addressed redraw (cursor-home CSI stripped, no LF) appended every
frame to the open line, which the character cap only checked on commit, so
it grew without limit and every append copied it whole. Commit the open
line once it reaches the budget and clip each span to the remaining room.
- Escape sequences were assumed to be two bytes, so intermediate bytes leaked
their final byte into the transcript (ESC ( B from ncurses/reset left a
stray B). Consume intermediates (0x20-0x2f) through the final byte
(0x30-0x7e) per ECMA-48.
Co-Authored-By: Claude <noreply@anthropic.com>
A real keyup for another held key could land while the punctuation deferral
was still armed (the deferred key's own release was swallowed). That release
was rewritten to the deferred physical key, so in Kitty report-event modes the
held key's forwarded press never got its release and the TUI saw it stuck down
until focus loss or session reset.
Restrict the rewrite to IME sentinel releases (Process/229/Unidentified/
Dead/Compose, mirroring the non-text DOM keys the Kitty encoder already
refuses to send as text). Any real release still ends the stale deferral, so
the #3103 recovery is unchanged.
Plain wheel in screen/vim/codex still forwards arrow keys (xterm's
alternate-scroll), and shift+wheel previewed xterm's normal buffer, which
holds no scrollback once an app owns the alternate buffer - so the preview
clamped to a single screen and looked dead (#2516).
When the alternate buffer is active and the normal buffer has no rows above
the viewport, the preview now renders the session's captured output instead:
a bounded plain-text transcript kept next to the connection log capture,
after the programmatic command rewriter (masked commands stay masked) and
before the replay sanitizer, which drops alternate-screen output on purpose.
Rows are wrapped to the terminal columns with wide-character awareness and
reuse the existing wrap-flag selection joining.
Mouse-reporting apps are untouched: their wheel events still go to the app.
Co-Authored-By: Claude <noreply@anthropic.com>
The CJK IME punctuation deferral (#2833) armed on a punctuation keydown and
only resolved on an insertText remap, an exact-key keyup, or a session reset.
Windows IMEs report Process/keyCode 229 as the keyup of a key they consumed,
or drop the keyup, so the deferred key stayed armed: the deferral then blocked
every keypress, and a second "/" search in vi (or any later keystroke routed
through keypress) never reached the PTY (#3103).
The deferral now ends on any real key release (composing releases excluded, so
an active composition still resolves via insertText) and a stale deferral is
flushed when the next unmodified, non-composing keydown for a different key
arrives. The keypress block is scoped to the deferred key instead of every
keypress, so a stale deferral can no longer swallow unrelated input. A mangled
release pairs its kitty release from the deferred physical key instead of the
Process/229 event.
'sftp.fileName' read 檔名稱 and its placeholder 輸入檔名稱, which are both
missing a character — the term is 檔案名稱. Every other locale spells it
out (File name / 文件名称 / Имя файла / Nombre del archivo), and the
sibling folder keys directly above already use 資料夾名稱.
Visible in the SFTP "New file" dialog.
Two changes based on Codex bot review feedback on PR #3156:
1. Preserve ZWNJ (U+200C) and ZWJ (U+200D) in terminal input.
These carry meaning in Persian orthography and emoji sequences;
PTYs can process the raw bytes, so stripping them could corrupt
filenames, args, and passwords that legitimately contain them.
2. Sanitize composition text before Kitty encoding.
When Kitty report-all + associated-text mode is negotiated,
encodeKittyCompositionText converts U+200B into an escape sequence
(e.g. ESC[0;;8203u) BEFORE reaching the handleTerminalInputData
guard. Sanitize the raw text in both composition paths
(commitImeTextInput remap path and onData handler) so zero-width
artifacts are stripped before encoding, not after.
Update pattern-matching tests to reflect the new variable names
(sanitizedText / sanitizedData) in the Kitty composition paths.
CJK IMEs (notably Microsoft Pinyin / Sogou on Windows) occasionally emit
zero-width Unicode characters (U+200B ZWSP, U+FEFF BOM, etc.) when switching
composition modes. xterm.js sends these to the PTY via onData, and with the
15-graphemes Unicode version they render at width 0 — so the command line
looks normal but contains hidden characters that cause the executed command
to fail.
Add sanitizeTerminalInput() and call it at the top of
handleTerminalInputData so every input path (keyboard, IME composition,
paste, Kitty keyboard, Shift+Enter) strips zero-width formatting chars
before they reach the PTY. If the input was zero-width-only, return early
to skip all downstream processing (command buffer, broadcast, sudo autofill).
The folder conflict copy was clarified but the transfer-center accessibility test still expected the previous wording. Assert the current destructive warning while preserving the aria-describedby coverage.
The identity-file safety check correctly rejects the old placeholder strings used by four auth retry tests. Generate a real test key and return a realistic parsed private key so the fixtures exercise the intended retry behavior without weakening validation.
The repository ships AGENTS.md, but every README linked to lowercase
agents.md. GitHub serves blob paths case-sensitively, so the architecture
guide link 404s on all four pages.
Fixed in README.md, README.zh-CN.md and README.ja-JP.md as well, since the
same broken link exists there.
Add README.zh-TW.md for Traditional Chinese (Taiwan) readers and link it
from the language switcher in every README.
The localized download badges were also broken. README.zh-CN.md and
README.ja-JP.md put raw non-ASCII text straight into the shields.io query
string (label=下载最新版, label=最新版をダウンロード). shields.io rejects
those with HTTP 400, so both rendered as a broken image. Percent-encoding
the label fixes it; all four badges now return HTTP 200.
- add README.zh-TW.md, written for Taiwan usage rather than converted from
Simplified Chinese (伺服器, 用戶端, 分頁, 工作階段, 檔案總管, 程式碼簽章,
相依套件, 叢集, 權杖, 序列埠)
- percent-encode the badge label in README.zh-CN.md and README.ja-JP.md
- add 繁體中文 to the language switcher in all four READMEs
- allowlist README.zh-TW.md in .gitignore, which ignores root files by
default
Validate ssh2 parser results for actual private material and stop raw key fallback after resolution failures. Add generated-key regression coverage for public-only and malformed identity inputs while preserving encrypted-key handling.
Dragging a host card in grid view left it stuck at opacity-45 until the
user started another drag on it.
The grid preview reorder runs from onDragOverCapture, so the dragged card
can move into a different virtual row while the drag is still active. In
VirtualizedHostCollection each row is a separate React parent, so crossing
a row boundary unmounts and remounts the card. The browser still dispatches
dragend at the original node, but a detached node no longer bubbles the
event up to the container's onDragEndCapture, so draggingHostId was never
cleared. A short drag that stayed inside one row kept the node mounted,
which is why dragging again appeared to fix it.
- bind a native dragend listener on the source node at dragstart; it is
dispatched at that node and still fires after React unmounts it
- always reset drag state in onDropCapture: after a grid preview reorder
the card under the cursor is the dragged card itself, so
draggedHostId === targetHostId fell through every branch without
resetting
- apply the same fix in useVaultItemReorder, which backs the keychain,
port forwarding, proxy and known-hosts lists, and in SnippetsManager
zh-TW was missing 78 keys. I18nProvider resolves a missing zh-TW key
through the base "zh" language, and that lookup matches zh-CN first in
MESSAGES_BY_LOCALE, so Traditional Chinese users saw Simplified Chinese
for the whole App Lock surface rather than an English fallback.
- add the 78 missing keys: appLock.*, settings.appLock.*, topTabs.lockApp,
dialog.createWorkspace.title, field.selectHosts, placeholder.searchHosts
- fix Simplified leftovers: 云端 -> 雲端, 筆記本里 -> 筆記本裡, 賬密 -> 帳密
- switch mainland wording to Taiwan usage: 分組 -> 群組, 標籤頁 -> 分頁,
身份 -> 身分, 新建 -> 新增, 地址 -> 位址, 重置 -> 重設, 快捷鍵 -> 快速鍵,
生成 -> 產生, 審批/批准 -> 核准, 波特率 -> 鮑率, 停止位 -> 停止位元,
拖拽 -> 拖曳, 響應 -> 回應, 字號 -> 字型大小, 重啟 -> 重新啟動
zh-TW now covers every key present in en and zh-CN.
Avoid rewriting thinking/provider maps when values are unchanged so
mounted AI panels do not re-render. Put permission title and short
description on one line and drop the Cursor CLI parenthetical.
Stop advertising Gemini 3.7 Flash minimal, GPT-5.x-chat reasoning, and
Claude 4.7+ extended thinking. Map GPT-5 Off to minimal, send adaptive
effort on Claude 4.6+, and keep composer Enter on an exact or custom id.
Node's http.request falls back to Transfer-Encoding: chunked when no
Content-Length header is present. Both AI request paths pass the AI SDK's
headers through unchanged, and those headers carry no content-length (in the
browser fetch computes it), so every AI request body went out chunked.
The body is a fully-buffered string at that point, so its length is known.
Send an explicit Content-Length instead, measured with Buffer.byteLength so
multi-byte system prompts are not truncated.
Chunked request bodies are the less interoperable choice: on the plain-HTTP
path an HTTP proxy has to de-frame and re-serialize them, and some fail on
larger bodies. Xray's HTTP inbound drops the connection once the chunked body
exceeds roughly 8KB. Because Catty's system prompt plus tool definitions is
about 48KB, chat against an http:// provider behind a system HTTP proxy failed
with an opaque "socket hang up" while the connection test kept passing, since
that test issues GET /v1/models with no body and never exercises this path.
Adds three regression tests covering the streaming path, byte-accurate length
for multi-byte bodies, and the non-streaming path.
Closes#3083
Codex P2: switching to a catalog model dropped context_length, so
Catty budgeted 128k instead of the advertised window. Keep the
metadata on picker models and write it to modelContextWindows.
Codex P2: models whose menu includes Off still showed Off for users
with no stored preference, while the request sent no override. Leave
the chip unselected until the user picks a level.
Codex P2: missing agentThinkingMap was treated as Off, so GPT-5.1+
got reasoningEffort=none and Gemini 2.5 Flash got thinkingBudget=0
without a user choice. Store Off as an explicit value and leave an
absent preference unset so the provider default is used.
Codex P2: an empty agentThinkingMap was normalized to Off and then to
minimal, so every Gemini 3 Flash turn overrode the provider default.
Only send thinkingLevel when the user actually picked a level.
Codex P2: gpt-5-chat-latest matched the gpt-5 heuristic and received
reasoningEffort, which the OpenAI chat-only variants reject. Exclude
gpt-5-chat* from the thinking chip and request options.
Codex P2: agentThinkingMap was persisted locally but omitted from
collect/apply sync, so backups and other devices restored provider
and model without the chosen reasoning level.
Codex P2: hiding the custom-model row still left Enter falling back
to the typed query, which send-time validation then discarded. Only
use the query as a custom ID when Catty offers that action.
Codex P2: opening the composer on Gemini Pro persisted Low for users
who had never chosen a thinking level. Only remap an explicit stale
value; leave an empty preference unset so the request uses the
provider default.
Codex P2: pinning or recents in one parked ChatInput only updated that
instance. Subscribe every mounted composer so sibling terminals see
the same recent/pinned list without remounting.
Codex P2: gemini-3.1-pro-preview supports Medium, but Catty rewrote it
to High. Original Gemini 3 Pro still only has Low/High, so omit Medium
instead of silently converting it.
Codex P2: refreshed CLI catalogs still showed saved IDs that the
catalog no longer contains, then send-time validation swapped them.
Only Catty may keep a custom ID that is not in the live list.
Codex P2: a built-in provider with no stored baseURL never listed
live models even though chat still used the preset host. Fall back to
PROVIDER_PRESETS.defaultBaseURL before probing /models.
Codex P2: external-agent pickers advertised a custom ID that send-time
validation ignored. Offer Use custom model only for Catty providers.
Codex P2: the thinking budget was added to both compaction max output
and reservedTokens, so it was subtracted twice. Keep it only on
compaction max output.
Codex P2: medium/high thinking adds 10k/20k to the SDK max_tokens,
but pre-turn/step compaction still reserved only the 4,096 default.
Fold the selected thinking budget into output reserve and compaction
max output without changing the streamed maxTokens field.
Codex P2: Claude 3 Haiku still offered Low/Medium/High and would send
an enabled thinking budget. Gate the chip and the provider option on
Claude 3.7 / 4+ model ids. Also memoize Catty thinking levels.
Codex P2: switching away from Gemini 3 Flash left `minimal` selected
on models that do not advertise it. Persist a valid level for the new
model.
Codex P2: Gemini 3 Pro and 2.5 Pro cannot disable thinking, so Off
was a lie. Those menus only offer low/medium/high.
Codex P2: catalog cache ignored API key rotation, so a replaced
credential could keep the previous account's models. Fingerprint the
stored secret in the cache key.
Codex P2: Gemini 3 Flash cannot turn thinking off; Off was sending
thinkingLevel=minimal. Surface Minimal on the chip instead of Off.
Codex P1: o3/o4-mini/gpt-5 reject reasoning_effort=none. Only GPT-5.1+
get that Off mapping; older reasoning models omit the field.
Codex P2: Cursor ModelListItem.parameters.effort.values is the catalog
capability list. Use it when present instead of fabricating fallbacks
or dropping the thinking chip on unknown models.
Codex P2: OpenAI-style models such as gpt-4o rejected reasoning_effort
when the chip always offered Off/Low/Medium/High. Gate the chip and
the provider option on known reasoning model ids, and send explicit
none when Off is selected on a reasoning model.
Remove the provider divider and search-field outline in the sidebar
model picker. Size Save/Test/Cancel to the same h-8 box without
changing the global Button styles.
The Ollama preset always rewrote OpenAI-compat keys to the literal
"ollama" dummy. That is correct for local servers with no key, but it
replaced the IPC placeholder used for Cloud, so chat sent
Authorization: Bearer ollama and 401ed. Only fill the dummy when no key
is configured, and normalize a bare ollama.com origin to /v1.
Omit Gemini 3 Pro Off instead of sending unsupported minimal, clamp
medium to high, and merge advertised Cursor efforts with the fallback
table so CLI-listed gpt-5 still gets a thinking chip.
Do not rewrite bare CodeBuddy model ids to /medium, fail closed when
Google has no model id, and send Gemini 2.5 thinkingBudget instead of
Gemini 3 thinkingLevel.
Map Cursor effort variants and CodeBuddy SDK effort onto the shared
sidebar thinking chip, and send Gemini thinkingConfig for Catty
models that look like they support it.
Give Catty a two-column provider/model menu in the composer, add search
plus recent/pinned models, and move thinking effort onto its own chip
so Claude, Codex, Grok, and Catty share the same compact controls.
Closes#2137Closes#2637Closes#1884
Closes#3078
OpenAI-compatible providers always used Chat Completions. Some
relays cache poorly on that path. Add a per-provider Responses
opt-in so Catty can call /v1/responses while keeping Chat
Completions as the default.
Surface the remote file owner in the SFTP list and tree, using the
existing toggleable column menu. Parse the username from SFTP longname
or ls output, then fall back to uid when a name is unavailable.
Closes#3073
Malformed work factors must fail with the limits error even when
crypto.argon2Sync is missing, so CI on Node 22 still rejects crafted
headers instead of reporting an unsupported runtime.
Check encryption on the prepared key so SFTP/jump hops do not prompt
again after a PPK is rewritten to OpenSSH. Build Argon2-limit tests
from stub headers so they do not need crypto.argon2Sync. Keep the
empty HMAC key for unencrypted PPK v3, matching PuTTYgen.
The overlay window already uses native hasShadow. CSS shadow-lg on the
transparent rounded card paints a second halo, which macOS then
composites as an extra outline under the panel.
Reject non-positive or unbounded memory/passes/parallelism (and
malformed salt) before argon2Sync so a crafted PPK cannot stall the
Electron main process.
Closes#3072
Close-to-tray and app-hide always requested a background lock whenever
app lock was enabled. "Never lock automatically" only disabled the idle
timer, so clicking X on Windows still asked for the password on reopen.
Honor timeoutMinutes === 0 for background locks. Startup and manual
locks still apply. Setting copy now says Never skips both.
Codex P2: a keyboard or accessibility activation can fire with valid
event bounds while the pointer sits on another monitor. Keep those
bounds for display and placement; only reject stale tray.getBounds()
when it disagrees with the cursor.
Closes#3069
App Lock lives on the System tab but was never added to the
settings search catalog, so queries such as "应用锁" and
"App Lock" returned no matches. Index the section and wire a
jump anchor so search can open it.
ssh2 only parses PPK v2 RSA/DSA, so an encrypted PuTTYgen ed25519
key failed even with the correct passphrase. Convert PPK v2/v3
(Ed25519, ECDSA, RSA) to OpenSSH PEM before handing the key to ssh2.
Windows right-click ignored the event bounds Electron already provides
and reused tray.getBounds() / win.getBounds(), which often report y=0
or a blown-up size. Always set 360x520 and anchor above a bottom
taskbar (or below a top one), falling back to the cursor when bounds
are stale.
Closes#3064
Windows shows the system title-bar menu on right-click in drag regions.
The lock overlay is a drag region so the window stays movable, which also
exposed Minimize/Maximize/Close. Suppress BrowserWindow system-context-menu
while locked so the lock screen cannot quit the app.
Closes#3065
The lock screen is a full-window overlay, so it covers the title-bar
drag region and is the only chrome on a locked first paint. Mark the
backdrop as app-drag and keep unlock controls app-no-drag.
Closes#3058
Reconcile the app-lock feature with main's refactored renderer
architecture (publishers/hosts/AppShell) and main-process changes:
- index.tsx/App.tsx: AppLockGate keeps ownership of useSettingsState and
useAppLockState; new AppLockRuntimePublisher publishes the runtime via
appRuntimeBridge; SettingsPublisher now binds the gate-owned settings.
- AppSideEffects: defer deep links, tray port-forward toggles, global
hotkeys and window close commands while locked; flush on unlock.
- main.cjs: keep fresh-session re-lock before main's reusable-window
fast path; before-quit guard delegates to handleBeforeQuit with main's
async plugin-shutdown commitQuit and pending-update cancellation.
- globalShortcutBridge: keep locked-state tray redaction on top of
main's deferred tray panel show logic.
- preload: adopt main's lastPayload replay for terminal popup config
(superset of the gate-delay replay fix).
- vite config: keep dev CSP plugin, adopt main's warn-only stale
optimize-dep handling; electron-builder: keep Windows Hello helper
extraResource with main's CLI-controlled arch targets.
Co-authored-by: Cursor <cursoragent@cursor.com>
The HTTP stream layer used a hard 120s total deadline, so long
reasoning that was still emitting tokens got cut off. Re-arm a
2-minute idle timer on incoming bytes and keep a 30-minute hard cap
for runaway streams.
Closes#3051
MCP allows clients to omit tools/call arguments or send {}. Empty Zod
object schemas rejected the omitted case, so external agents could not
call get_environment and other no-arg tools.
Closes#3049
closeSessionWorkspaceLayoutState pruned the workspace tree but left
focusedSessionId pointing at the closed session. In a focus-mode workspace no
pane then qualified as visible, so the continuously rendered hidden panes all
painted on top of each other (reported in #3046 follow-up). Reassign focus to
a remaining session and drop closed ids from focusSessionOrder, matching the
detach path.
Co-authored-by: Cursor <cursoragent@cursor.com>
A pane that was once full-size kept those pixels in lastVisiblePaneSizeRef
through split view; after a viewport resize, switching back to focus pinned
the hidden pane (and its PTY) at the stale size. Split-visible panes now
invalidate the cache so hidden full-size layouts re-measure the current area.
Co-authored-by: Cursor <cursoragent@cursor.com>
Switching a workspace from split view to focus view left each newly hidden
pane pinned at the split fragment size cached in lastVisiblePaneSizeRef, so
the background PTY stayed narrow and the \r progress spam from #3046 could
still occur. Only full-size layouts feed the hidden-pane pinned size now.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(terminal): pass Esc+. through for readline yank-last-arg
Autocomplete was swallowing Escape, and macOS Option+. typed ≥ instead of Meta-., so the standard shell shortcut never reached bash/zsh.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): allow Shift when Esc+_ yanks the last argument
Underscore is Shift+Minus, so rejecting all shiftKey follow-ups dropped M-_ after autocomplete dismissed.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): keep Esc+_ armed across the Shift keydown
Typing underscore emits Shift before Minus. Clearing the Meta prefix on that modifier event dropped M-_ after autocomplete dismiss.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): do not treat Esc+. as typed input
Yank-last-arg rewrites the shell line. Walking the ESC+. bytes appended a literal period to the command buffer and left autocomplete's typed buffer marked reliable.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(ssh): accept PuTTY-style CLI args from bastion hosts
Reuse the existing ssh:// and telnet:// deep-link path so PAM products that launch putty.exe -ssh user@host -P port -pw password can point at Netcatty instead.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ssh): consume operands of ignored PuTTY flags
Unknown value-taking options such as -m and -D were skipped while their next token was treated as a host or port, which could connect the supplied password to the wrong endpoint.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ssh): reject unsupported PuTTY protocols and unknown flags
-raw/-rlogin/-serial must not fall through to SSH with the supplied password, and valueless switches such as -batch must not consume the following host. Unknown dash flags are now rejected instead of guessed.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ssh): reject missing or empty PuTTY option operands
An empty or trailing -pw was turned into ssh://user:@host, which the deep-link path treats as no password and can then authenticate with a saved vault credential.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ssh): reject unsupported -pwfile, -i, and -hostkey launches
Those options request credentials or a host-key pin this pipeline cannot honor, so connecting with -pw or a vault match would silently change the authentication the caller asked for.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ssh): keep .app/.exe hosts and reject -loghost
Suffix filtering now only covers the Electron script argument, so destinations like prod.app are not dropped. -loghost is rejected because this pipeline cannot honor the logical host-key identity.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ssh): keep packaged argv[1] hosts like prod.js
Suffix filtering now applies only after an Electron binary, so a packaged launch can still use a first-position hostname that looks like a script.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Focus-mode panes are always viewed full-size, but hidden non-focused panes
were laid out at their split rects when hibernate is off (the default). The
continuously rendered xterm and the remote PTY shrank to a 1/N-width
fragment, so \r-refresh progress output (rsync --info=progress2) soft-wrapped
and left one scrollback line per refresh, flooding the terminal when the
host was focused again (#3046). Focus mode now never uses split geometry.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(sftp): add right-click extract for archives
Let SFTP list and tree views unpack zip/tar/gz archives in place via remote SSH exec (or local tar/unzip), so users do not need to switch to another file manager.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): keep extract from clobbering files or dying on unzip output
Write gzip/bzip2/xz results to a staging path and replace the destination only after a zero exit. Drain unzip progress instead of treating routine stdout as a hard failure.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): quote extract cleanup trap and use unique staging files
Remote gzip/bzip2/xz nested a quoted path inside trap, so names with spaces failed before decode. Staging now exclusively creates a unique sibling, and local .gz uses Node zlib.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): refuse single-file extract onto an existing directory
Remote mv would otherwise drop the staging file inside that directory and still report success.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): restore the previous file if Windows extract replace fails
Rename the destination aside before publishing the staging file, instead of deleting it first.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Decrypt master-password and legacy SessionP credentials during MobaXterm
import so migrating hosts do not require re-entering passwords.
Co-authored-by: Cursor <cursoragent@cursor.com>
The backtracking regex cannot enumerate every control that homes the
cursor (DECOM, DECCOLM, ...). Snapshot the skipped start row's text before
a newline-prefixed write; if it changed, something climbed back onto that
row and it is restored and repainted with the rest of the range. This
closes the whole class instead of chasing individual sequences.
Co-authored-by: Cursor <cursoragent@cursor.com>
Setting a scroll region (`CSI Ps;Ps r`) homes the cursor, so a
newline-prefixed chunk using DECSTBM can land back on the highlighted
starting row like CUU/VPA. Keep the pre-write restore and repaint the
start row for such chunks.
Co-authored-by: Cursor <cursoragent@cursor.com>
`CSI Ps d` positions the cursor on an absolute row and can jump back onto
the highlighted starting row just like CUU/CUP, so newline-prefixed chunks
using VPA must also keep the pre-write restore and repaint the start row.
Co-authored-by: Cursor <cursoragent@cursor.com>
A chunk like `\r\n\x1b[1A\rOK\x1b[1B` (multi-line progress redraws) starts
with a line advance but returns to the previous row and partially
overwrites a highlighted keyword. The line-advance exemption skipped the
pre-write restore while the post-write repaint also skipped that row,
leaving the untouched cells with the injected color.
Keep the restore and include the start row in the repaint whenever the
chunk contains sequences that can move the cursor back up (CUU/CPL/CUP,
restore cursor, RI, DECRC).
Co-authored-by: Cursor <cursoragent@cursor.com>
Codex review: putting the turn prompt on a cmd.exe line hits the
8191-char limit, mishandles quotes/%VAR%, and leaves the Node child
alive after Stop. Resolve cursor-agent.cmd to versions/*/node.exe plus
index.js and spawn that argv with shell:false.
Closes review on #3039
A write chunk that starts with a line advance (bash 5.1+ fuses the echoed
newline with the bracketed-paste `\x1b[?2004l\r`, command output, and the
next prompt) restored the previous prompt row's highlight before writing,
while the post-write repaint deliberately skips that row. The keyword
highlight on the command line vanished until a background catch-up ran.
Only treat a chunk as an in-place rewrite of the cursor row when it does
not begin with a line advance: once the cursor leaves the row, later CR/EL
sequences can only touch rows the post-write repaint already covers.
Fixes#3000
Co-authored-by: Cursor <cursoragent@cursor.com>
Address the second Codex pass on #3037. A non-ST ESC now ends an
in-flight OSC 9/777/99 the same way xterm does, so hibernated
replay keeps the following CSI/text. OSC 99 fragments are also
concatenated raw so kitty can split on whitespace.
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
User-invoked Select All / Select Word now pulse the gesture so they
still copy. touchcancel releases the same way as touchend so an
interrupted touch cannot leave SearchAddon able to overwrite the
clipboard.
Address Codex review on #3037. Disabled mode no longer marks tab
activity. Hidden hibernated sessions now scan incoming chunks for
OSC 9/777/99 so Codex can still raise a toast before the tab wakes.
A post-mouseup contextmenu was re-arming the gesture with no later
pointer-up, so SearchAddon could keep copying. Pulse contextmenu and
observe it in document capture so tmux/vim select-word still counts.
Copy-on-select listened to every xterm selection change. SearchAddon
selects the active match on find and again 200ms after resize/write, so
searching for a term then selecting other text left the search term on
the clipboard (issue #3007).
Only write the clipboard after a user pointer gesture on the terminal.
Closes#3019
Codex and other agents emit OSC 9 when a turn completes or approval
is needed, but Netcatty ignored those sequences. Register OSC 9, 777
notify, and kitty OSC 99 handlers, map them to Electron notifications,
and reuse tray focus so a click jumps back to the emitting session.
Ignore ConEmu OSC 9;n progress sequences so they do not become toasts.
Closes#3023
A long line that wraps exactly on a space loses that space on copy
(hbase shell becomes hbaseshell). xterm.js 6 may serve a no-endColumn
translateToString(true) from its string cache via String.trimEnd(),
which cannot tell a real last-column space from empty-cell padding.
Prompt detection and similar callers populate that cache first, so
both the normalizer and raw getSelection drop the space.
Always pass an exclusive end column so the copy path uses
getTrimmedLength() instead of trimEnd().
#3026
An empty Ctrl+C copy binding kept the overlay up and still sent SIGINT.
The same happened for an unbound Ctrl/Cmd+A and for context-menu paste.
Keep the preview only when copy/select-all actually consume the chord,
and hide it before ordinary paste.
#3026
Dragging on the overlay can blur xterm, so native copy never hit the
container listener and the raw wrapped rows went to the clipboard.
Listen on document while the preview is open. Also keep a selected
hard newline at a row boundary instead of dropping it.
#3026
Select All built an element-boundary range, so wrap joining never ran
and copied extra newlines. Context-menu paste selection also left the
overlay up, unlike the keyboard path. Select the text node, accept
element-boundary offsets, and dismiss the preview before pasting.
#3026
The overlay had to keep pointer events so history could be copied, but
then every later click stayed on the preview. A click without a drag
now closes it and restores terminal focus. Copy also joins overlay
rows that xterm marked as soft-wrapped, so a long command does not
pick up extra newlines.
#3026
Urgent interrupt still asked only xterm for a selection. With history
preview text selected, Ctrl+C therefore sent SIGINT into vim before the
copy path ran. Use the same copyable-selection flag for interrupt,
shortcut passthrough, and Kitty broadcast.
#3026
Shift+scroll already overlays the normal-buffer history on the
alternate screen, but the overlay ignored pointer events and any
mousedown or copy chord dismissed it. Selection now stays on the
preview so the usual copy shortcuts, context menu, and copy-on-select
can take that text without leaving vi.
#2923
Copy Tab pins the source transport across preflight. If that shell
closes before the queued channel opens, pendingShellReconnectRisk is
already recorded and TERM-SSHD marks the conn non-reusable for shells.
Decide liveness and allowShellReuse at channel-open time so a pinned
captured source cannot accept an immediately exiting session.
#2923
Idle park is not the only last-shell state. An SFTP or forward lease
keeps the transport live and records pendingShellReconnectRisk; those
reconnects now run the same liveness settle. Known-bad banners also
refuse later shell reuse on that socket so start() dials fresh instead
of borrowing the dead session again.
Keep the liveness timer referenced so node --test cannot exit while
the settle is still pending.
#2923
QiZhi TERM-SSHD accepts a new session channel on a parked connection
and immediately exits 0, so reconnect after close flashes the tab
shut. 1.1.80 skipped PID discovery on that path but still reused the
parked transport.
Known-bad banners now end the transport instead of parking. Idle-park
reconnects on unknown banners wait for the new shell to stay open; an
immediate exit discards the transport, denylists the endpoint, and
falls back to a fresh dial. Copy Tab and live multiplex are unchanged.
When the keyboard shortcut scheme is off, snippet recording still
treated default Mac and PC bindings as occupied. Conflict checks now
use only bindings that can actually fire, and the error names the
conflicting action.
Closes#3025
Older AxonHub 0.9 and some intranet OpenAI-compat proxies emit
`data:{json}` instead of `data: {json}`. The stream parser required
the space, so chat chunks were dropped while the model-list probe
still succeeded.
Parse `data:` per the EventSource spec (optional single space) and
cover both the line and end-of-stream flush paths.
Closes#3020
- Add complete es message dictionaries (core, vault, terminal, ai,
systemManager, scripts) covering all en keys with matching placeholders
- Register 'es' in MESSAGES_BY_LOCALE and SUPPORTED_UI_LOCALES
- Extend locale test coverage to include es
A 300ms initial delay let ChatMessageList start the Streamdown import
while the user was still opening the panel to type. Restore the 4s
expand grace and drop a pending Shiki plugin setState if the message
unmounts before the idle callback lands.
Blocking hydrate on focus left history as raw markdown for as long
as the input was focused. Shiki still waits for a real idle gap.
Prose, lists, and inline code can mount after typing stops even if
the textarea still has focus.
messageResponse pulled @streamdown/code on first markdown import, so
opening a chat with history paid for the full highlighter even when
the reply was just prose.
Render with CJK only first. When a fence exists and the composer is
idle, lazily import the isolated Shiki plugin.
Typing a few characters then pausing still hitch because markdown
hydrate only checked the 800ms activity window. History rows would
mount Streamdown while the textarea still had focus.
Treat focused/composing as busy, wait 2s after the last key, and
keep idle IPC on the same predicate.
The first glyph still re-rendered the whole 1500-line ChatInput because
hasComposerText lived in the same component as the model picker. Token
usage snapshots also broke memo with a new object each time.
Move send-button emptiness onto a tiny external store so only that
control updates, and compare contextUsage by value in ChatInput's memo.
Clearing the box immediately after onSend overwrote the pending draft
while handleSend was still awaiting provider sync. A rejected sync or
stale-scope abort then left the prompt gone even though no user
message was created.
Leave the text in place until the parent clears the draft after the
send is accepted. Unmount commit still uses a ref so setter identity
changes cannot write the prompt back.
Typing still hitched because each IME commit started a 120ms
updateDraft, which re-ran the whole useAIState hook. Parent also
passed a new hosts array and providerSwitcher object on every
render, so ChatInput's memo never held. field-sizing-content
relayouted the textarea on every glyph.
Keep typed text in pending refs until send/hide/unmount. Memoize
mention hosts and the provider switcher. Use fixed field sizing
in the composer.
Send awaits provider sync before dropping the draft. During that
wait, ChatInput's onChange cleanup could fire on a new setter
identity and write the still-visible text back into the pending
draft, so the uncontrolled box kept the last prompt.
Clear the field right after onSend starts, and only commit on true
unmount via a ref so callback identity changes cannot restore it.
Codex P1: switching agent on a pristine composer called ensureDraft
then updateDraft. Missing-to-empty was treated as text-only, so the
store skipped notify and the panel kept the previous agent.
Keep first typed flush silent. Empty draft creation, including agent
switch, is a lifecycle change. Sibling empty drafts still do not
wake other panels.
New Chat wrote an empty composer-only draft, which the text-only
equality treated as identical to the previous typed draft. The panel
skipped re-render, so the uncontrolled textarea kept the old string
and send could still submit it.
Treat emptying draft text as a lifecycle change so listeners wake, and
commit the live box on ChatInput unmount so mid-IME hide still flushes.
Every keystroke was re-rendering ChatInput and the first character
created a store draft that broadcast AI state, so the first 1-2 glyphs
painted and the rest dumped after a stall. IME composition hit the
parent on every pinyin letter, and Chromium spellcheck loaded on the
first word.
Keep the textarea uncontrolled, commit parent state on idle/blur/send,
and treat missing-to-composer-only drafts as text-only so store
listeners do not wake. Draft flush, send, and hide still persist the
current box text.
The throughput test failed on CI because quiet catch-up sliced the
viewport into 32-line chunks. A 40-row terminal therefore called
refresh twice while catching up, which is not an atomic paint.
Recolor offscreen first, then refresh the visible range once after
catch-up finishes. Count post-settle compositor frames separately so
DOM's extra layout paint is not treated as a second catch-up render.
If the terminal or workspace goes away during provider/model preflight,
the awaited send must not create a session on a pruned scope. Bump a
send epoch on unmount or scope change and abort after the awaits.
Codex P2: Agent selector, New Chat, and history stayed clickable while
provider/model IPC ran. Switching agent or starting a new chat then let
the stale send finish and wipe the replacement draft. Disable those
header transitions until preflight ends, and abort if the view still
changed.
Codex P1s: isSending must end after sync so Codex App Server steering
works, and permission mode is frozen via lockTurnConfiguration during
preflight then read from a ref at launch. The first SDK send now uses
the catalog model from this same turn, not a stale curated fallback.
Codex: users could still attach files or change skills while provider
sync was in flight, and the first SDK turn could send a curated fallback
model. Disable the composer for the whole send, and load the runtime
model catalog before starting the turn.
Codex P1s: do not wipe text typed while provider sync is in flight, and
push web-search credentials before the first turn. Also resolve custom
Codex config on show instead of after the idle grace window.
Codex P2s: keep a stable pending draft identity so steer success can
clear the composer; take the send gate before awaiting provider sync;
and hydrate Streamdown after recent typing instead of waiting for blur.
Codex P1: first-launch send could race a 4s idle delay on
aiSyncProviders while main still had an empty provider list. Sync on
panel show and await it in handleSend.
Codex P2: slash-picker /stop and /compact called parent onChange('')
without updating local composerText, so the command stayed in the
textarea. Route those clears through commitComposerText.
Codex P2: focusing or typing cancelled the only scheduled callback, so
provider sync and discovery never ran if the user submitted without
blurring. Re-arm after activity and treat IPC as busy only while the
composer was recently used, not for the entire focused lifetime.
Review found three real gaps: send/new chat left pending composer text in
place, hiding the panel could leave body-portaled menus open, and idle IPC
could still start on the first frame after expand.
Discard pending text when the draft is cleared, close ChatInput and agent
menus when the panel is parked, and give composer-idle IPC the same expand
grace as Streamdown warmup.
Opening the AI panel and typing a few characters hit a main-thread stall.
Streamdown warmup, panel remount, draft-store fan-out, and expand-time
IPC all raced the first keystrokes. import() cannot be cancelled, so the
heavy renderer must not start while the composer is busy.
Keep the composer mounted on hidden retained panels, ignore composer-text
store notifications, debounce draft flushes, and defer discovery/skills/
model IPC until the composer is idle. History stays plaintext until
Streamdown is warm, then hydrates a few rows at a time.
Opening the lazy AI panel can 504 a pre-bundle. The serve plugin used
to send a full-reload, which flashed the splash and wiped renderer
state. Warn instead and pre-optimize the AI/streamdown deps.
ipcRenderer.invoke strips ssh2's status code. A server that says
"File not found" instead of "No such file" still uses code 2, so
classify absence in the main-process handler and return null.
Substring search could treat a permission error as missing if the
path contained "enoent". Unwrap the Electron invoke prefix and match
the known ssh2/Node absence kind at the start of that message.
After #2955, upload conflict checks lstat the destination first.
New files throw ssh2's "No such file"; Electron invoke strips `code`
and wraps the message, so isMissingStatError treated absence as a
hard error and every new upload toasted.
Crash-log and other system notes sat flush against the card when they
were wrapped with the card in SettingsAnchor. Use a shared SettingHint
with a top gap for every system-page footer note.
Add a clipped sheen across the active connection segments so the bar
reads as live work instead of a static slab. Skip it on error and
honor reduced motion.
The connecting dialog bar stretched, shrank, then stretched again
because the initial value was 15, the timeout effect snapped back to 5
whenever hop or phase changed, and hop updates could overwrite a higher
value. Seed once when status becomes connecting and only move forward.
The close-time animation frame survived effect cleanup. Reopening and
searching before it ran could consume the new marker and wipe the new
query. Cancel the frame and ignore it if search is open again.
Clearing the query resets highlights while the bar stays open. Closing
afterwards still needs a leftover sweep, but must not treat that stale
search as a reason to wipe a newer manual selection.
Related to #2980
SearchAddon can leak incremental-match decorations, and WebGL bakes
those yellow backgrounds into the glyph atlas. After Esc the handles
are gone but stained cells remain. Track search decorations on
registerDecoration, paint fill on the HTML overlay only, and resweep
after the search-bar close refit.
Version-only saveSyncConfig no longer check-then-writes SYNC_PREFERENCES.
That upgrade-time race could overwrite a concurrent Settings toggle with
stale autoSync=true. Legacy preference fields stay in SYNC_CONFIG until a
preference writer splits them out.
Key-chord fan-out now delivers remapped LF through handleTerminalInputData
on each peer. handlingKittyBroadcast already blocks re-broadcast, but that
made canBroadcastInput false and armed password assistance on the target.
Keep the re-fan-out guard and only arm autofill for locally originated
submits.
skipBroadcast only stops the raw-string fan-out so peers can re-resolve
the chord from their own buffer. Sudo autofill still has to treat that
key as a broadcast, or a main-buffer sudo/su submit arms password
assistance on the source session.
Pause implement, issue follow-up coding, and the Codex review loop
so Cursor only classifies new issues. Restore with
CURSOR_AUTOMATION_MODE=full and the commented schedule crons.
SearchAddon can re-select the prior active match ~200ms after a write
or resize. The revival guard now clears that selection unless the user
started a new one during the window.
#2962
AI terminal_execute used to append the wrapper to whatever the user
had already typed. Prefix interactive PTY writes with a short
line-clear sequence so the injected command starts on a clean prompt.
Raw and serial sessions are left unchanged.
* fix(terminal): avoid keyword highlight flicker
* fix: address Codex review on PR #2951
* fix: address Codex review on PR #2951
* perf(terminal): defer highlight catch-up under load
* perf(terminal): bound deferred highlight work
* fix(terminal): bound highlight catch-up backlog
* fix(terminal): mirror history wipes in highlighter
* fix(ci): load throughput baseline from PR base
* fix(terminal): preserve highlight rebuild ordering
* fix(terminal): drain highlights before exit capture
* fix(terminal): preserve line state across clear
* perf(terminal): slice history serialization
* fix(terminal): preserve parser state on recolor
* fix(terminal): preserve protocol state on recolor
* fix(terminal): retain live state during recolor
* fix(terminal): close recolor state gaps
* fix(terminal): retain saved colors across recolor
* fix(terminal): serialize recolor side effects
* fix(terminal): color keywords in place without history rebuild
The previous approach rewrote the stream and replayed a second
terminal, which forced private xterm state snapshots and still
risked flicker-adjacent reset work. Writes now stay pristine and
only dirty cells get a new foreground. Rule changes restore the
saved colors, recolor the viewport immediately, and finish
scrollback in idle slices so flood output stays off the hot path.
Related to #2784
Related to #2879
* fix(terminal): keep in-place keyword coloring correct under load
Enter no longer restyles the previous row, and write/catch-up
positions now follow xterm markers so saturated scrollback cannot
skip a just-written match. Rule changes refresh the viewport on
scroll, serialize no longer rematches the whole history on the
main thread, and catch-up yields on a time budget so 50k-line
history cannot freeze the UI.
Related to #2784
Related to #2879
* perf(terminal): keep flood and scroll off the highlight hot path
Pinned log tails were rematching the whole viewport on every
output-driven scroll, and every write allocated a marker. Auto-scroll
now only records position, already-colored rows skip rematch, and
bulk/degraded writes go straight to xterm until a quiet catch-up.
Related to #2784
Related to #2879
* perf(terminal): merge flood writes on a 16ms burst window
Electerm keeps log tails smooth by coalescing attach writes for one
frame after a flush. Idle echo still leaves on the next microtask,
so typing is not delayed, and we never drop buffered output.
Related to #2784
Related to #2879
* fix(terminal): keep keyword originals across append, clear, and alt screen
Same-line appends no longer throw away saved colors just because the
line fingerprint changed. Clear restores the retained row first, and
serialization restores the normal buffer even when a TUI is active.
Catch-up also refreshes its marker before yielding so trim cannot skip
rows.
Related to #2784
Related to #2879
* fix(ci): stop resetting highlight catch-up on every flood write
The throughput gate was comparing cell-color wrapping to raw xterm
and failing at ~18% on DOM CI. Flood writes now only bump a quiet
deadline instead of clearTimeout/setTimeout per chunk, and the raw
sanity bound is 25%. The product check remains 10% versus main.
Related to #2784
Related to #2879
* fix(terminal): rematch recycled rows and cap wrapped catch-up
Quiet catch-up now treats a recycled BufferLine as stale when its
saved highlight colors are gone, so repeated keywords on a full
scrollback still color. Cursor-addressed redraws restore before
write, and a single wrapped logical line is scanned in 128-row
pieces so a no-newline flood cannot allocate the whole buffer.
Related to #2784
Related to #2879
* fix(terminal): accept plugin #RRGGBBAA highlight colors
Plugin decorations allow 8-digit hex. Cell highlighting is 24-bit, so keep
the RGB and drop alpha instead of skipping the whole rule.
* fix(terminal): color cells for partial grapheme matches
A match that ends inside a combining cell maps both endpoints to the same
xterm column. Color that cell instead of building an empty range.
* fix(terminal): rematch flood rows after empty-line stamps
A hot-path \r\n write stamped the following empty cursor row as current.
The next flood chunk reused that BufferLine with ERROR text, and quiet
catch-up skipped it. Fingerprint the stamped content so filled or
recycled identical rows are recolored.
* perf(terminal): avoid flood-path registerMarker after trim
Once a catch-up range exists, later bypassed writes only keep the earliest
bound. A disposed marker collapses to 0 without allocating a new one on
every saturated-scrollback chunk.
* fix(terminal): recolor the row retained by clear
xterm clear keeps the cursor row after we restore originals. Recolor that
surviving line so enabled rules still apply until the next write.
* perf(terminal): stamp no-match rows without cell snapshots
Catch-up only needs a generation and fingerprint when a line has no
keyword. Allocate typed-array originals when a cell is actually colored.
* perf(terminal): treat pinned-bottom recycle as output scroll
Once scrollback is full, baseY and viewportY stay put while rows recycle.
That was treated as a user scroll, so every flood write rematched the
visible area. Keep pinned-to-bottom updates off the rematch path.
* perf(terminal): keep quiet catch-up to a single viewport paint
Catch-up already refreshes visible slices. A trailing recolorVisible()
caused a second settle paint and tripped the atomic-repaint gate.
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Multi-terabyte pools rendered as raw gigabytes (118736.4G), which is hard
to read at a glance. Scale each side of the used/total pair independently
so a mostly-empty pool keeps its used figure (136.37G/6.93T instead of
0.13/6.93T), and emit a single shared suffix when both land in the same
unit so ordinary disks keep the familiar 71.12/878.15G shape.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codex P2: unconditional normalize broke custom proxy prefixes such as
https://proxy.example/anthropic that already complete the SDK base.
Restrict /v1 inference to scheme+host origins (Claude Code style) and
leave other path prefixes unchanged.
Reject sudo+forced-SCP before channel open, and fall back to the standard
SFTP subsystem on exit 127 so reused SSH transports do not re-prompt MFA
on hosts without a standalone sftp-server (e.g. ESXi).
Accept realpath('/') as home only after a successful readdir so virtual/chroot
roots from #2934 still work, while non-listable root no longer skips
/home/<user> and /root probing. Also retry those candidates if listing fails.
The storage event listener uses setShowTabNumberBadgesState but
omitted it from the useEffect dependency array, which triggered
react-hooks/exhaustive-deps.
Pointermove used to setTreeWidth every pixel and re-render NotesManager
including MDXEditor. Apply live width via rAF + aside.style, commit React
state and storage only on pointerup.
Radix ScrollArea's display:table viewport child blocked flex shrink, so
narrowing the notes tree clipped long titles mid-glyph. Constrain the
tree width chain and ellipsize labels so content adapts with the panel.
container-type on .netcatty-mdx-editor makes MDX adjust fixed-anchor coords
as if a containing block exists, but browsers do not. Add a zero transform so
the fixed CB is real and the preview no longer shifts into the notes tree.
Merge seed only wrote activeSessionIdMap, so unsent draft demoted the panel
to draft mode and send created a new session while the old chat still showed.
Prefer persisted workspace active over hasDraft, and materialize panelView.
* fix(#2872): automated Cursor CLI fix
* fix: address Codex review on PR #2875
* fix: address Codex review on PR #2875
* fix(session-logs): sample alternate-screen state after save dialog
Manual session log start previously snapshotted alternate-screen mode
and the initial line before showSaveDialog resolved. Split path selection
from stream start so the renderer re-samples buffer state at activation,
avoiding stale omission/leak if the user enters or leaves a TUI while the
dialog is open.
* fix(session-logs): honor C1 CSI alternate-screen modes in text renderer
8-bit CSI (U+009B) is a valid alternate form of ESC[. Recognize it in
TerminalTextRenderer so DECSET 47/1047/1049 enter/leave still omits TUI
paint from txt/HTML session logs when remotes use the C1 encoding.
* fix(session-logs): apply log-safe RIS reset in text renderer
RIS now leaves alternate-screen mode, resets SGR to defaults, and starts
post-reset shell text on a new log line when needed so mid-line TUI
exits do not glue onto prior output or keep pre-entry colors. History is
preserved because session logs are not live screen wipes.
* fix(session-logs): token-bind dialog path and rebase after RIS
- chooseManualSessionLogPath stores the selected path in main and returns
an opaque selectionToken; startManualSessionLog redeems that token and
rejects renderer-supplied filePath so the save dialog cannot be bypassed.
- RIS rebases screenBaseRow onto a fresh log screen (history preserved)
so post-reset CSI H cannot overwrite pre-RIS text.
* fix(session-logs): seed replay sanitizer on observe attach mid-TUI
When an observe popup restores a snapshot while vim/less is already on
the alternate buffer, re-seed the connection-log sanitizer from the
restored xterm active-buffer type so subsequent TUI redraws are omitted
until leave.
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(notes): domain paste policy + Codex review follow-ups
Move clipboard paste resolution to domain/notes (pure, no React) and
address post-#2868 review items: structured text/plain wins over
wrapper HTML, caret-safe insert for long pastes (no EOF append),
https/protocol-relative image src, entity decode, quote-aware img
attrs, code-region protection, nested HTML islands, hard-break
preservation, height-only image CSS, and complete small-icon widths.
* fix: address Codex review on PR #2869
* perf(notes): cut hover re-renders and heavy image :has() CSS
Reduce perceived lag in large notes by (1) coalescing link-hover
setState with equality checks and rAF, (2) replacing the combinatorial
:has(img[width]) matrix with data-note-img-size markers plus lazy
images, and (3) merging DOM decoration into one observer that debounces
in edit mode so Lexical keystrokes do not re-walk anchors every frame.
* perf(notes): render preview with Streamdown instead of MDXEditor
Vault note preview no longer mounts Lexical/MDXEditor/CodeMirror for
read-only viewing. Preview uses static Streamdown (same stack as chat)
with HTML islands for centered heroes and sized images; edit mode keeps
MDXEditor. This cuts large-note scroll and mode-switch cost while
preserving host-link click handling and compact badge image layout.
* fix(notes): render markdown inside center HTML for Streamdown preview
Streamdown/remark does not parse Markdown nested in HTML blocks, so
README-style <div align="center"> heroes showed raw # ** and badge
syntax. Preprocess preview markdown: expand centered islands via marked
GFM to HTML, and rewrite relative images so Streamdown no longer shows
"Image blocked" chips under app CSP.
* fix(notes): GitHub-style preview with react-markdown
Replace Streamdown note preview (chat-oriented Image blocked chrome and
poor README layout) with react-markdown + remark-gfm + rehype-raw/sanitize
and github-markdown-css. Center HTML islands still expand via marked so
pasted heroes render; relative images and empty links are dropped quietly
instead of alt-as-title or blocked chips.
* fix(notes): keep relative images; map Vite public/ to site root
Stop dropping non-https note images. Preserve absolute and relative src
as-is, except rewrite repo public/ assets to site-root paths
(public/icon.png → /icon.png) so Vite/Electron serve them without
/public/* warnings. Unwrap oversized center blocks so Features-style
body stays left-aligned in preview like edit mode.
* fix(notes): left-align preview body; center only README hero
Force markdown-body text-align left and direct block headings/lists left.
After the first hero thematic break, strip align=center / text-align:center
so Catty/Features sections no longer inherit full-width centering. Tighten
oversized-center heuristics (Catty Agent, lists, blockquotes) without
treating the Netcatty logo title as a body section.
* fix(notes): force preview body left-align (nuclear CSS + unwrap)
Catty/Features still rendered centered because small align=center shells
and inheritance beat partial CSS. Force every node left via * selector,
re-enable center only under [align=center], unwrap all center shells after
the hero --- band, and set inline textAlign left on the preview root.
* fix(notes): stop /public asset requests; fix preview center inheritance
Root cause of body still centering: CSS re-applied text-align:center to
all descendants of [align=center], so one large shell centered Catty/lists.
Keep * left; only the shell itself may center (inline badges).
Root cause of Vite /public/* warnings: stored notes still had /public/...
paths and MDX loaded them raw. normalizeNotePublicAssetPaths rewrites
/public/ and public/ to site-root paths for both edit and preview display.
* revert(notes): restore MDXEditor for preview (drop GitHub markdown path)
GitHub-style react-markdown preview caused layout and asset-path issues
that diverged from edit mode. Preview again uses MDXEditor with
readOnly + mode key remount, matching the pre-Streamdown/GitHub path.
Keep display-time public/ → / rewrite so Vite does not request /public/*.
* perf(notes): reuse MDX editor when switching notes
Remove key={noteId} remount that tore down Lexical/CodeMirror on every
note change. Pass noteId and call setMarkdown on switch instead, after
the existing draft flush, so selection stays snappy and only document
content is replaced.
* perf(notes): defer setMarkdown on switch so selection paints first
Yield a double rAF before Lexical import on note change, show a
blocking overlay for large notes, and ignore external sync while a
swap is in flight. Hardens flaky Suspense loading assertions in SSR tests.
* fix(notes): align task-list checkboxes and make them clickable in preview
Center GFM checkboxes on the first text line, give them a solid hit target,
and toggle markdown from preview clicks since Lexical readOnly blocks
CheckListPlugin. Pure toggle helper lives in domain/notes/taskList.
* fix(notes): close multi-agent review findings on switch/paste/tasks
Gate stale onChange during deferred note-switch import, keep draft refs
in display-markdown space, baseline paste settle on live getMarkdown to
avoid false success after muted setMarkdown, mask code regions in task
toggles, and drop abandoned GitHub/Streamdown preview module and deps.
* fix(notes): address remaining Codex review findings
Clear Lexical undo history on note switch, always inert-block during
deferred setMarkdown, re-annotate host links and image sizes on attribute
mutations, harden entity/code-region paste paths, and angle-bracket image
destinations that contain spaces.
* fix(notes): tighten Codex follow-ups on src, code masks, tasks
Prefer real img src over data-src, normalize public/ paths only outside
code, mask indented/blockquote fences, and accept 1) ordered task markers.
* fix(notes): keep swap payloads fresh; keep nested list tasks
Refresh deferred setMarkdown when the same note's value changes mid-yield,
and stop treating nested list lines as indented code so task toggles stay
aligned with the preview DOM.
* test(notes): update swap guard source assertions
* fix(notes): collision-free code masks, real href, cancel hover rAF
Use a document-unique mask sentinel, match anchor href with attribute
boundaries (not data-href), and cancel the pending link-hover frame on
mouse leave so chips cannot reappear after exit.
* fix(notes): accept longer closing fences in code masks
CommonMark allows closing fences with more backticks/tildes than the
opener; line-scan masking now matches length >= open so public/ paths and
task samples inside those blocks stay protected.
* fix(notes): harden CommonMark fence, span, and indented-code masks
Use homogeneous fence openers, multi-backtick inline spans, and list-context
aware indented-code detection so samples stay masked without breaking nested
task indexing.
* fix(notes): task spacing, angled image dests, deep blockquote fences
Require whitespace after task brackets, parse <angled> image destinations
with spaces, and mask fenced code at any blockquote depth.
* fix(notes): raw-text HTML elements and HTML comment task masks
Locate script/style closers without nested-tag walks so raw bodies with
'<' are removed, and mask HTML comments before task indexing so preview
toggles hit visible checkboxes only.
* perf(notes): drop fade animation on note switch and editor load
Use an instant solid cover instead of opacity/transform fade-in so Lexical
swaps do not pay extra composite cost that can feel more janky than a hard cut.
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Restyle the ImageDialog overlay, panel, labels, inputs, dimension row,
and Save/Cancel buttons with Netcatty tokens so the form no longer
uses stock MDX light/flat chrome in the dark notes editor.
Linked shields/ko-fi badges were reduced to [Label](url) so icons vanished.
Normalize to single-line [](href) or <a><img></a>, allow relative
README image paths again, and style linked images as inline badge rows.
Wrap README-style align=center / text-align:center blocks in
<div align="center"> so MDX GenericHTML keeps layout. Restore ATX
heading markers inside centered h1–h6, skip re-turndown of center
wrappers, and add text-align CSS for align=center in the note editor.
README distro walls use width=48 SVGs that MDX stacks as blocks. Treat
common small width attrs (≤96) as inline-block on both the img and MDX
image wrapper, hide per-icon chrome until hover, and leave large
screenshots as full-width block images.
Preserve HTML img dimensions in note source (including large screenshots).
Side-panel display still uses max-width:100% and height:auto so content
fits without cropping; small logos can honor their smaller width attrs.
Product policy: notes are not a GitHub renderer. Collapse linked badge
images to text links (no ](url) debris), drop oversized screenshot width
attrs so the side panel scales with CSS instead of cropping, and keep
modest widths only for small assets. Center/align HTML remains out of scope.
Keep width/height by emitting sanitized HTML <img> (MDXEditor's HTML
image visitor understands them); plain  alone drops size.
Cap note images at max-width 100% with auto height so large README
screenshots fit the pane instead of overflowing at native pixel size.
GitHub-style pastes mix markdown with <img>/<a name> HTML. Running Turndown
on the whole string escaped headings and collapsed structure. Convert only
HTML islands (Turndown per fragment), keep markdown intact, and enable
MDXEditor imagePlugin so  from paste actually shows.
Replace the hand-rolled HTML→Markdown converter with Turndown + GFM.
Prefer text/html when present (GitHub/browser pastes) so raw <img>/<a name>
islands in text/plain no longer make MDX insertMarkdown silently no-op.
Browser/Word copies put structure in text/html while text/plain is flat.
Resolve HTML to markdown (headings, lists, links, emphasis, tables, code)
and intercept those pastes so Lexical no longer swallows rich HTML.
Structured plain markdown still wins when the user copies .md source.
Structured long paste was preventDefault'd then handed to insertMarkdown;
when Lexical no-op'd or took longer than the short settle poll, the
clipboard was swallowed with no UI change. Prefer document setMarkdown
merge for large pastes and fall back to the same path if a short
selection insert still no-ops after a size-scaled settle window.
- Use scoped historySessions for draft-force and ownership-clear guards
so out-of-scope sessions demote instead of sticking blank.
- On server-stats pause, keep the last snapshot but clear givenUp so
resume can auto-retry after hard failure.
- Fix ProcessRow undeclared vendorLabel via vendorDisplayLabel; make
GPU marks decorative (aria-hidden); attribute Simple Icons as CC0.
- Sticky icon-only when tab bar width is zero; include workspaces in
TerminalLayer ctx deps.
Prevent StrictMode draft demotion after send, keep workspace AI maintenance
mounted with a workspaces list, and keep live Streamdown markdown while
streaming. System Manager gains overflow-aware icon-only tabs, customize
layout, GPU vendor badges, and cache-preserving overview remounts. Settings
search scrolls only the content pane so traffic lights stay put.
When dissolve prefers a focused pane that did not own the inherited chat,
retarget the session and clear the old terminal selection so ownership
filters do not hide it as another scope's active thread.
Co-authored-by: Cursor <cursoragent@cursor.com>
Mount AI maintenance even when no side-panel tools are open, and clear a departed pane's active-map entry when a live workspace retargets its chat.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep inherited terminal-scoped chats visible in a still-live multi-pane workspace by reminting the active chat onto a surviving pane.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep a single SFTP portal/transfer owner when promoting or dissolving workspace tabs so the visible panel retains live browser state.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the surviving terminal on the dissolved workspace's active session view, and remint chats whose original pane is gone so history matching still resolves them.
Co-authored-by: Cursor <cursoragent@cursor.com>
Sidebar chats are scoped to already-open terminals/workspaces; exposing
host_open let Catty expand scope mid-turn and then fail to drive the new
session. Restrict vault.host.open to global/MCP/CLI and stop prompting
Catty to open hosts itself.
Fixes#2856
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Inherit the focused terminal's AI session when tabs merge, hand it back on dissolve, and remap side-panel open/layout/SFTP state so the panel does not look cleared.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Home, the leading root, and the ellipsis fixed while only trailing chips scroll toward the current directory, and always show the ellipsis when hidden segments exist under a budget of one.
Co-authored-by: Cursor <cursoragent@cursor.com>
Always retain the first breadcrumb segment when truncating, clamp tiny budgets, and scroll overflow viewports to the trailing edge so narrow panes still show the current directory without RTL right-align.
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop zsh ghost text past the cursor when cell fg/dim differs from the
accepted input, so mid-line history edits still record full commands
without absorbing unaccepted cross-token suggestions.
Co-authored-by: Cursor <cursoragent@cursor.com>
Drive-letter truncation kept C: visible, but WSL/UNC roots were dropped because isWindowsDrive is false for those paths. Keep the leading UNC share root the same way.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep inline SFTP actions left-aligned and push only the collapsed ⋮ control to the right of the actions row.
Co-authored-by: Cursor <cursoragent@cursor.com>
The first two-row layout right-aligned short paths via RTL clip and pushed toolbar actions with ml-auto. Keep the address on top, left-aligned, with controls underneath.
Co-authored-by: Cursor <cursoragent@cursor.com>
Only prefer the full painted line for mid-line edits when the keystroke
buffer is already a whole token there, and keep the cursor-visible
command when an unaccepted zsh ghost continues past the cursor.
Co-authored-by: Cursor <cursoragent@cursor.com>
Deep side-panel paths were squeezed beside action buttons and clipped at the end. Split path chrome onto a dedicated row and truncate/overflow toward the current directory.
Co-authored-by: Cursor <cursoragent@cursor.com>
Re-arm disposedRef when the autocomplete mount effect re-runs so Fast Refresh
cleanup no longer permanently kills fetchSuggestions. Allow local history/fig
matches during empty-echo lag while still blocking sensitive prompts, and fall
back pane visibility for standalone terminal mounts.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the one-click hostname copy from #2818 without crowding host cards;
expose it next to copy-credentials in list/grid and tree menus instead.
Co-authored-by: Cursor <cursoragent@cursor.com>
Hide search behind an icon toggle, surface create actions as inline icons,
and move bulk delete into a selection bar so the Library toolbar stays compact.
Co-authored-by: Cursor <cursoragent@cursor.com>
Prefer the reliable keystroke buffer under SSH echo lag so local history/fig/snippet matches appear without waiting for remote echo or path listings. Soft-budget remote path completion and keep Enter recording on the stricter alignment path.
* fix(#2826): automated Cursor CLI fix
* fix(scripts): confirm bulk delete and clear host bindings
Scripts side-panel mass-delete skipped confirmation and, when
onSnippetsChange was wired, filtered snippets without clearing host
login/connect script bindings. Confirm first, always dispatch the shared
delete event, and apply deletes via deleteSelectedSnippetsFromVault.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(scripts): harden delete handler against stale vault state
Read snippets/hosts from refs in the shared delete listener so rapid
confirms cannot resurrect already-removed items, and clear pending bulk
delete when the scripts panel hides so the confirm dialog does not
resurface after a mid-prompt hide.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(scripts): keep delete refs current within the same tick
Update snippetsRef/hostsRef immediately after applying a delete so a
same-tick second event cannot rebuild vault state from the pre-delete
snapshot and resurrect removed snippets or host bindings.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: address Codex review on PR #2828
* fix(scripts): hoist bulk-delete confirm outside toolbar popover
Portalled Dialog focus dismissed the compact Scripts popover and cleared
pendingDeleteIds before confirm. Own the confirm in TerminalToolbar and
defer via onBulkDeleteRequest when nested in that popover.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: serialize snippet saves with bulk-delete vault lock
updateSnippets wrote STORAGE_KEY_SNIPPETS without withVaultImportLock, so a
concurrent edit could land between bulk-delete's snapshot read and journal
commit and be discarded. Queue ordinary snippet writes on the shared lock and
include them in waitForPendingVaultWrites.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: rebase queued snippet saves onto latest vault snapshot
Locking updateSnippets alone still wrote a pre-delete full array, so a
popup bulk-delete could be resurrected (or a storage-event version bump
could cancel the local edit). Rebase under the vault lock and supersede
only newer local writers via snippetsWriteOwnerRef.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
* fix: address Codex review on PR #2828
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Related to #2561.
Adds detect-first Ports/Services system manager tabs, network-appliance
read-only gating, and hardened collectors/parsers from Bugbot review.
* feat(portforward): make main process authoritative for runtime state
Phase 1 of #2288: add snapshot/runtime event protocol with epoch+revision,
stop persisting active/connecting/error into localStorage, migrate legacy
stored phases on read, and project unknown when snapshots are unavailable.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(portforward): access runtime bridge via netcattyBridge
Satisfy the no-restricted-properties lint rule for window.netcatty.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(portforward): honor snapshot authority and prune on resync
Default runtime projection to unknown until a successful snapshot,
reconcile (not sync-only) on epoch/revision gaps, serialize runtime
event handling, clear worker runtime subscribers on window destroy,
and align tray unknown UX with RuleCard.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* Cursor: Apply local changes for cloud agent
* fix(terminal): stop first SSH fail under StrictMode remount
Defer backend boot past the double-invoke, cancel superseded vault init,
gate start on vault hydration, and harden hotkey/attach cleanup so the
first connect no longer races a stale close or empty keychain.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* perf: finish StrictMode mega-subscriber plan (accent isolation + docs)
Stabilize published terminal themes across custom-accent drag, apply accent
at chrome/log leaves and CSS injection only, land Phase 0 design/plan docs,
and lock Host-bag / Bugbot-clean contracts for the isolation checklist.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* docs: add StrictMode mega-subscriber design and plan artifacts
Force-add Phase 0 spec/plan under docs/superpowers (gitignored locally)
so the delivery branch carries the approved design and plan copy.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: clear remaining StrictMode doubles and notes editor jank
Gate every AI send and reject concurrent runTurn, latch tray connect flush
and settings persistMounted remounts, and stop notes content drafts from
rebuilding MDXEditor/shell on each keystroke.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* perf: gate hidden notes panel subscribe and skip host-link annotate on keystrokes
Hidden terminal notes mounts keep a live snapshot read but stop listening to
publishes. Host-link DOM annotation follows hosts/mode (preview MutationObserver)
instead of every markdown value change.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: latch SSH transport idle TTL notify under StrictMode
Avoid duplicate main-process notifySettingsChanged on effect double-invoke
when the idle TTL value has not changed.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* perf: freeze inactive vault notes against hosts churn and prefetch MDXEditor
Gate the retained VaultNotesSection notesStore subscription while hidden,
ignore hosts identity in its memo compare when inactive, and warm the lazy
InlineMarkdownEditor chunk when notes become active.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: clear remaining AI StrictMode double-fire hazards
Latch Ask-AI terminal selection on requestId before draft mutation, hoist
Codex App Server IPC bridge to App (ref-counted), and make Catty
requestApproval join an existing waiter for the same toolCallId.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: remount-safe AI send latch and skip stale MCP approval IPC
Replace the component sendInFlightRef with a module key latch so StrictMode
panel remount cannot reopen a mid-flight send, and no-op resolveApproval when
the pending entry is already drained.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* test: allow gated useNotesStore in VaultNotesSection memo contract
The retained notes section now passes enabled:isActive so hidden mounts do
not subscribe; update the VaultView memo source assertion accordingly.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: keep note drafts across mode toggle and external note publishes
Flush ref-only content before edit/preview remount, and skip prop→editor
setMarkdown while a local draft diverges from the last synced value.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* chore: strip StrictMode sermon comments after Bugbot/Comment Sicko pass
Keep effect-order and public-export contracts; drop remount/perf narration
that the latches and tests already encode.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: remount-safe Ask-AI terminal selection latch
Move consumed requestIds to a module Set so StrictMode remount cannot
append the same selection chip twice before parent state clears.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* chore: drop remount latch comment
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Split vault/session/settings into publishers and store-backed Hosts so hot
fields no longer rebuild the whole shell, and harden Terminal boot / startup
effects for StrictMode double-mounts.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(system-manager): parse CANN 24.x Ascend npu-smi info tables
ModelArts / CANN 24.1 tables include Hugepages-Usage and Bus-Id chip rows
that the old regex rejected, so the GPU tab showed zero Ascend devices
even when npu-smi was present. Parse summary+chip pairs like nputop,
always collect the info dump, and fall back to info -m for NPU IDs.
Closes#2811
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* feat(system-manager): harden Ascend parsing from nputop fixtures and polish GPU UI
Borrow real npu-smi samples from youyve/nputop (Apache-2.0) so CI covers
910B2C, 310B4, Atlas A3 multi-chip, and 310P3 process tables without
hardware. Aggregate multi-chip NPUs, parse info-dump processes, and surface
npu-smi driver versions.
GPU tab now keeps a short util/HBM sparkline history and ResourceBar uses
smooth width transitions with load-aware tones, closer to an nvtop feel
inside the existing system-manager chrome.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
downloadToTempWithProgress passed totalBytes:0, which transferBridge
treats as an explicit empty snapshot and skips the remote body, so
external editors opened empty files (fixes#2787).
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): raise autocomplete suggestion default beyond 8
Snippet keyword matches were truncated at autocompleteMaxSuggestions=8
before the floating list, so users with many matching scripts could not
scroll to the rest (fixes#2793).
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): migrate persisted autocompleteMaxSuggestions 8 to 50
Existing installs saved the old default into localStorage with no settings
UI, so raising DEFAULT alone left the popup capped at 8. Treat 8 as the
legacy sentinel while preserving intentional custom caps.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): stop keyword highlight flicker on Enter
Idle Enter was misclassified as user scroll so overscan decorations were
pruned before writeParsed cancel (Ubuntu RTT). Also swap cursor-line
decorations atomically to avoid clear-before-create flash (fixes#2784).
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): catch up highlights after Enter protection window
While enterInputPending blocked scroll-prune, viewport scrolls were also
ignored with no dirty mark. Mark dirty during the window and trigger a
write refresh when Enter protection clears.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): persist keyword highlights across scroll (#2784)
Replace Enter scroll-skip band-aid with mam15mon/#2348 persistence:
keep decorations across scroll, sync only newly exposed rows, bound
retention (~20 viewports / max 1200). Keep Enter write-path protections
and cursor-line atomic swap. Continuous Enter may scroll; prune-on-scroll
is gone.
Co-authored-by: mam15mon <mam15mon@users.noreply.github.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): bound persistent keyword prune to scroll path
Keep Enter/write deferred pruning intact by pruning the retention cap
only after scroll viewport indexing, not on every decoration apply.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): rescan dirty overlap on persistent scroll refresh
Overlapping scroll only scanned newly exposed rows then cleared the whole
viewport dirty set, which could drop in-place redraw work when scroll
outranked a pending write refresh. Rescan write-dirtied overlap lines and
only clear dirty for ranges that were actually processed.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Co-authored-by: mam15mon <mam15mon@users.noreply.github.com>
Closing the active tab fell back to last workspace/solo in array order,
so opening a temp tab then closing it jumped away from the prior work
tab (fixes#2788).
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): protect title IME, surface persist failures, harden paste
Note titles rewrote controlled value during CJK composition (Sogou Wubi).
Notes localStorage writes ignored QuotaExceededError so restarts lost
content. Markdown paste intercept could preventDefault with a no-op insert
(fixes#2783).
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): commit title draft on blur for IME composition
IME-only title entry never called onCommit until compositionend; blur
could flush an empty draftTitle and then adopt the stale external value.
Commit the local draft on blur before parent flushNoteDraft.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): stash IME title drafts in refs without controlled rewrite
Composition updates now live-stash into draftTitleRef for teardown and
note-switch flushes, while onCommit still waits for idle IME. Blur syncs
superseded external titles before flush so stale drafts cannot overwrite.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): clear stashed title when IME composition is superseded
compositionEnd now live-stashes the adopted external title so pagehide
and note-switch flushes cannot persist rejected composed text.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): cancel draft flush during IME title stash
Prior idle commits could still debounce-flush mid-composition and rewrite
the controlled title. Stash now clears the timer, and external supersede
in the adopt effect live-stashes the authoritative title.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): dedupe quota failure toasts during autosave
Debounced draft flushes can hit QuotaExceededError repeatedly; rate-limit
the error toast so users are not spammed every 300ms.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Address Bugbot: do not skip every `# [` comment. Only ignore known app
debug tags (transferDiag, FileWatcher, SessionLogStream, ...), while
still failing on unknown bracket diagnostics like `# [fatal]`.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Ignore success-case TAP YAML diagnostics and normalize volatile console
noise in baseline comparison so red-but-unchanged candidate runs pass as
baseline_only. Align the session-backed fastPut expectation with live-path
uploads, harden SCP abort teardown races, drop mixed hallucinated research
citations instead of failing classify, and soften verification failure
copy so it no longer claims the patch introduced the failure.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* refactor: migrate architecture-debt hooks into application/state
Move SFTP Wave A stores/hooks and related vault/AI/terminal/systemManager
hooks out of components into application/state, update importers, and keep
thin deprecated re-exports at the old paths.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* refactor(sftp): align local bookmarks store API with global bookmarks
Export subscribe/get/set/rehydrate helpers from localSftpBookmarks to match
the globalSftpBookmarks external-store pattern.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(electron): reduce baseline memory via spellcheck/GPU/prewarm guards
Disable spellcheck on BrowserWindows and the default session, drop spare
renderers, gate aggressive GPU switches behind NETCATTY_COMPAT_GPU, and make
settings prewarm opt-in via NETCATTY_PREWARM_SETTINGS.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* Isolate notes and customAccent from TerminalLayer hot props
Route vault notes through notesStore (shellHistoryStore pattern) and
app accent through appearanceChromeStore so note edits and accent-drag
ticks no longer rebuild TerminalLayer. Notes/AI slots and Terminal leaves
subscribe locally; VaultView and open-note callbacks stay unchanged.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ui): cut unnecessary AppView/VaultView/settings re-renders
Stabilize TopTabs close handler, memo AppHostTreeLayer, exclude accent from
settingsVersion, ignore connectionLogs off the logs section, share lastConnected
host refs, and keep rename dialog drafts local so chrome domain stays stable.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* chore: package size, dead code, and consolidation cleanup
Remove unused direct deps, exclude Vite-bundled renderer packages from
electron-builder, delete high-confidence dead code/no-op transfer warm
wiring, consolidate cloud provider IDs and KnownHost/SFTP helpers, and
land UI/AGENTS quick wins (rAF text batching, notes draft debounce,
streaming plain text, tempDirBridge, diagnostics adapter, External MCP
setters).
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: stabilize rAF text batching and diagnostics tests
Polyfill requestAnimationFrame for Node, flush pending text before
steer buffering, bypass rAF while steer is in flight, and stub
global localStorage for AI panel diagnostics adapter tests.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: correct import paths after application/state hook migrations
Migrated vault/AI/system hooks still used components/-relative imports;
point them at repo-root domain/components/types/lib instead.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: address Bugbot/Codex regressions from perf cleanup
- Keep blank Enter from closing RenameDraftDialog; only reset rename state after a non-empty submit
- Flush note drafts before vault mutations so pending title/body edits are not overwritten
- Re-apply appearanceChromeStore accent on appearanceTheme in Terminal, and keep layer themes unaccented
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): flush draft before markdown export paths
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: keep editor-close hotkey ref fresh during render
Assign handleRequestCloseEditorTabRef in render instead of useEffect so
Cmd/Ctrl+W never hits the App stub before the effect runs.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: keep accent in chrome themes without TerminalLayer thrash
Restore accent in globalAppearance for chrome/injection consumers.
Keep resolveFocusedAppearance identity stable across accent drag via
accent ref, while Terminal leaf still re-applies appearanceChromeStore.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: keep compose chrome accent live and merge note renames
Subscribe theme-panel focusedAppearance to appearanceChromeStore so
compose-bar chrome updates during color-picker drag even when
resolveFocusedAppearance identity stays stable. Tree renames now merge
title into the post-flush note instead of replacing from a stale row.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: clear terminal accent when switching back to theme mode
Re-resolve appearanceTheme by catalog id before applyCustomAccent so a
stale baked custom cursor/selection cannot stick after accentMode returns
to theme while TerminalLayer memo ignores accent props.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: register unsaved prompt singleton during render
AppView close handlers call promptUnsavedChanges outside the old
render-prop. Assign the singleton during render so Cmd/Ctrl+W and tab
close never hit the pre-effect null window that auto-cancels.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: keep vault import hooks UI-free and flush notes on teardown
Move ImportOptions into application/state and inject a notifier so
useVaultImportHandlers no longer imports components. Notes drafts also
flush on pagehide/beforeunload when Electron tears down without React
unmount.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: move AI terminal session context builders into domain
buildAITerminalSessionInfo and AIPanelContext now live under domain/ so
application hooks no longer import TerminalLayerSupport and create a
UI → application → UI cycle.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: drop duplicate AIPanelContext type from TerminalLayerSupport
The type is re-exported from domain; the local definition conflicted.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: keep migrated state hooks free of UI-layer imports
Move aiChatStreamingSupport into infrastructure/ai and poll list helpers
into domain/systemManager so useAIChatStreaming / useSystemManager no
longer import from components. Leave thin re-exports at the old paths.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: move remaining migrated-hook deps out of components
Host-key verification types/helpers now live in domain/, and SFTP column
layout types live in application/state/sftp/columnLayout. Application
hooks no longer import those definitions from the UI layer.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: clear lint blockers and flush notes when panels hide
Move AI panel diagnostics persistence into application/state so
components stop importing localStorageAdapter. Flush note drafts when
retained NotesManager mounts become inactive, and silence related lint
warnings in theme/host-key helpers.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(notes): publish notesStore sync on vault note updates
updateNotes/updateNoteGroups now publishNotesSnapshot immediately so
AI/notes consumers do not briefly read a stale catalog after a hide
flush. Flush inactive drafts in useLayoutEffect before paint.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): instant folder-drop scan UI and drop full-tree pre-scan
Restore interleaved folder transfers as the only non-compressed path, remove
the folder pre-scan setting, and make local folder drops show a scanning task
with live discovered counts via native listLocalTree (with cancel + progress).
UI shows "done · found" instead of a fake grand-total percentage while
discovery is still growing.
* fix(sftp): make folder scan cancellation bridge-safe
* fix(sftp): preserve path-only terminal drops
* fix(terminal): accept native folder drop paths
* fix(sftp): keep scan task cancellable during setup
* fix(sftp): preserve scan failure state during setup errors
* fix(sftp): keep folder scan task across retries
* fix(sftp): cancel scan task immediately
* fix(sftp): keep cancellation active through session setup
* fix(sftp): settle failed drop upload retry
* fix(sftp): preserve cancellation in final scan cleanup
* fix(sftp): harden folder scan cancellation and conflicts
* fix(sftp): finish Codex follow-ups on folder scan cancel UX
- Abort sibling listLocalTree walks when one multi-root scan fails
- Prefer ERR_*_CANCELLED over matching "cancel" in error text
- Clear scanning phase on settle; only label live rows as Scanning
- Omit directory metadata sizes from drop entries used for totals
* fix(sftp): stream folder discovery into concurrent uploads
Local path-backed folder drops now edge-scan and edge-transfer: listLocalTree
streams entry batches while upload workers consume them, so the first files
start before a 100k-file walk finishes. Cancel aborts the walk, clears the
queue, and stops creating child tasks. Compressed uploads still materialize
fully then pack.
* fix(sftp): harden progressive folder UX, retry, and size-based uploads
Align the SFTP panel with transfer-center progress, keep nested tree batches
until tree-end, honor pause during progressive enqueue, add low-cost retry for
external drag-drop files, and drop whole-file upload digests for industry
size-based resume (download live-log prefix checks unchanged).
* fix(sftp): address multi-agent review on progressive upload and retry
Gate progressive drops to path-backed folders only, prefer pool sessions on
drag-drop retry with in-flight and cancel guards, soft-check upload mtime
without fail-open contentVerifiedSeparately, skip multi-root pause HOL,
and fail closed when the local tree stream misses tree-end.
* fix(sftp): finish multi-root pause HOL and parent rollup guards
Race-wait on all latched parents so resuming a non-head folder can proceed,
and only roll progressive parents to completed after terminal failed status.
* fix(sftp): address Codex progressive conflict and hang findings
Add root-level conflict preflight to progressive folder uploads, wake all
backpressure waiters, preserve cancel listeners across uploadEntriesDirect,
and surface empty-directory mkdir failures.
* fix(sftp): optimize growing-download verification
* fix(sftp): harden growing-download prefix verification
Skip unprivileged SSH digest commands for sudo SFTP sessions and reject
empty-input digests so root-only sources fall through to the elevated
SFTP channel. Hash remote prefixes in concurrency-sized windows so
verification keeps a bounded memory footprint instead of retaining the
full downloaded prefix.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): fall back when remote digest command times out
Treat SSH digest open/run timeouts as a miss for the optional
command-path optimization so growing-download verification can still
prove the prefix via SFTP ranges instead of failing a completed transfer.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): propagate digest open timeouts after transport invalidation
SSH_EXEC_OPEN_TIMEOUT invalidates the physical transport in
boundedSshExec, so falling through to SFTP on the same session is unsafe.
Keep run-timeout fallback to SFTP, but fail closed on open timeout.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): mark digest open timeouts as noTransferFallback
SSH_EXEC_OPEN_TIMEOUT already invalidates the transport. Tag it with
noTransferFallback so downloadFile's isolated→shared catch fails closed
instead of retrying verification on the poisoned session.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): fail closed on verify timeouts; range-hash checkpoint resumes
Mark SFTP verification request/stream timeouts with noTransferFallback so
downloadFile does not retry body transfer on a channel that still owns a
timed-out request. Allow checkpoint-complete growth verification to use
bounded prefix ranges under the session fast-download slot, including
sudo paths that skip unprivileged SSH digests.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): drop wedged SFTP channel after verification timeouts
Clear and end the cached SFTP channel when prefix verification hits an
OPEN/READ/stream watchdog or digest exec-open timeout, so later
browse/transfer work cannot reuse a channel that still owns cancelled
requests.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): use window inactivity watchdog for prefix range hashing
Reset a single per-window READ inactivity timer whenever any range
completes, instead of arming independent deadlines that all expire
together on slow or serialized SFTP servers.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): abandon channel on stalled CLOSE; share abort gate
Drop the cached SFTP channel when verification CLOSE times out or fails,
and fan out concurrent prefix READs through one shared AbortSignal gate
so the bounded window does not attach dozens of listeners.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): parallel folder discovery and unblock transfer stalls
Address #2712 / #2556 leftovers after the pipelined fail-closed work
(#2449 / #2720 / #2761): keep bulk body I/O on concurrent READ/WRITE only,
surface upload digest prep as verifying instead of a silent hang, make the
fastPut path-gate wait cancelable (#2755), parallelize multi-select enqueue,
and bound-parallelize directory listings so folder totals appear faster.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* feat(sftp): folder pre-scan and skip unchanged files
Absorb rsync strengths without an rsync backend: optionally walk the
full tree before transfer for stable file totals, and skip files whose
size and mtime already match the destination.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): drop unused DiscoveredTransferFile import
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix: address Codex review on PR #2772
* fix(sftp): address Codex review on path gate, aliases, and worker drain
- Invalidate same-transfer fallback when a force-released path gate gets a late truncating OPEN
- Use per-branch ancestors so sibling symlink aliases copy under pre-scan BFS
- Keep interleaved subdirectory walks sequential for deterministic manifest indices
- Drain transfer/bounded workers before propagating errors; ASCII punctuation
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): canonical pre-scan file order and pre-2001 mtime skip
Sort discovered files with compareDirectoryTraversalPaths before index
assignment, and treat timestamps >= 1e11 as milliseconds so year-2000
local mtimes still match SFTP second precision.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): bound multi-select downloads and preserve dest mtime
Address Codex review on PR #2772: serialize local blob reads, bound
multi-select root downloads before pre-scan, replace remaining Unicode
em dashes, and stamp destination mtimes after successful transfers so
skip-unchanged can match on a later pass.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): keep in-place OPEN poison until callback settles
Address Codex review on e2cc8241: do not force-release path gates for
in-place truncating OPENs, fail closed on pending-OPEN wait timeouts
without clearing poison, and replace remaining Unicode em dashes in
ASCII-only transfer modules.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): fail closed when in-place OPEN poison is held
When an isolated in-place truncating OPEN leaves the path gate poisoned
after channel error/cancel, mark the transfer terminal (noTransferFallback)
so fastPut/concurrent-shared cannot wait forever on the unreleased prior
gate.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): omit cyclic dirs from pre-scan plan and lower mtime cutoff
Only record discovered directories after a visit is accepted so symlink
cycles are not mkdir'd as empty targets, and treat magnitudes >= 1e10 as
milliseconds so early-1970s local Date values still match SFTP seconds.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): count max-depth symlink gaps and skip symlink quick-check
Pre-scan now surfaces max-depth symlink directory omissions as transfer
errors (matching interleaved walk), and discovered file symlinks carry
isSymlink so skip-unchanged does not trust link-node size/mtime.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): unit-aware skip mtimes and interleaved symlink bypass
Declare mtimeUnit on skip identities so early-1970 millisecond values
normalize without magnitude cutoffs, and bypass skip-unchanged for
symlinks on the interleaved (non-prescan) directory walk as well.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): bound local pre-scan and preserve SCP destination mtimes
Apply the same directory/entry traversal budget to local folder pre-scan,
and best-effort touch SCP upload targets after commit so skip-unchanged
can match on a later pass.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): address Codex review on pause, skip restat, mtime bound
- Honor transfer pause during folder pre-scan BFS waves/listings
- Re-stat source immediately before skip-unchanged on pre-scanned files
- Bound best-effort destination setStat/utimes so sendComplete cannot hang
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): harden skip restat and pre-transfer mtime capture
- Require a fresh source stat before skip-unchanged (prescan + interleaved)
- Capture source soft identity before bytes move for non-resumable/SCP
- Drop post-commit mtime re-stat fallback; keep ASCII in touched comments
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): propagate fresh re-stat size into interleaved transfers
Use the re-statted source size/mtime for child tasks on the non-prescan
path so grown files are not truncated to the stale listing size.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): omit stale listing size after re-stat failure
When source re-stat fails, clear child totalBytes/mtime so
startStreamTransfer omits an explicit snapshot and the bridge
re-stats on the dedicated session instead of truncating to the
stale listing size.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): make soft-identity capture cancelable
Race pre-transfer source soft-identity capture against cancel and
pass the transfer abort signal into requireSftpChannel so a dead
SFTP reopen cannot block cancel for the channel timeout.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
* fix(sftp): make fastPut pending OPEN gate wait cancelable
An isolated concurrent OPEN that dies without a callback leaves
pendingWriteOpenPathGate unresolved by design. Unconditionally awaiting
it before fastPut pinned the transfer after abort was cleared; race the
wait with cancel and bound it fail-closed so Cancel/lease cleanup can
settle without racing a still-pending truncate (#2755).
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): end fastPut channel on gate wait abort
Clear the gate-wait timeout on cancel so abandoned rejects cannot fire,
and end the reopened isolated channel when the wait fails so Cancel /
fail-closed timeout cannot leak an SSH subsystem.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): poison path gate after fastPut OPEN wait timeout
When a dead write OPEN leaves truncatingSharedWriteOpenGates unresolved,
fail-closed fastPut timeout now marks that entry failed so later same-path
uploads reject promptly instead of hanging on waitForPrior. Keep the
barrier until a late OPEN release clears it; waitForPrior rejection no
longer starts OPEN.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): keep path-gate poison across successor waiters
Reinstall the poisoned truncatingSharedWriteOpenGates entry on fail() so a
same-path waiter that replaced the map slot cannot release the barrier for a
third OPEN. Propagate fail (not resolve) when abandonGateWait sees a poisoned
prior, and poison on cancel during the fastPut gate wait as well as timeout.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): let OPEN owner clear poison after successor fail
Successor waiters that propagate a poisoned prior must not reinstall
themselves into truncatingSharedWriteOpenGates. Otherwise the OPEN owner's
late release cannot delete the barrier and same-path uploads stay
fail-closed forever after the dangerous OPEN has settled.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): clear path-gate poison after transport end
Arm a 2s post-close clear when the owning isolated SFTP channel ends so a
host-keyed poison from a never-callback OPEN does not fail-closed every
later same-path upload until process restart. Keep the grace so a late
OPEN racing end() still has a barrier.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): arm path-gate poison clear without per-OPEN listeners
Install the post-poison transport-gone clear from fail() instead of
attaching end/close listeners on every write OPEN. Shared browse channels
never emit those events per transfer, so the old approach leaked listeners
and could hit MaxListenersExceededWarning.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): only OPEN owners arm path-gate poison cleanup
Track openIssued / priorEntry on truncatingSharedWriteOpenGates so a
waiter that reaches fastPut timeout poisons the OPEN-owning ancestor
instead of reinstalling itself and clearing the barrier while the prior
transport may still deliver a late truncating OPEN.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): do not arm ancestor poison cleanup from waiter fail
When a waiting upload times out and fail() walks to the OPEN-owning
ancestor, keep that ancestor's barrier until its own OPEN settles. Only
the OPEN owner entry arms releaseAfterTransportGone after its transport
is already gone.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* feat(terminal): add disconnect/reconnect controls on session status bar
Workspace panes could not reach tab-level reconnect. Expose disconnect
(without closing the pane) and reconnect beside the host info actions so
split sessions stay operable. Closes#2769.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): abort in-flight boot on status-bar disconnect
Disconnect keeps the pane mounted, so cancel's unmount cleanup never runs.
Flip isBootActiveRef (and isCancelling) so a late startSSH/startMosh attach
cannot resurrect the session after the user disconnects mid-connect.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): ignore stale start UI after status-bar disconnect
When disconnect aborts an in-flight connect, starter catch paths must not
reopen auth or repopulate errors. Gate SSH/telnet/mosh/ET/local/serial
failure UI on isTerminalBootActive and harden the boot effect awaits.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): hide disconnect/reconnect on compact popup terminals
Owned command popups use compactToolbar with a one-shot startup command.
Exposing reconnect there can re-run that command; keep the controls on
normal tabs/workspace panes only.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): use boot epoch so reconnect cannot revive aborted starts
Disconnect alone flipping isBootActiveRef is not enough: an immediate
reconnect re-arms boot, and a late startSSH from the aborted attempt can
still attach. Capture a boot epoch per attempt and ignore stale attaches/UI.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): do not let stale attach abort a newer reconnect
tryAttach failure for an expired boot epoch must close the orphan session
only. Calling abortSessionStartAfterUnmount() would force disconnected on
a reconnect that already re-armed boot.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): reject late host-key prompts after disconnect
Disconnect can land before pendingHostKeyRequestId is set. Auto-deny
onHostKeyVerification when boot is inactive or status is disconnected
so approval UI cannot reopen on an aborted pane.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): cancel wake and MFA when status-bar disconnects
Invalidate hibernation reconnect-wake tokens on disconnect so a late wake
cannot re-arm boot. Reject/cancel keyboard-interactive prompts for
disconnected panes and clear any already-queued MFA for that session.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): ignore stale SSH catch UI and password fallback
Check boot attempt currency before resetting reconnect UI state on
SSH start failure, and before launching key→password fallback after
disconnect so a replacement reconnect is not interrupted.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): guard stale SSH progress and host-key prompts
Ignore chain-progress callbacks from superseded boot attempts, and
thread bootEpoch through SSH host-key verification so a late prompt
from an aborted start cannot overwrite a replacement reconnect.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): correlate MFA and jump host-keys with boot epoch
Forward bootEpoch through jump-host verification and keyboard-interactive
prompts, and reject superseded MFA when the retained tab has already
started a replacement reconnect.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): keep replacement SSH session alive across stale starts
Skip closeSession for superseded starts while a newer boot still owns
the shared sessionId, and avoid clearing MFA wait state before the
attempt-freshness guard on SSH success.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): own shared sessionIds by boot epoch
Claim SSH/local registry slots with bootEpoch so a stale start cannot
overwrite a replacement, and make closeSession no-op when the payload
epoch does not match the live session owner.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): claim bootEpoch for all reconnectable backends
Pass bootEpoch through Telnet/Mosh/ET/serial starts, claim registry slots
the same way as SSH/local, and dispose displaced owners when a newer
boot replaces the shared sessionId.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): protect preload listeners and ET artifacts on displace
Defer epoch-scoped closeSession listener teardown until main confirms
ownership, and remove ET external-auth temp artifacts when a newer boot
displaces the previous registry owner.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): clean rejected Mosh starts and keep replacement listeners
Kill superseded Mosh/ET PTYs and auth temp files when claimSessionSlot
rejects, and never clear shared preload listeners on epoch-scoped closes.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): settle superseded boots and stop displaced log streams
Reject Telnet/SSH claim failures through Promise reject/failReuse instead of
uncaught EventEmitter/.then throws, and stop a displaced session's log stream
so a logging-disabled reconnect cannot append into the old file.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): keep woken runtime when disconnect cancels hibernate wake
Disconnect invalidates in-flight hibernated reconnects with keep mode so a
successful wake that already cleared hibernatedRef is not disposed into a
dead pane that can never reconnect. Unmount still disposes orphan runtimes.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): bind reused SSH shellPid only to the claimed session
Late PID discovery after Copy Tab reuse must not write onto a newer
bootEpoch that already replaced the shared sessionId registry slot.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): await plugin cancel cleanup and clear boot epochs on teardown
Track plugin start/cancel promises so Disconnect→Reconnect waits until the
external session finishes unregistering, and stop unmount teardown from
republishing boot epochs into the process-wide map.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): cancel SSH passphrase prompts on disconnect
Register a pending-boot AbortSignal for SSH starts, abort it (and session-
scoped passphrase requests) from closeSession even before a registry slot
exists, and filter/drop late passphrase modals by boot epoch / disconnect.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): close owned boot epoch and scope passphrase cancels
Capture the pre-bump epoch for disconnect/teardown closeSession so live
transports are not skipped by epoch mismatch, cancel only passphrase prompts
at or below that epoch, and revalidate boot currency after async passphrase
lookups before queuing a modal.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): tag Telnet auto-login and Mosh ready with bootEpoch
Emit bootEpoch on telnet auto-login and mosh:ready events so overlapping
Disconnect→Reconnect boots ignore cross-delivered callbacks meant for an
older shared sessionId.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): update disconnect assertion and cancel pending serial opens
Align the disconnect source regression with invalidateBootEpochForClose, and
abort in-flight serialPort.open attempts via pending boot AbortSignal so
Disconnect→Reconnect cannot leave a stale open racing the replacement.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): keep flow-pause leases on skipped epoch closes
Worker close:await previously cleared pause ownership in finally even when
the worker returned skipped for an epoch mismatch, dropping the live
replacement's lease. Only clear on non-skipped closes; epoch-scoped
fire-and-forget close similarly defers to onSessionClosed.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
When the terminal worker is disabled, startSSHSessionWrapper probed LAN
access but dropped the resolved address before startSSHSessionWithRetries.
Share attachMacLocalNetworkProbeResult with the worker path so split-DNS
FQDN first hops still get Local Network error guidance.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): harden macOS Local Network TCC trigger for LAN SSH
Replace the main-process TCP probe with Apple's TN3179 UDP discard-port
connect, resolve vault hostnames/.local before probing, hold the socket
briefly so TCC can present the alert, and annotate EHOSTUNREACH errors
that embed LAN IPs even when the host was stored as a DNS name.
Addresses recurring #2673 / #2663 / #1040 Local Network silent failures.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): address Codex Local Network review findings
Clear the UDP connect safety timer once connected so a slow .local
resolve cannot truncate the TCC hold. Mark worker-forwarded start
payloads after the main-process probe so utilityProcess skips a second
hold. Keep the new test comments ASCII-only.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): bound Local Network DNS lookup by probe timeout
Codex noted that hostname resolution before the UDP probe had no
deadline, so a hung DNS lookup could stall every non-literal SSH start.
Race the lookup against the existing probe timeout and skip probing when
it expires so the normal SSH dial can proceed.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): tighten Local Network error address parsing
Ignore LAN bind addresses in Node's "- Local (ip:port)" suffix so public
SSH failures are not mislabeled as Local Network denials. Also extract
embedded IPv6 ULA/link-local remotes from unreachable errors.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): only hint Local Network when the first hop is LAN
A .local final host reached through a public proxy or jump must not force
the macOS Local Network hint when the failing dial never touched LAN.
Annotate from the first hop and remote error address instead.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): probe jump-level proxy as the first Local Network hop
Match sshBridge first-hop wiring: a usable jump.proxy overrides the
session proxy and the jump hostname. Otherwise a .local jump behind a
public proxy probes the wrong host, and a LAN proxy in front of a public
jump is missed.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): retry .local Local Network probes over udp6
IPv6-only mDNS hosts never resolve on a udp4 socket, so the TCC trigger
could miss them. For unresolved hostnames try udp4 then udp6.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): share Local Network probe timeout across UDP families
udp4 then udp6 fallbacks for .local hosts now inherit one overall
deadline instead of restarting DEFAULT_PROBE_TIMEOUT_MS per family.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* chore: re-request Codex review after unanswered pass
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ssh): skip Local Network probe for ProxyCommand hops
Treat an active jump/session ProxyCommand as a terminal first hop so we
do not fall through to a LAN hostname and spuriously prompt. Also share
one wall-clock deadline across DNS resolution and UDP family attempts.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* test(ssh): tolerate residual Local Network probe budgets in hold test
Shared-deadline math can arm the safety timer at 499ms instead of exactly
500ms. Identify that timer by being larger than the hold, not by equality.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(macos): preserve ProxyCommand skip during Local Network error annotation
Keep ProxyCommand's skipProbe sentinel through annotateMacLocalNetworkErrorMessage
so .local hop names do not get a false Local Network hint when TCP probing was
intentionally skipped. Split residual UDP budget evenly across remaining address
families so dual-stack and .local IPv6 attempts still get time.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* test(ssh): fire residual Local Network safety timers in hang probe test
Shared-deadline math arms the UDP safety timer with a residual budget
(e.g. 2999ms) rather than the exact DEFAULT_PROBE_TIMEOUT_MS constant,
so matching only the constant left the hang-socket test unable to settle.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(macos): never hint Local Network for ProxyCommand errors
skipProbe means an external ProxyCommand owns the dial. Do not append the
Netcatty Local Network TCC hint from child-process LAN addresses in the
error text — that guidance would send users to enable Netcatty for a
connection Electron never made.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(macos): ignore downstream LAN addresses behind public first hops
When a public proxy/jump owns the first dial, unreachable addresses embedded
in the error often name a private host the remote side tried to reach. Only
use those addresses as Local Network evidence when they identify the local
first-hop dial.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(macos): keep LAN hints for private DNS first hops and ASCII comments
Treat common private DNS suffixes (e.g. bastion.lan) as Local Network
evidence so hostname-based first hops still get guidance when Node reports
the resolved IP. Replace em dashes and arrows in this module with ASCII.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(macos): keep Local Network hints for unqualified first hops
Single-label jump/proxy names such as "dev-viet" resolve to LAN IPs that
appear in Node unreachable errors. Treat those hostnames as local-side
evidence so annotation still guides users to macOS Local Network settings.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(macos): carry resolved first-hop LAN addresses into error annotation
ensureAccess remembers the LAN IP it probed for a hostname first hop and
forwards it on the worker start payload. Annotation uses that resolved
address so private split-DNS FQDNs like bastion.example.com still get
Local Network guidance without treating public proxies as LAN.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): restore hibernate scrollback before viewport
Hibernate wake was writing the viewport first and appending older
scrollback on idle. Under a finite xterm scrollback cap that trims the
just-restored newest rows, so switching back to a hibernated tab could
permanently drop the end of large output (#2762). Replay scrollback →
viewport → pending on the wake path while keeping chunked writes.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): prefer full hibernate snapshot on wake
SerializeAddon range slices omit the seam newline, so concatenating
scrollback+viewport can merge boundary lines. Prefer the coherent full
snapshot for wake history, with a scrollback-then-viewport fallback, and
cover the seam with a real SerializeAddon regression.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* style(terminal): keep hibernate wake comments ASCII-only
Address Codex P3: replace em dash / arrow punctuation in touched
comments per AGENTS.md ASCII convention.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): drain hibernate pending via take-and-clear on wake
Full-history replay widens the window where capped pending output can
grow without increasing length. Length-based slice drains then skip new
bytes. Capture and clear pending before replay, then drain pure deltas.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): final pending drain before hibernate listener teardown
After the bounded take-and-clear loop, take any remaining pending once
more before stopHibernateListeners so wake-time output is not dropped.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): stop hibernate listeners before final pending drain
Awaiting the final pending write while listeners are still live can
lose already-acked bytes that arrive during that write. Stop listeners
first, then take-and-replay any remainder.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): keep hibernate exit listener through final pending replay
Stop only the data listener before the final pending drain so pending
stops growing, but leave the exit listener registered until after the
reattach decision so an exit during that await is not missed.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): pause backend flow across hibernate history replay
Full-history wake no longer races the 512 KiB pending cap or the 64 KiB
preload backlog. Pause-and-wait drains into pending, stop the data
listener, take pending once, replay, reattach, then resume. Removes the
multi-pass drain that still dropped ACKed bytes under sustained output.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): harden hibernate wake against drain failure and exit tails
Check setSessionFlowPausedAndWait success. On drain failure keep the
hibernate data listener with the pending cap disabled for the wake window.
After history replay, take pending once more so exit "[session closed]"
tails and uncapped live arrivals are not discarded.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): pause reconnect hibernate wakes and recheck exit after late drain
Always pause when a backend session exists (including sessionConnected=false
reconnect wakes). Drain late pending plus an exit-tail take before deciding
reattach. Resume flow only after reattach, or on wake failure; successful
reconnect wakes stay paused until cleanupSession.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): restore hibernate listeners on failed wake
On wake failure, dispose the partial xterm runtime and reinstall hibernate
listeners (preserving pending) instead of unpausing into a listener-less
backlog gap. Successful reconnect wakes still keep the pause until
cleanupSession. Add a final pending take before exit-listener teardown.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): restore take-and-cleared pending on failed hibernate wake
Track every pending take during wake and pass it to restoreAfterFailedWake
so a thrown replay/reattach cannot permanently drop already-buffered output
with the disposed partial xterm. Also take once more before exit-listener
teardown.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(terminal): drain hibernate pending until empty before teardown
After history replay, loop take-and-append until an empty take so an exit
or residual chunk that arrives during an awaited replay cannot be dropped
by stopHibernateListeners. Data listener is already stopped, so the loop
stays short in practice.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Local terminal paste with an image-only clipboard now forwards raw Ctrl+V into the PTY so nested TUIs (e.g. Claude Code) can read the OS clipboard. Text and file-path paste, and remote sessions, are unchanged.
Fixes#2758
* fix(credentials): stop double-encrypting undecryptable safeStorage blobs
When local decrypt failed (e.g. OSCrypt key churn after reboot), encrypt
used to wrap the leftover enc:v1 ciphertext again, permanently poisoning
the vault. Startup sync could also push those placeholders to cloud and
make download restore the same poison.
- Keep real enc:v1 blobs unchanged on encrypt (header check, no wrap)
- Strip device-bound placeholders when applying portable sync payloads
- Guard startup local-wins / merge round-trips before upload
- Skip vault init re-encrypt writes when secrets are still undecrypted
Fixes#2702
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sync): strip enc:v1 secrets from smart-merge uploads
Bugbot found that after local apply sanitized placeholders, legacy v1
smart-merge could still decrypt an unstripped remote, merge it, and
re-upload the poison. Strip device-bound credentials on remote decrypt
and again on the merged payload before upload.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(credentials): address Codex P2 review on #2702
- Always re-encrypt vault init batches so plaintext siblings are not
left unprotected when one record is a stale enc:v1 placeholder
- Sanitize device-bound secrets before convergent restore prepare so
CRDT replica commit matches vault import
- Require a complete safeStorage blob (header + min 31 bytes) before
treating enc:v1 as ciphertext; encrypt header-only coincidences
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(credentials): address Codex P1 review on #2702
- Decode enc:v1 payloads with atob in the renderer-safe domain helper
- Heal poisoned remote secrets from local/base before smart-merge so
good credentials are not discarded as remote-only deletions
- Keep post-merge strip so leftover enc:v1 never uploads
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(credentials): address Codex P1 CBC min and startup heal
- Accept 19-byte v10/v11 CBC OSCrypt blobs (not only 31-byte GCM)
- Heal poisoned remote secrets before startup smart-merge
- Strip unresolved placeholders on merge round-trip upload
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sync): sanitize payloads at every apply/commit boundary
Codex P1: vault apply stripped enc:v1 while commitRemoteInspection and
convergent materialization could keep the poison. Sanitize merged/remote
payloads before apply+base commit, strip on CRDT materialization, and
sanitize convergent apply inputs.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sync): heal local and remote secrets before smart-merge
Smart-merge could select a locally-changed entity whose only secret
delta was enc:v1 poison, then strip and upload empty secrets. Heal
both sides from the opposite payload/base before merge on all sync
paths.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sync): keep enc:v1 intact during convergent materialize
Stripping device-bound secrets inside materializeSyncPayloadFromConvergentState
broke envelope validation for poisoned-but-consistent v2 snapshots, so decrypt
could not hydrate the clouds #2702 needs to recover. Portable stripping stays
at apply/upload boundaries.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(credentials): detect Windows DPAPI by decoded header bytes
Real DPAPI blobs start with 01 00 00 00 d0 8c... and base64-encode as
AQAAANCM..., so the previous AQAAAA string prefix rejected them and
allowed double-wrapping after key rotation. Match decoded headers in
both the main-process bridge and renderer predicate.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* test(credentials): use complete enc:v1 fixtures for stricter detector
Short placeholders like enc:v1:djEwAAAA no longer pass the platform
header + minimum-size checks. Update auth/SFTP/proxy/sync fixtures to
full v10-shaped blobs so npm test matches production validation.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sync): treat preferred credential deletions as authoritative
When healing enc:v1 before merge, an empty/missing secret on a present
preferred entity is an intentional clear and must not be revived from
base. Only fall back to base when preferred is absent or also poisoned.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(credentials): reject impossible v10/v11 ciphertext lengths
Accept only CBC-aligned sizes (19+16n) or GCM-sized blobs (>=31) so
coincidental enc:v1 plaintext of intermediate length is encrypted instead
of treated as an undecryptable placeholder.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(credentials): require full DPAPI provider GUID signature
Accept Windows safeStorage blobs only when they start with version
01 00 00 00 plus provider GUID df9d8cd0-1501-11d1-8c7a-00c04fc297eb,
so coincidental 01 00 00 00 prefixes are not treated as ciphertext.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(windows): restore frameless rounded corners and tray transparency (#2505)
Windows frameless windows used a solid host backgroundColor under DWM
rounding, which showed as a dark rim, while the tray popup kept the
default opaque backdrop under CSS border-radius (square tips / 冒尖).
Use a clear transparent host with native roundedCorners for app windows,
and disable OS rounding for the CSS-shaped tray overlay. Keep html/body
transparent on the tray route so corner pixels stay see-through.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(windows): require chrome helpers outside with(ctx)
createMainWindowApi injects require from windowManager.cjs, so a relative
require inside with(ctx) resolved to electron/bridges/windowsWindowChrome.cjs
and crashed every main-window create (MODULE_NOT_FOUND). Load the helpers at
module scope in each factory so paths stay file-local.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(windows): keep resizable app windows opaque
Codex P2: Electron documents transparent BrowserWindows as not resizable,
and enabling resizable can break them. App content windows now only set
roundedCorners: true with a solid theme backdrop; the tray overlay stays
transparent because it is already non-resizable.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(tray): hide opaque splash on tray overlay route
Codex P2: the shared splash screen still painted an opaque full-window
fill when the tray panel showed before React mounted, recreating the
square-corner flash. Mark tray-window early, CSS-hide the splash, and
remove the splash node on DOM ready / tray render.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(tray): defer first show until ready; keep chrome comments ASCII
Wait to show the tray BrowserWindow until did-finish-load so the shared
opaque splash cannot flash as a square underlay. Also rewrite the new
helper file header in ASCII-only English per AGENTS.md.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(tray): cancel pending first-load show on second toggle
If the user toggles the tray again while the first renderer load is still
pending, clear trayPanelShowWhenReady so did-finish-load cannot open the
panel after an intentional dismiss.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(tray): keep shared splash transparent by default
Move the opaque splash fill behind html:not(.tray-window) so the tray
overlay route never inherits a solid full-window background from the
shared splash markup.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* feat(system): add GPU/NPU monitor tab when accelerators are detected
Probe nvidia-smi and npu-smi during System capabilities checks and show a
GPU sub-tab with utilization, memory/HBM, temperature, power, and compute
processes. Reuses the existing SSH exec + parse pattern (same approach as
open-source remote GPU monitors) without new dependencies.
Related to #2561
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(system): address GPU monitor Bugbot findings
- Use PowerShell nvidia-smi collector for local Windows sessions
- Keep GPU tab in loading state while listAccelerators is pending
- Render compute processes even when device list is empty
- Stop treating Ascend HBM usage rate (%) as megabytes
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(system): address Codex GPU collector review findings
- Wrap POSIX accelerator script with JSON.stringify so nested sed
quotes cannot break outer sh -c
- Parse Ascend proc-mem whitespace-delimited table rows
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(system): show unknown GPU util/memory as -- not 0%
ResourceBar now treats null/undefined as unavailable, and the GPU
device cards pass through null metrics instead of coalescing to 0.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sync): rehydrate follow-app theme and guard partial groupConfig wipes
Second devices were keeping the local follow-app terminal theme flag after
cloud sync wrote peer appearance settings, which flickered black vs yellow.
Also block uploading an empty groupConfigs list while other vault data
remains so hydration races cannot clear startup-command group defaults.
Fixes#2757
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sync): narrow complete-wipe shrink guard to groupConfigs
Only treat empty groupConfigs with other vault data present as suspicious.
Wiping the last snippet/note/etc. while hosts remain stays a normal delete.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): remove serial createReadStream bulk download path
Align downloads with upload fail-closed (#2449/#2719): use concurrent
isolated/shared READ fanout only, wait for the per-session fast slot,
and never fall back to RTT-bound serial createReadStream. Keep hash
helpers on createReadStream for verification only.
* fix(sftp): harden download slot cancel and fail-closed tests
Address multi-agent review: make session fast-slot wait cancel idempotent
with abort restore, recheck cancel after acquire, and lock fail-closed /
slot-wait cancel with condition-based waiter-depth assertions.
Hard-coded win.target arches made pack:win-x64 also emit win-arm64 and
a universal NSIS package that can leave Netcatty.exe missing on ARM
Windows (#2570). Let CLI --x64/--arm64 control packaging instead.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): keep cancel shared write OPEN drain gated on callback
Cancel settle must not force-complete sharedWriteOpenDrain — only channel
error does — so stage cleanup cannot race a late truncating OPEN after #2720.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): bound cancel OPEN drain and unlink late truncates
Restore cancel drain force-complete so stalled shared OPENs cannot hang
the lease, and best-effort unlink late truncating "w" opens after close so
force-complete cannot leave a recreated stage orphan.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): only unlink generated stages on cancel OPEN
Gate cancel-time truncating OPEN unlink on generatedStagePath so in-place
and symlink destinations keep their final path; cover with a late-OPEN test.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): unlink late staged OPEN after channel-error settle
Late truncating generated-stage OPENs after settle must unlink even when
transfer.cancelled is false, so channel-error force-complete cannot leave
a recreated .netcatty-upload orphan.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): skip late OPEN unlink when same-id retry owns stage
After shared write OPEN drain force-complete, a late truncating "w"
callback still closed and unlinked generated stages. Resumable retries
reuse `.netcatty-<transferId>.part`, so a stale callback could delete
the new attempt's stage. Gate unlink on activeTransfers ownership
(generated stages + truncating only), matching the in-place final
target guard.
* fix(sftp): only skip late OPEN unlink for reusable resume stages
Same-id retry ownership must not suppress unlink for every generated
stage path. Non-resumable uploads use unique .netcatty-upload-* paths;
a stale late OPEN on those must still clean orphans. Only deterministic
.netcatty-<transferId>.part resume stages are protected.
* fix(sftp): gate late OPEN unlink skip on actual staged path
Only suppress late generated-stage unlink when the same-id retry's
active.stagedRemote.path matches. Do not treat resumable+targetPath or
path shape alone as ownership for in-place retries.
* fix(sftp): compare late OPEN stage paths in the same representation
OPEN filePath may be a session-encoded Buffer while stagedRemote.path is the
logical string, so strict equality failed and could unlink a same-id retry
stage. Normalize via encodePathForSession / Buffer equals before ownership skip.
* fix(sftp): gate truncating shared OPEN against same-path retries
Serialize truncating shared-write OPENs per remote path so a same-id
retry cannot issue OPEN "w" while a prior attempt is still unsettled.
When a drain force-complete already released the gate and a late stale
OPEN re-truncates a retry-owned resume stage, invalidate that retry
instead of allowing a sparse promote. Keep late-OPEN unlink skip for
retry-owned stages.
* fix(sftp): bound best-effort unlink so cancel cannot hang
Shared/sudo cancel after OPEN "w" waited on unlink before finishCancel.
A dead channel that never invokes the unlink callback left the transfer
and its session lease active indefinitely. Cap unlink at the same 2s
grace used for shared-write drain force-complete.
* fix(sftp): make truncating shared OPEN path-gate waits cancelable
A same-path upload queued behind a prior truncating OPEN could keep its
lease/admission slot forever if cancelled before runOpen. Race the gate
wait with transfer.abort and release the gate + drain on cancel.
* fix(sftp): scope truncating OPEN path gates per SFTP session
A module-global path-only key serialized unrelated hosts that shared the
same remote pathname. Include transfer/sftp session identity in the gate
key so only same-endpoint opens wait on each other.
* fix(sftp): refuse stage promote after stale OPEN truncation
A late force-completed OPEN w from a prior same-id attempt can zero the
deterministic stage after concurrent write finishes. Latch
staleOpenTruncatedStage through assertCanPromote and uploadFileConcurrent
so promotion cannot rename a corrupt stage.
* fix(sftp): keep path gate chained when canceling a queued OPEN wait
Releasing a cancelled waiter's gate immediately cleared the barrier while
the prior truncating OPEN was still in flight. Chain the waiter's release
to waitForPrior so later same-path attempts stay serialized.
* fix(sftp): hold reusable-stage path gate past OPEN force-complete
Force-completing drain no longer frees the path gate for generated stages
immediately. Same-id retries stay serialized until the late OPEN settles
(or a 10s hard cap) so promotion cannot race a still-processing OPEN w.
* test(sftp): wait for generated-stage path gate hold on retry OPEN
After force-complete, generated stages keep the path gate for 10s more.
Align the late-OPEN retry test wait with that hold.
* fix(sftp): hold truncating OPEN path gates for in-place targets too
In-place shared OPEN force-complete no longer frees the path gate
immediately, and late OPEN invalidation applies to final-path retries so
a stale truncating OPEN cannot wipe an in-flight same-id rewrite.
* fix(sftp): keep path gate held until OPEN settles (no hard cap)
Remove the post-force-complete gate timeout so a different transferId
cannot reopen the same target while a stale truncating OPEN is pending.
* test(sftp): accept normal {transferId,totalBytes} retry success
startTransferNow returns transferId/totalBytes on success, not success:true.
* fix(sftp): reject path-gate waits when the SFTP channel errors
Queued same-path OPEN waiters now observe channel error while waiting on
the prior gate, so a dead session cannot pin lease/admission forever.
* fix(sftp): treat superseded OPEN as cancelled, not failed
Late OPEN rejections after a same-id retry must not broadcast a terminal
failed event that marks the live retry task failed in transfer center.
* fix(sftp): emit cancelled channel for superseded OPEN failures
Worker fan-out only maps transfer:error as cancelled for cancel messages.
Superseded attempts now use transfer:cancelled so retries are not failed.
* fix(sftp): silence superseded OPEN terminal events for live retries
When a same-id retry already owns activeTransfers, do not emit cancelled
or failed for the stale superseded attempt or the transfer center sticks.
* fix(sftp): release path gate on OPEN force-complete for dead channels
When the OPEN callback never arrives, free same-path waiters after drain
force-complete so later uploads do not hang forever on the gate.
* fix(sftp): hold path gate until OPEN settles; 30s dead-channel grace
Force-complete no longer frees the gate immediately. Late OPEN release
keeps retries serialized; a 30s grace frees dead channels.
* fix(sftp): never force-release path gate on OPEN drain force-complete
A dead-channel force-complete must free the transfer/lease, but keep the
path gate held until the OPEN callback actually settles. Force-releasing
lets a same-path retry write then get wiped by a late truncating OPEN.
* fix(sftp): skip upload fallback when OPEN is superseded by a retry
A same-id retry can already own the transfer while the old OPEN callback
still rejects. Mark that rejection noTransferFallback so we never truncate
the shared stage via prepareUploadFallbackCheckpoint under the retry.
* fix(sftp): bound late OPEN close before releasing path gate
After drain force-complete, a late truncating OPEN must still close the
handle before releasing the path gate — but a dead channel may never
invoke CLOSE. Race close with a 2s timeout so same-path uploads cannot
wait forever on pathGate.waitForPrior.
* chore: re-trigger Codex review automation
* fix(sftp): always suppress terminal events for superseded OPEN attempts
Superseded means this attempt lost ownership. Do not require the retry to
still own activeTransfers — if the retry already completed, emitting
cancelled for the same transferId rewrites a completed transfer.
* chore: re-trigger Codex for path-gate head
* chore: nudge Codex automation after cancelled run
* fix(sftp): keep SFTP leases when suppressing superseded attempts
Superseded OPEN cleanup must not release transferId leases — a same-id
retry shares that lease set entry and would lose its hold if we release.
* fix(sftp): do not return result.error for superseded transfer attempts
Renderer directory ops treat any startStreamTransfer error as failure.
Superseded same-id OPEN attempts should return a non-error marker so the
live retry is not marked failed.
* fix(sftp): bound CLOSE on pre-settle cancel OPEN path
Reuse the 2s close timeout for cancel-before-settle so a dead channel
cannot leave the path gate held after finishCancel never runs.
* fix(sftp): hold path gate until unlink callback settles
Remove the 2s force-complete on late shared OPEN unlink so a delayed
server unlink cannot race a same-id retry that already reopened the stage.
* fix(sftp): path-gate r+ resume OPENs; release only unused superseded leases
Serialize all shared write opens including resume r+. On superseded, release
only SFTP leases not also held by the live same-id retry.
* fix(sftp): serialize shared and isolated OPENs by host+path
Path gates keyed only by SFTP object let an isolated-channel retry race a
stale shared truncating OPEN on the same host path. Prefer targetHostId so
both channels wait on the same gate.
* fix(sftp): path-gate isolated writes; revalidate checkpoint after gate
Gate all write OPENs including isolated channels so a shared stale OPEN "w"
cannot race. After waiting on the path gate, re-stat the stage and shrink
the resume checkpoint (and flags) before issuing r+/w.
* fix(sftp): dynamic truncating flags; cross-id stale OPEN; bound unlink
Resolve r+/w at OPEN/unlink time so afterPathGate flag getters still unlink
generated stages on cancel. Invalidate any same-path active transfer (not only
same-id) when a late truncating OPEN lands, and force checkpoint restart when
the stage was wiped before OPEN accepted. Bound best-effort unlink so a dead
channel cannot hang cancel settle.
* fix(sftp): clear staleOpenTruncatedStage after gated full restart
When a late truncating OPEN zeros the stage while a retry waits on the path
gate, afterPathGate restarts from offset zero. Consume the stale flag there so
a successful full rewrite is not failed by the post-upload guard.
* fix(sftp): keep cancel active during post-gate checkpoint revalidation
After the path gate opens, afterPathGate may stat a remote stage. Keep the
transfer abort hook and channel-error listener live for that await so cancel
or a dead channel can still release the path gate and lease.
* fix(sftp): hold path gate for isolated write OPENs until settle
Isolated truncating OPENs previously released the host/path gate on cancel
as soon as sftp.end() was called, allowing a same-path retry to race a still
in-flight OPEN that can truncate the stage without invalidation. Keep the gate
until the OPEN callback (or a bounded force-release after end), and run late
OPEN invalidation for isolated channels too.
* fix(sftp): close late shared read OPEN handles after settle
Restores close of late shared/sudo OPEN "r" handles after cancel or channel
error settle. Write-only gate invalidation remains for isolated late OPENs.
* fix(sftp): copy host IDs onto transfer for path-gate keys
dedicatedTransferResume passes targetHostId with a new targetSftpId. Keep
those host IDs on the transfer object so sharedWriteOpenSessionKey stays
host-scoped across session replacement instead of falling back to sftpId.
* fix(sftp): do not complete directory children on superseded invoke
When a same-id retry steals ownership mid-OPEN, the old startStreamTransfer
returns { superseded: true }. Wait for the live owner's terminal task status
instead of treating that result as a successful child completion.
* fix(sftp): pass host IDs on background restart; scope stale-OPEN invalidation
Background agent resume now includes source/target host IDs so path gates stay
host-scoped after openSftpForSession. Stale OPEN invalidation requires a
matching host or sftp session instead of treating missing host as a wildcard.
* fix(sftp): do not unlink stage after same-transfer fastPut fallback
When concurrent isolated OPEN dies without a callback and upload falls back
to fastPut on the same generated stage, a late OPEN must not unlink that
stage. Skip unlink when the same transfer already accepted an OPEN, owns
stagedRemote, or moved to a fastPut/stream strategy.
* fix(sftp): narrow fastPut unlink skip; handle superseded in all callers
Only suppress late-stage unlink when the same transfer moved to
fastPut/stream — ordinary cancel still unlinks. Background restart and
dedicated resume wait for the live same-id owner instead of treating
superseded invokes as completed.
* fix(sftp): never force-release isolated write path gates
Hold host/path gates for isolated truncating OPENs until the OPEN callback
settles, matching shared-channel behavior. Force-releasing after sftp.end()
allowed a late OPEN to wipe a completed same-path destination with no live
transfer left to invalidate.
* fix(sftp): hold path gate until late unlink settles
Transfer cancel can settle after a 2s unlink grace so dead channels do not
hang invokes, but the host/path gate stays held until the unlink callback
actually fires so a delayed unlink cannot delete a same-path retry stage.
* fix(sftp): wait for live owner without fixed superseded deadline
Superseded invokes now wait only on the live same-id transfer's terminal
status (or cancel). A 30-minute timeout could mark a still-running long
transfer failed and stick that status after the owner later completed.
* fix(sftp): classify superseded before cancelled cleanup
When a cancelled attempt loses ownership to a same-id retry mid-OPEN, the
error is Transfer superseded while cancelled is still true. Handle supersede
first so cancel cleanup cannot delete the retry stage, free its leases, or
emit a terminal cancelled event for the live owner.
* fix(sftp): wait for pending write OPEN before fastPut fallback
Expose pendingWriteOpenPathGate on the transfer so non-resumable concurrent
isolated failures wait for their own truncating OPEN to settle before
fastPut rewrites the same stage.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(settings): 支持一键清空所有会话日志
在系统设置的会话日志卡片中新增清空按钮,删除保存目录下的
所有日志文件及主机子目录;操作前弹窗二次确认,完成后展示
删除/失败数量。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(session-logs): restrict clear-all to known log artifacts
Clearing the session logs directory no longer recursively deletes every
top-level entry. Only files matching Netcatty auto-save / export naming
patterns and host folders that exclusively contain those artifacts are
removed, so a shared Documents/Downloads save path cannot wipe unrelated
user files (Codex P1 on #2738).
* fix(session-logs): skip active auto-save streams during clear-all
Clear-all must not rm host dirs or log files still open by
sessionLogStreamManager write streams (orphan inode / silent stop).
Expose getActiveLogPaths and preserve those targets while still
deleting inactive siblings and pure host folders.
* fix(session-logs): preserve active snapshot-only host dirs on clear-all
txt/html streams may not create a file until the first snapshot, so treat
any active log path whose parent is the host directory as live work before
removing pure session-log folders.
* fix(session-logs): preserve worker-owned active streams on clear-all
Clear-all only queried the main-process sessionLogStreamManager, so
worker-owned auto-save files were invisible and could be deleted while
live. Union active paths from a running terminal worker via
netcatty:sessionLogs:getActivePaths, and skip cold-starting a stopped
worker.
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(#2697): automated Cursor CLI fix
* fix: address Codex review on PR #2734
* fix(ai): keep MCP absolute approval deadline and Escape reject
Canceling idle review no longer leaves MCP approvals unbounded past the
external agent tool-call window, and Enter-only key stopPropagation lets
Escape still reject from Copy/Expand controls.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ai): keep wrapped CLI target context on approval cards
Parse --session from netcatty-tool-cli wrappers into execution context and
still show invocation args when the pending card displays an unwrapped command.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ai): surface Codex reason on pending approval cards
Keep agent justification visible in the execution-context strip and still
show extra invocation args such as commandActions beside the command block.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ai): bound Catty approval cancel with absolute deadline
Keep Catty confirm-mode approvals from going unbounded after review:
cancelApprovalTimeout re-arms the creation absolute deadline (MCP-style)
so a late approve cannot outlive the original timeout/stream tool budget.
Also harden pending-card Enter: extract isNestedInteractiveApprovalTarget
so Copy/Expand (and other nested controls) never Approve Once via bubble.
* fix(ai): bound Codex approval cancel and unwrap CLI wrappers
cancelInteractionTimeout now re-arms the absolute creation deadline
(Catty/MCP style) instead of leaving review unbounded. Also treat
netcatty-tool-cli.cjs/.cmd as CLI wrappers so approval Command/Copy
shows the remote command after --.
* fix: address Codex review on PR #2734
* fix(ai): separate Catty approval idle timer from hard deadline
Review activity re-arms a full idle window from now instead of the original
absolute remainder, capped by a hard deadline (3x idle, max 30m). Stream
tool budgets use the hard deadline so mid-review approvals are not cut off.
* fix(ai): re-arm Catty approval idle and sync-deny hard deadline
Review interactions kept a one-shot timeoutCancelledRef, so later
cancelApprovalTimeout calls no longer re-armed idle. Remove the one-shot
and deny synchronously when the hard deadline has already elapsed so a
late approve cannot race setTimeout(0).
* fix(ai): re-arm approval idle on args-only scroll review
Pending approvals without a display command (Codex file-change/permissions,
write tools with JSON args) only show the overflow args block. Wire the same
onScroll/onWheel markReviewing path used by the command pre so continuous
wheel/trackpad review re-arms Catty and MCP/Codex idle timers.
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(#2745): automated Cursor CLI fix
* fix(sftp): reset IME composing guard when filter bar closes
If the filter input unmounts mid-composition (filter bar toggled closed),
compositionend never fires, leaving filterComposingRef stuck at true and
blocking every later onSetFilter commit. Clear the guard when the bar hides.
Also drop the now-unused startTransition prop from the toolbar (its only
use was the removed deferred filter path).
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): resync filter draft to committed filter when bar closes
Resetting only the composing guard left filterDraft diverged from pane.filter
when the bar closed mid-composition, so reopening showed stale uncommitted text.
Resync the draft to pane.filter on close.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): clear IME composing guard in commitFilterValue
Centralize the guard reset so every commit/clear path (composition end,
Escape, inline clear button, close button) finalizes the IME session. The
inline clear previously left filterComposingRef stuck true, blocking later
onChange commits and letting a delayed compositionend undo the clear.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): honor external filter change over stale draft on composition end
If navigation (e.g. follow-terminal-CWD) clears pane.filter mid-composition,
onCompositionEnd previously re-committed the stale composed draft, overwriting
the navigation-clear invariant. Capture pane.filter at composition start and
adopt any external change on end instead of committing the stale draft.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(sftp): supersede IME composition when navigation clears filter
Navigation can clear pane.filter mid-CJK composition. Adopt that external
clear into the draft while composing, arm a supersede latch so the common
post-compositionend onChange cannot re-commit the stale draft, and reset
composing/supersede state when the filter bar unmounts or a commit path runs.
* fix(sftp): supersede IME filter draft when path navigates
When the committed filter was already empty before composition,
directory navigation sets filter to "" again so pane.filter does not
change. Track path at composition start and supersede the draft when
the path changes so compositionend cannot re-commit stale IME text.
* fix: address Codex review on PR #2746
* fix(sftp): clear IME supersede latch if no post-change arrives
After compositionend arms the supersede latch, schedule a macrotask
fallback clear so ordinary keystrokes work when the browser never
fires the post-composition onChange that would clear it.
* fix: use ASCII punctuation in PR comments and tests
Replace em dashes with ASCII hyphens in comments/tests. Keep the guarded
setTimeout supersede-latch clear from the prior IME fix.
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(plugins): backfill sync provider bindings after schema upgrade
Promote legacy sync-provider-map secrets into the host binding table on
open, and infer plugin ownership from sync-credential rows so disconnect
still cleans credentials when bindings were never written.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(plugins): infer sync provider owners only via pluginId. namespace
Exact pluginId===providerId is not ownership for contribution provider
ids; prefer the longest pluginId. prefix when backfilling disconnect cleanup.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(plugins): stop inferring sync owner from credential prefixes
Parent plugin ids can namespace-prefix another plugin's provider id.
Guessing ownership from sync-credential rows would let disconnect wipe
the wrong secrets. Keep host bindings and legacy map backfill as the
only ownership sources when no live contribution is present.
* fix(plugins): do not overwrite existing sync provider bindings on backfill
Legacy sync-provider-map rows from a parent plugin must not steal a
provider that already has a host binding. Skip upsert when a binding
exists; still delete the stale map secret.
* fix(plugins): pick longest owner when legacy map rows conflict
Group sync-provider-map rows by provider before binding so a shorter
parent plugin cannot win just because SQLite returned it first. Still
preserve existing host bindings and delete all leftover map secrets.
* fix(plugins): never delete secrets during sync-provider-map backfill
The map key prefix is not reserved for host internals; plugins may store
ordinary secrets under the same shape. Only seed missing host bindings
from candidate rows and leave plugin_secrets untouched.
* fix(plugins): seed sync bindings from live provider metadata
Schema-2 installs only stored sync-credential* rows. After upgrade, seed
missing provider bindings from the host contribution catalog when those
credentials exist, instead of guessing from secret key prefixes.
* fix(plugins): seed sync bindings from installed manifests, not only enabled
listProviders skips disabled/quarantined plugins. Walk installed plugin
manifests at host init so schema-2 credential rows under disabled plugins
still get provider bindings for disconnect cleanup.
* fix(plugins): seed sync bindings from all installed version manifests
Active-only listPlugins() misses providers removed/renamed on upgrade
while credentials remain under the plugin. Walk every plugin_versions
manifest so disconnect can still resolve ownership after schema upgrade.
* fix(plugins): only auto-bind single-provider plugins from credentials
Plugin-scoped sync-credential* rows are shared across providers. Binding
every historical provider would let disconnect of a stale one wipe the
active provider's secrets. Seed bindings only when exactly one sync
provider is known for that plugin.
* fix: address Codex review on PR #2752
* fix(plugins): stop resurrecting sync bindings after unbind
Consume promoted sync-provider-map markers and leave an unbound
tombstone on disconnect so constructor backfill cannot re-bind a
provider the user already disconnected.
* fix(plugins): prefer credential-backed owners for legacy map backfill
Longest sync-provider-map namespace alone could bind a nested plugin over a
parent that still owns sync-credential* secrets. Only promote candidates with
credentials; pick the longest among those, and skip when none or ambiguous.
* fix(plugins): skip ambiguous multi-credential legacy map backfill
Only auto-bind when exactly one credential-backed map candidate exists.
When parent and nested plugins both hold credentials for the same provider,
longest pluginId is not a reliable owner signal — leave unbound.
* fix(plugins): skip cross-plugin provider conflicts in live backfill
When multiple credential-backed plugins declare the same providerId via
nested namespaces, do not bind the first writer. A later missing-provider
disconnect would otherwise delete the wrong sync-credential rows.
* fix(plugins): use full installed catalog for enable-time sync backfill
Enable-time binding must see the same active+inactive manifest catalog as
startup so cross-plugin nested provider ambiguity is not missed when only
the newly enabled plugin's live providers would be passed.
* fix(plugins): count non-credential manifest claims in backfill conflicts
Live nested plugins without credentials yet must still block binding a
credential-backed legacy parent to the same providerId, or disconnect can
prefer the live owner while the stale binding remains.
* fix(plugins): skip legacy map promote on installed-manifest conflicts
Constructor-time map backfill must not bind a sole credential-backed
parent when another installed package also declares the same sync
provider, or later disconnect cannot clear the stale binding.
* fix(plugins): require single-provider maps for legacy-map promotion
A plugin with one sync-credential row and maps for multiple historical
providers must not bind all of them — disconnecting a stale provider
would delete the live credentials via the shared prefix.
* fix(plugins): count installed manifest providers in legacy-map guard
A sole stale map row must not promote when the credential owner's live
manifest also declares another sync provider under the same credentials.
* fix(plugins): backfill sync bindings before startup activation
Seed installed-manifest bindings before contributionService.initialize so
an early syncDeleteSecrets cannot miss ownership and leave orphan credentials.
* fix(plugins): seed sync bindings at host construction
Run installed-manifest backfill when the plugin host is created, before
async manager.initialize, so early syncDeleteSecrets can resolve ownership.
* fix(plugins): re-seed sync bindings after package store recovery
PackageStore.recover can add installed versions after the constructor
seed; re-run the catalog backfill when package initialize finishes.
* fix(plugins): await manager init before syncDeleteSecrets ownership
Block secret cleanup until package recovery and binding seed finish so
early disconnect cannot miss retained sync-credential rows.
* fix(plugins): re-run legacy-map backfill after package recovery
After PackageStore.recover repopulates versions, re-run legacy-map promote
so recovered manifests participate in ownership conflict checks.
* fix(plugins): defer legacy-map backfill until after package recovery
Constructor no longer promotes sole map candidates before recovered
manifests are visible. hostService re-runs backfill after package init.
* fix(plugins): defer live binding seed until after package recovery
Construction-time live-provider backfill can bind a stale owner against an
incomplete catalog before PackageStore.recover() restores plugin_versions.
Seed only after recovery; syncDeleteSecrets already awaits manager init.
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Put requestDisable/requestReset on the settings mutation queue so concurrent
timeout changes cannot re-enable App Lock after a successful disable. Capture
the runtime lock version before system auth and reject the prompt if the lock
epoch advanced (idle→background re-lock) while the dialog was open.
Password-change saves go through the settings mutation queue. System unlock
re-checks locked state after the OS prompt so a re-lock during the dialog
cannot unlock from a stale auth success.
Queue app-lock save mutations and use unique temp paths so concurrent
writes cannot ENOENT or clobber. Update the system-unlock toggle test to
match the already-enabled-while-unavailable disable path.
Write app-lock settings via temp file + rename to avoid truncating the
verifier on crash. Gate application-menu Close and window:close IPC while
locked so popups are not destroyed behind the overlay.
isVisible is false for minimized BrowserWindows, which made Dock reopen
re-lock while a minimized main/session window was still open. Treat
isMinimized() as a live session, while still ignoring hidden prewarm
windows.
Keep forceRenderChildren so popup config IPC still registers while locked,
but do not mark the popup ready (or mount Terminal/startup commands) until
allowTerminalStart is true after unlock.
The overlay helper import was accidentally inserted inside open named
import lists, which broke TypeScript parsing. Move it to a top-level
import statement in SnippetsManager and SFTP keyboard shortcuts.
Optimistic unlock used current.version+1, which can outrank a concurrent
main-process re-lock and make refreshRuntimeState ignore the authoritative
locked state. Keep the observed version so real main updates always win.
Raise the lock screen to max z-index and hide the context-menu portal while
locked. Centralize isAppLockOverlayActive and gate ChatInput slash picker,
SFTP shortcuts, theme modal, and shortkey/hotkey recorders so earlier
window-capture listeners cannot steal unlock keystrokes.
Settings prewarm stays as a hidden BrowserWindow and was blocking
ensureAppLockForFreshSession after the main window closed. Only visible
windows count as a live session for that emptiness check.
Earlier-registered capture handlers (shortkey/hotkey recorders, snippet
save) run before the overlay's stopImmediatePropagation. Skip those
handlers when [data-app-lock-overlay] is present so password keystrokes
cannot mutate settings behind the lock screen.
Fresh-session re-lock now considers settings/tray/popup windows via
getAppLockReopenWindows so an open Settings UI is not interrupted.
System unlock toggle stays clickable when already enabled even if the
authenticator is currently unavailable, so users can turn it off.
While locked, use window capture with stopImmediatePropagation so
shortkey/hotkey recorders never see lock-screen keys, and stop
document bubble so window-level shortcuts (e.g. Snippets save) cannot
run even when focus is on body.
inert does not block keydown bubbling to window listeners. While locked,
stop propagation for keys targeted at the overlay so panel shortcuts
(e.g. Snippets Ctrl/Cmd+S) cannot act behind the lock screen.
Mounted shortcut hooks (e.g. SFTP) suppress when a dialog has
data-state=open. Without that marker, keyboard actions could still run
behind the app lock overlay when focus is not on the password field.
System Manager terminal popups receive config immediately after loadURL.
AppLockGate used to withhold children until async lock state resolved,
so onTerminalPopupConfig could miss the one-shot IPC. Force-render the
popup route and keep the last preload config for late remounts.
Detached #/session-window windows register with registerAsMainWindow:false
and were omitted from app-lock runtime/settings broadcasts, so they stayed
interactive after a lock. Include getAppContentWindows() (deduped) in the
broadcast fan-out and cover session windows in the harness.
On darwin, closing every window leaves the process alive while app-lock
runtime stays unlocked. Re-apply startup lock when the last window closes
and before creating a fresh main window with no app-content windows.
Mark mounted app children inert/aria-hidden/pointer-events-none while locked,
trap Tab inside the lock dialog, and suppress global hotkeys. Queue tray
port-forward toggles in main (and renderer) until the runtime unlocks.
Dirty-quit focus restore already verified.
* fix(ci): dedupe same-head @codex review requests
Plain maintainer/Cursor-bot @codex review comments did not plant the
cursor-external-codex marker, so own_rerequest on synchronize posted a
second request for the same SHA. That concurrent pair produced a clean
issue comment from one job and a findings review from the other.
Skip re-request when any trusted or Cursor-bot author already requested
this head via external marker, cursor-codex-head pin, or a recent plain
@codex review.
* fix(ci): only dedupe plain @codex against the current head push
Plain unpinned requests no longer skip solely by age — that blocked
re-request after a new synchronize when an older plain @codex still
looked "recent". Callers pass the head commit time as notBefore so
only post-push plain requests suppress a duplicate.
* fix(ci): use PR head-change time for plain @codex dedupe
Commit author/committer dates predate cherry-picks and rebases, so a
plain @codex for the previous head could suppress re-request after a
new synchronize. Pass pull_request.updated_at (moves with the push)
as notBefore instead.
* fix(ci): dedupe @codex only via head-pinned markers
Drop plain-unpinned timestamp heuristics — they cannot safely know which
SHA a bare @codex review targeted. Skip re-request when a trusted author
already pinned this head with cursor-codex-head or cursor-external-codex.
When quit is cancelled because a renderer reports unsaved editors,
show and focus those windows first. A tray-hidden or unfocused main
window otherwise only posts a toast the user never sees, so quit
appears to fail silently.
Defer first App mount (and rendererReady) for any lock reason so
background/idle locks cannot deliver ssh:// connects behind the overlay.
Wait indefinitely for renderer readiness and re-queue failed deliveries so
startup unlock after the old 15s timeout no longer drops deep links. Queue
renderer-side deep links while already-mounted sessions re-lock.
* fix(ci): let maintainer @bot reclassify auto-closed issues
Author reopen disputes still stay on issue_followup when
triage:already-available/unclear remain, but an explicit maintainer
@netcatty-bot mention must re-enter issue_classify so re-triage can
run without an open bot PR.
* fix(ci): prefer maintainer @bot over author follow-up routing
When a trusted maintainer is also the issue author, route explicit
@netcatty-bot mentions as maintainer re-triage so auto-closed
already-available/unclear issues can re-enter classify.
* fix(ci): stop reopen from replaying issue triage
Already-admitted issue reopen events were routed back into full classify,
so follow-up handoffs and maintainer reopens could close again or overwrite
ready-for-human with needs-info. Skip bot reopen, hand auto-closed human
reopens to maintainers, and keep already-available disputes on follow-up.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): keep ready-for-human follow-ups off classify
After reopen handoff drops triage:already-available, actionable author
replies could still be refined into classify and auto-close again. Treat
ready-for-human like the dispute signal and keep those comments on
follow-up.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): preserve already-available dispute label on handoff
Keep triage:already-available when handing reopened auto-closed issues
to humans, and only use that label (not ready-for-human) to block
reclassify. This stops the close loop without blocking feature_defer or
other ready-for-human follow-ups from re-entering classify.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): keep unclear reopen disputes off classify
Match the already-available dispute guard for triage:unclear / unclear so
human reopen handoffs of auto-closed unclear issues cannot re-enter
classify and close again on the next author follow-up.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): revalidate auto-close labels before handoff
Queued ready_for_human_handoff must not overwrite a maintainer who already
cleared triage:already-available/unclear and moved the issue (for example
to ready-for-agent). Skip the handoff when those outcome labels are gone.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* test(ci): cover skipped reopen handoff without auto-close labels
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): do not reopen issues already closed before handoff
Queued ready_for_human_handoff must respect a maintainer who re-closed the
issue while the job was waiting. Skip when live state is closed instead of
forcing ensureOpen.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): reclassify non-auto-close issue reopens
After a merged automation fix, cleanup leaves triage:bug-ready/admitted on
the source issue. Human reopen of those labels must re-enter classify so a
failed fix can spawn another implementation; only bot reopen stays skipped.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(plugins): address residual Codex sync secret and backup gaps
Retain provider→plugin secret bindings so disconnect can wipe credentials
after a plugin is disabled, keep overwritten secrets on failed reconnect,
and snapshot live-empty sidecars in protective backups.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(plugins): restore overwritten sync secrets on rejected reconnect
Stash prior plaintext and SecretRef id on overwrite, restore them when
connect fails, and discard the stash after a successful reconnect so
saved provider credentials keep resolving.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(plugins): make sync secret overwrite stash opt-in
Only the syncPutSecret path stashes prior plaintext/SecretRef so ordinary
secrets.set overwrites do not leave credentials in process memory.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(plugins): host-own sync provider bindings and clear failed stashes
Move provider→plugin bindings into a dedicated DB table outside
plugin-writable secrets, validate provider namespace ownership, and drop
overwrite stashes when replacement writes fail.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(plugins): keep overwrite stash until restore write succeeds
Only drop the prior plaintext after encrypt+upsert succeeds so a failed
restore can still retry and recover the saved SecretRef.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(plugins): preserve overwrite stash across retries and prefix deletes
Do not replace an existing restore stash on later puts, and clear matching
stash entries when deleteByKeyPrefix wipes sync credentials on disconnect.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
macOS copy defaults to Cmd+C. With no terminal selection, the shortcut
handler used to consume the chord as an empty clipboard write, so nested
TUIs that expect Kitty Super+C (e.g. Herdr) never received the key.
Pass plain Meta+C through the same no-selection path as Ctrl+C, while
keeping other unbound copy chords as a safe no-op (#1461).
Closes#2728
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(#2719): automated Cursor CLI fix
* fix: address Codex review on PR #2720
* fix(sftp): settle shared OPEN cancel without ending sudo session
Codex P2 on PR #2720: disposeChannel:false made pre-OPEN abort a no-op
while openSftpHandle had no cancel reject, so cancel during a stalled
OPEN hung forever and held the SFTP lease. openSftpHandleForTransfer
rejects the pending OPEN on cancel without sftp.end() on shared channels,
closes late handles best-effort, and keeps isolated-channel end behavior.
* fix(sftp): force-settle cancelled shared download READs
Codex P2 on d855e69c: shared/sudo downloads passed forceSettleOnError
false, so cancel while an sftp.read callback never arrived hung forever
(abortChannel cannot end the shared session). Downloads have no remote
WRITEs to drain, so always force-settle on cancel/error without calling
sftp.end(). Shared uploads still wait for in-flight WRITEs.
* fix(sftp): harden sudo shared download settle and fanout gates
Address Codex P2 (channel error during stalled OPEN never settled) and
multi-agent review: keep concurrent-shared READ sudo-only with a
per-session fast slot, settle OPEN sync throws without leaking listeners,
force-settle cancel without awaiting shared CLOSE, and report stream
strategy after fallback.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): dispose isolated channel on CLOSE timeout
Codex P2: success-path CLOSE timeout with disposeChannel:true was
non-fatal and returned the channel to the pool. Shared/sudo stays
non-fatal; isolated downloads now surface completedWithUnhealthyChannel
so the channel is ended instead of reused.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): drain shared write OPEN before cancel cleanup
Codex P2: cancelling a pending shared upload OPEN settled immediately,
so stage cleanup could run before a late truncating OPEN recreated the
remote path. Shared write opens now wait for the OPEN callback (or a
drain timeout), close the handle, then settle.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): keep shared write OPEN drain past cancel timeout
Codex P2: the 2s cancel settle unblocked UX but cleanup could still race
a later truncating OPEN. Publish sharedWriteOpenDrain until the OPEN
callback finishes (including late opens), and await it in upload finally
before returning to stage cleanup.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): await shared write OPEN drain without timeout
Codex P2: the 10s drain cap still let cleanup race a slower late OPEN.
Await sharedWriteOpenDrain unbounded so stage cleanup cannot run until
the write OPEN callback has closed its handle.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): keep shared write OPEN drain pending on channel error
Codex P2: channel error completed sharedWriteOpenDrain before the OPEN
callback, allowing cleanup/fallback to race a late truncating OPEN.
Match the cancel path — settle the wait, but release the drain only after
the OPEN callback closes any late handle.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): force-settle stalled shared verification READs on cancel
After concurrent download ranges finish, sample verification still awaited
bare sftp.read outside forceSettleOnError. Shared/sudo cancel cannot end
the session, so a hung verification callback held the transfer and lease.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): recheck cancel after verification sample race
A responsive last-sample READ can finish after cancel before the 2s
force-settle fires; without a post-race cancelled check the download
was reported complete.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): retain verification channel errors across sample gaps
A shared-channel error between verification sample races was dropped
when rejectPending was null, so the next read could hang forever.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): bound shared write OPEN drain after channel error
Channel error kept sharedWriteOpenDrain pending for a late OPEN, but a
dead channel that never invokes the callback hung the transfer and lease.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ci): stop green Codex fixes failing baseline name matching
Accept exit-0 candidates when quantitative coverage does not shrink,
even if individual TAP success titles were renamed. Keep rejecting
true coverage loss, upload baseline test logs, and surface comparison
details on rejected verification runs.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): require baseline failures to be fixed by name
Address Codex P1: a red→green candidate must keep each failing test
title as a success, so deleting the failing test and adding an unrelated
passer cannot pass the quantitative clean gate.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): keep comparator comments ASCII-only
Replace the non-ASCII arrow in the red-to-green comment so the file
stays consistent with the repo ASCII convention.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(ci): fail closed on incomplete baseline TAP summaries
Require a complete exact-base summary before accepting a quantitative
clean candidate, so a truncated red baseline cannot be bypassed by
deleting crashing coverage.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* test(ci): clarify incomplete-baseline fail-closed coverage
Keep the comparator fail-closed on truncated exact-base TAP summaries
and re-request Codex review on the current head.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
* fix(#2737): automated Cursor CLI fix
* fix: address Codex review on PR #2739
* fix(vault): harden destination re-dedupe passphrase and counts
Keep collapsed destination imports aligned with CSV merge policy for key
passphrases, and correct plugin importer added/duplicate counters when
hosts collapse into one group.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): preserve SecureCRT and plugin hosts under destination group
Skip endpoint collapse for SecureCRT imports, and keep plugin hosts that
differ by configuration when an import destination rewrites their group.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): skip plugin imports that collide after destination rewrite
After rewriting imported hosts into the destination group, drop ones that
now share a fingerprint with existing vault hosts.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): keep group case in host merge keys
Vault group paths are compared exactly, so Prod and prod must remain
distinct session identities during import/create dedupe.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): prune orphan credentials after destination collisions
When a destination rewrite drops colliding imported hosts, also remove
identities/keys that were only referenced by those skipped hosts.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): only prune newly imported credentials on collision
Pass existing identity/key counts into destination handling so remapped
duplicates of vault credentials are never deleted when a host is skipped.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): merge credential refs when collapsing destination hosts
Carry identityId/telnetIdentityId/identityFileId onto the retained host
so destination-group collapse does not drop referenced auth.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(vault): only graft credential refs onto bare collapsed hosts
Avoid copying identityId onto a retained host that already has key or
password auth, which would silently change resolveHostAuth preference.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(plugins): add sync providers and encrypted sidecar sync
Implement PR 8 of the plugin platform (#2269): namespaced sync Providers
with provider.sync, encrypted-object storage operations, WebDAV through the
shared storage surface, dynamic cloud provider IDs, and non-cascade sidecars
for sync:true plugin settings plus account/CRDT baselines.
Related to #2269
* fix(plugins): wire sync providers and sidecars into production paths
Close PR 8 integration gaps: dynamic plugin provider registry and
getConnectedAdapter createPluginStorage, WebDAV through EncryptedObjectStorage,
cloud payload collect/apply for pluginSidecars, and IPC/preload bridges.
Related to #2269
* fix(plugins): preserve WebDAV auth reuse and resourceId through EOS wrap
encryptedObjectStorageAsCloudAdapter now reports initiallyAuthenticated when
config exists (matching raw WebDAVAdapter) so getConnectedAdapter reuses the
cached instance, and preserves/refreshes resourceId from the backing adapter
instead of always forcing the default object key.
Related to #2269
* fix(plugins): address Codex PR 8 review findings
Carry pluginSidecars through merge/convergent uploads, lazy-connect before
object I/O with revision-aware writes, fail closed on sidecar collect errors,
expose connectPluginProvider, preserve remote timestamps, and drop deleted
installed-plugin settings from collection.
Related to #2269
* fix(plugins): close remaining Codex P1/P2 sync issues
Lazy stream cancel for inline sync reads, must-not-exist conditional writes,
three-way sidecar merge for local resets, validated apply path for settings,
and merge remote sidecars into convergent uploads.
Related to #2269
* fix(plugins): harden sidecar collect/apply and write verification
Preserve last-known sidecars when the host is offline, apply remote
deletions for installed plugins, force convergent upload on sidecar
divergence, verify plugin object writes, and pick plugin providers in
auto-sync startup checks.
Related to #2269
* fix(plugins): close remaining Codex sidecar/sync path gaps
Include sidecars in auto-sync payload and hash, keep explicit empty bundles,
fail apply when host is offline, require getCapabilities, and carry merged
sidecars into convergent local apply/upload decisions.
Related to #2269
* fix(plugins): close Codex P1 sidecar collect/apply/merge gaps
Treat null host responses as unavailable, persist collected settings into
the non-cascade table, retain decoded convergent payloads, use three-way
sidecar merge for deletions, and fail apply only on operational errors.
Also treat non-empty plugin sidecars as meaningful sync data and re-run
auto-sync when plugin contributions change.
Related to #2269
* fix(plugins): close remaining Codex P1 sidecar and provider gaps
Replay offline-cached sidecars before collect, keep explicit empty
sidecar fields after three-way merge, thread sidecars through convergent
conflict/downgrade materialization, keep gated-off plugin providers from
joining sync as connected, and rebind plugin EOS sessions after runtime
replacement.
Related to #2269
* fix(plugins): separate pending remote sidecars from last-known cache
Replay only host-offline remote applies into the DB, keep last-known as
upload fallback, use contribution reset for deleted settings, probe real
plugin host readiness, rebind storage events for plugin providers, clear
plugin bases on reset, and swallow disconnect rejections.
Related to #2269
* fix(plugins): hydrate retained sidecars and gate missing providers
Materialize installed-plugin settings from retained sidecars before
collect pruning, clear sidecars on setting reset, fail closed when
pending remote replay fails, and only restore plugin providers that are
contribution-available. Also initialize dynamic provider counters on
connect.
Related to #2269
* fix(plugins): surface plugin sync providers and preserve conflict sidecars
Collect live sidecars before convergent conflict apply/upload, include
dynamic providers in status and disconnect paths, and list plugin sync
providers in Cloud Sync settings for connect/disconnect.
Related to #2269
* fix(plugins): per-provider sidecar baselines and safer collect/UI
Merge convergent sidecars against each provider's own baseline, keep
retained settings in sidecars without unvalidated plugin_settings writes,
guard isConnectDisabled for never-connected plugins, and fall back plugin
provider labels/icons in the status popup.
Related to #2269
* fix(plugins): correct plugin provider discovery and sidecar reverify
Read nested contribution metadata for sync provider cards, gate empty-config
connects, enforce single-provider disconnect for plugins, and re-verify after
sidecar-only convergent uploads so baselines track the post-write payload.
Related to #2269
* fix(plugins): refresh sync provider availability from live contributions
Replace the contribution-available provider ID set when plugins change so
disabled or uninstalled sync providers leave the auto-sync ready set and
drop to disconnected with config retained.
Related to #2269
* fix(plugins): preserve sidecars in backups, pending queue, and migration
Attach last-known plugin sidecars to protective local vault backups, fail
operationally when pending/last-known storage writes are rejected, carry
sidecars through convergent migration publish, and reject trailing garbage
on encrypted object parse.
Related to #2269
* fix(plugins): abort conflict collect failures and merge migration sidecars
Rethrow operational sidecar collection errors during convergent conflict
resolution, LWW-union all local/provider sidecars during convergent
migration, re-collect last-known after apply, and prefer live host collect
for protective local vault backups.
Related to #2269
* fix(plugins): restore pluginBridge tests, fix import path, union downgrade sidecars
Correct SettingsSyncTab dynamic import path so production builds resolve,
add ipcMain.on to the plugin bridge test double, union all provider
sidecars on convergent downgrade, keep empty last-known resets, and skip
force-delete when contribution reset validation rejects.
Related to #2269
* fix(plugins): abort backup collect failures and honor empty remote wipes
Only fall back to last-known sidecars when the host is unavailable during
protective backups, treat explicit empty remote sidecar bundles as
authoritative wipes, remove lint-blocking anys from harness tests, and
use a stable equal-timestamp sidecar tie-break.
Related to #2269
* fix(plugins): include sidecars in equality, preserve merge base on reconnect
Compare pluginSidecars in cloudSyncPayloadsEqual for migration freshness,
clear plugin merge state only when account/resource changes on reconnect,
cancel accepted sync read streams on failure, and stop re-connecting the
plugin EOS adapter on every I/O.
Related to #2269
* fix(plugins): drop cached adapters on contribution refresh
Invalidate plugin sync adapters when live contributions change so a
restarted runtime gets a fresh connect, take offline any non-disconnected
missing providers, and latch version-change backups only after cancellation
checks pass.
Related to #2269
* fix(plugins): preserve omitted sidecars and hydrate on plugin enable
Treat missing pluginSidecars as legacy/unsupported in three-way merge
(only explicit empty is a wipe), hydrate retained settings when a plugin
enables, and re-enable retained provider configs when contributions return.
Related to #2269
* fix(plugins): keep newer retained sidecars over older stored settings
When collection merges existing sidecars with plugin_settings rows, prefer
the newer updatedAt so a schema-rejected remote value retained only in
the sidecar table is not overwritten by a stale local setting.
Related to #2269
* fix(plugins): seal plugin provider config and clear base on config change
Encrypt opaque plugin provider configuration before persistence, clear
merge state when reconnect configuration changes, and stream sync objects
below a base64-safe inline threshold so control-plane JSON stays in budget.
Related to #2269
* fix(plugins): seal plugin configs by provider id and hydrate before start
Encrypt plugin provider configuration only for non-builtin provider IDs
so field-name collisions cannot skip sealing, hydrate retained sidecars
before plugin enable starts the runtime, and stop tearing down live
adapters on no-op availability refreshes.
Related to #2269
* fix(plugins): seal scalar configs, safe inline reads, stable config fingerprint
Encrypt any non-builtin plugin configuration JSON shape, enforce the
base64-safe inline read cutoff, and compare reconnect configurations with
order-independent fingerprints so merge bases are not cleared spuriously.
Related to #2269
* fix(plugins): thread sync credentials and harden availability checks
Pass SyncConnectPayload.credential through the object-storage and IPC host
path, treat only null/undefined config as missing, and avoid wiping the
plugin provider availability catalog on transient discovery failures.
Related to #2269
* fix(plugins): unblock schema-required sync connect and scalar configs
Add a JSON config dialog for plugin sync providers that declare a
required configurationSchema, reuse retained configs on reconnect, and
treat falsy scalar configs as present in readiness and adapter lookup.
Related to #2269
* fix(plugins): rebind sync adapters on contribution refresh
Drop cached plugin sync adapters when live contributions still include
the provider so replaced runtimes get a fresh connect, and seal falsy
scalar plugin configs with nullish presence checks end-to-end.
Related to #2269
* fix(plugins): apply sidecars under current declared setting scopes
When a plugin update changes a syncable setting scope, write under the
live declaration and drop the obsolete scope row so collection does not
republish duplicates.
Related to #2269
* fix(plugins): seal config envelopes and stabilize provider counters
Use an unambiguous host-owned sealed-config envelope, initialize
dynamic-provider sequence counters before cross-window decrypt, keep
three-way sidecar deletions during convergent migration, and create the
sidecar table for existing schema-1 plugin databases.
Related to #2269
* fix(plugins): avoid mid-sync adapter drops and sidecar resurrection
Keep plugin adapters across setting-only contribution refreshes and
rebind sessions on ensureConnected; stop preserving local-only missing
plugin sidecars when remote already mentions the plugin; compare configs
with nullish semantics across windows; swallow quick-connect failures
after toasting.
Related to #2269
* fix(plugins): restore remoteKeys for installed sidecar resets
Reintroduce the remote key set used when dropping installed-plugin
settings the remote no longer carries so applyFromSync cannot throw
after replacing the sidecar table.
Related to #2269
* fix(plugins): honor conflict policy and re-key scoped sidecars
Pass preferCloud/preferLocal into three-way sidecar merge, use
per-provider baselines on convergent downgrade so local resets are not
resurrected, and re-key applied settings under the current declared
scope coordinates.
Related to #2269
* fix(plugins): keep strategy on final sidecar merge and block dual legacy
Pass preferCloud/preferLocal through the final verified sidecar merge,
avoid auto-reactivating a retained plugin while another legacy provider
is already connected, cache plugin adapters only after initializeSync,
and preserve explicit null configuration values.
Related to #2269
* fix(plugins): strip plugin avatars and protect last-known sidecars
Do not load plugin-supplied avatar URLs in the main renderer, and avoid
overwriting last-known sidecars with an unmerged remote bundle when the
post-apply collect fails or is non-authoritative.
Related to #2269
* fix(plugins): strip top-bar plugin avatars and stop always-rebind
Hide plugin avatar URLs in the sync status popover, drop always-on
rebindSession for plugin adapters, and read convergent mode from the
local config module when deciding whether to auto-reactivate providers.
Related to #2269
* fix(plugins): use window.netcatty for sync IPC and allow null configs
Read plugin sync and sidecar APIs from the production preload global,
and treat an explicit config property (including JSON null) as present
for readiness and adapter lookup.
Related to #2269
* fix(plugins): close residual Codex P2 sync edge cases
Three-way merge sidecars during v2 convergent migration so local
resets are not resurrected, preserve explicit null plugin configs on
adapter rebuild, rebind EOS sessions after I/O failure for replaced
runtimes, and accept the public inlineObjectBytes limit on readObject.
Related to #2269
* fix(plugins): keep inline read cutoff under control-plane budget
Restore the base64-safe inline cutoff so advertised-size reads cannot
overflow the 128 KiB provider JSON envelope; providers near the public
inlineObjectBytes limit must stream.
Related to #2269
* fix(plugins): harden sidecar empty-vault, hydrate LWW, and credential seals
Close remaining Codex/review gaps for PR8: keep empty sidecar shells from
bypassing upload guards, skip startup hydrate when local settings are newer,
seal/validate durable plugin credential refs, and cover schema 1→2 migration.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): rebind plugin sync sessions and keep null configs
Address Codex P2 on 8ae52c54: re-issue connect after runtime replacement,
and treat stored config:null as present in the dashboard reconnect path.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): defer empty sidecar last-known until sync succeeds
Keep prior non-empty last-known across an authoritative empty collect so the
empty-vault guard can still recognize a plugin-only reset, then commit the
empty cache after a successful upload.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): avoid restricted localStorage global in sidecar test
Bind the mock to a local binding so eslint no-restricted-globals stays clean.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): commit applied sidecar cache and reset orphan settings
Prefer merged payload sidecars when updating last-known after sync, and clear
syncable plugin_settings that lack sidecar rows on authoritative remote deletes.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): reseal marker-shaped plugin configs instead of skipping
Exact __netcatty_plugin_config_v1 collisions no longer bypass encryption; trusted
host envelopes are unwrapped then resealed, and false collisions are sealed whole.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): keep merged sidecars in last-known after apply collect fails
Return applyFromSync entries from IPC and use them when follow-up collect fails,
so preserved missing-plugin rows are not dropped from the offline upload cache.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): delete stale-scope settings at stored coordinates on reset
After resetSetting against the current declared scope, also remove the row at
the sidecar's stored scope so scope migrations cannot republish remote deletes.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): close sync-provider credential, stream, and sidecar gaps
Make SecretRef usable end-to-end via lease-bound network.request, keep
renderer/main transfers abortable and bounded, and stop sidecar
last-known/pending from corrupting backups and conflict apply.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): harden single-provider, secret schema, and conditional conflicts
Keep legacy restart from dual-connecting providers, extract writeOnly schema
secrets into OS storage, and surface conditional-write precondition failures
as conflict UI instead of a generic sync error.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): dedupe sync type imports for lint
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: address Codex review on PR #2713
* fix(plugins): wait for sidecar host before version backup latch
Defer the one-shot upgrade snapshot until the plugin sidecar host is ready (or a short grace), and catch getDataHash failures so pending/baseline paths do not reject unhandled.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(plugins): require sidecar grace before version backup
Always wait for contributions/grace tick before the upgrade snapshot, and only latch after a non-cancelled attempt so cleanup cannot suppress retries.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
* fix(#2727): automated Cursor CLI fix
* fix(sftp): drop external-edit retainers when browse sessions close
closeSftp already deletes registered temps on disconnect/reconnect; clear
the matching renderer retainers so hasActiveWork cannot stick on a gone file.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): clear external-edit retainers when watches force-stop
When the temp file disappears, fileWatcherBridge force-stops the watch
with localPath; drop the matching retainer so hasActiveWork cannot stick.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: address Codex review on PR #2730
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ai): stop OpenCode turns dying on terminal tool failures
OpenCode MCP terminal_execute treated non-zero exits as bare
"Error: Operation failed" (dropping stdout), and the OpenCode driver
aborted the whole turn on tool status=error. Preserve command output
and surface tool errors as tool results so multi-step agent runs can
continue.
Closes#2718
* fix(ai): use neutral MCP text for silent terminal_execute success
Codex P2 on #2724: ok:true empty serial/raw PTY results no longer fall
back to "Error: Operation failed". Prefer Catty's "Command completed
(no output)" and keep operational failures / non-zero exits unchanged.
Also prefer non-empty OpenCode tool error/output when formatting tool
results.
Add single-entry delete on the Global history side panel, remove the
matching host autocomplete record when no duplicate row remains, and
keep the change set intentionally slim (no multi-window journal/sequence
hardening).
Fixes#2701
* fix(terminal): keep broadcast through command colons
Treat trailing colons after a confirmed shell prompt as typed command
input so workspace broadcast is not paused mid-command (#2709).
Require terminator + whitespace so mid-label shapes like Challenge #1:
stay fail-closed; standalone auth prompts remain untrusted.
* fix(terminal): require real PS1 body for colon broadcast bypass
Title-case challenge labels that embed shell markers (Challenge # 1:,
Account $ code:) must stay fail-closed. Only bare markers, user@host,
paths, shell-version PS1s, and lowercase identities count as a real
prompt prefix for the #2709 mid-command colon exemption.
* fix(hosts): keep draft connect scripts before onConnect promote
Host details queue editing pruned non-onConnect scripts immediately, so
default manual automation scripts could be selected but never appeared
in the queue. Keep an editable draft queue and only prune missing IDs
until save promotes triggers.
Closes#2705
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): promote persisted manual connect-queue scripts on save
Editable queue retention left already-saved manual script IDs unpromoted
when reopen/save compared only newly added IDs. Promote every queued
script that still needs onConnect + host targeting.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(hosts): drop unused HostDetailsPanel snippet imports
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): do not demote global scripts during queue save sync
Promote-on-save must leave targetsAllHosts onConnect scripts unchanged
when they appear in a host connectScriptIds list.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(hosts): cover global connect scripts during queue save sync
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): promote connect-queue scripts on new host save
New hosts have no initialData, so queue promote-on-save was skipped and
manual scripts stayed non-onConnect after the first save.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): harden connect-queue promote against Codex review
Preserve global scope when promoting manuals, skip re-promoting scripts
demoted while the host editor is open, sync peer host queues for retained
targets, and keep test fixtures ASCII-only.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): persist peer connect queues with edited host save
Peer queue sync via onHostsChange was overwritten by onSave rebuilding
from a stale hosts snapshot. Write peers+edited host together and make
save paths apply functional host updates.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): keep connect queues across hydration and concurrent edits
Skip queue rewrite while snippets are still empty, and do not promote
entries whose non-onConnect trigger changed while the host editor stayed
open.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): skip connect-queue rewrite before snippets hydrate
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): preserve concurrent target removals and merge peer deltas
Drop stale queue entries when targets were unlinked while editing, and
apply peer connectScriptIds updates via functional host state merges.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): hydrate connect-queue baseline and append peer deltas
Capture the first hydrated snippet catalog as the editor baseline, and
merge peer queue updates by appending only newly queued script IDs.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): snapshot opening queue and keep peer updates host-safe
Use the editor-opening connect queue as sync previous IDs, and never
overwrite the edited host inside peer delta merges.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): clear deleted queues after hydrate and honor manual unlinks
Treat a hydrated empty snippet catalog as ready for queue reconciliation,
and drop concurrently untargeted non-onConnect queue entries on save.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(hosts): clear loginScriptId when connect queue is emptied
sanitizeHost reconstitutes connectScriptIds from loginScriptId when the
explicit queue is absent, so clearing the last queued script must also
drop the legacy field.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Shell-open retries already applied to every Copy Tab reuse, but resilient
PID scans were still gated on jumpHosts. Direct bastion targets that
rate-limit session channels could reuse the shell while leaving the
copied tab without shellPid. Always retry rate-limited discovery on the
reuse path; keep the optional pre-scan pause jump-host-only.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
If the jump-host Copy Tab pre-open PID scan is rejected with channelOpen
too offen, a single delayed attempt left discovery unavailable and skipped
post-open assignment. Retry rate-limited pre-open scans so shellPid
tracking still succeeds before opening the reused shell.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
After a bastion-rate-limited shell open succeeds on Copy Tab, the follow-up
PID discovery exec can hit the same "channelOpen too offen" limit. Delay and
retry that discovery on jump-host reuse so the copied session still gets a
shellPid for unambiguous cwd lookup.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Address review feedback: permanently skipping PID discovery on jump-host
Copy Tab left shared transports without shellPid and broke cwd lookup.
Delay discovery briefly instead, and keep shell-open retries for the
bastion "channelOpen too offen" rate limit.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
Bastion/jump hosts often reject rapid session channel opens with
"channelOpen too offen". Copy Tab was opening a discovery exec then a
shell on the same authenticated transport, failing reuse and falling
back to a fresh login that prompts for OTP again.
Skip shell PID discovery when jump hosts are present, and retry shell
opens with short backoff on the bastion rate-limit error so duplicated
tabs keep reusing the live connection.
Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
If residual/stale HKLM keys cannot be rewritten without elevation, register
per-user HKCU verbs instead so Settings can still enable Open in Netcatty
for portable and unelevated installs.
Persist and compare development app entry args so moving a checkout
re-registers Explorer shell commands instead of keeping a stale
electron.exe + old app path launch line.
Clear only ProgrammaticAccessOnly when unsuppressing keys that still have
commands, and unsuppress after a failed HKLM refresh so preference-write
rollback cannot leave the only working portable integration hidden.
When only one ProgrammaticAccessOnly write succeeds, remove just that
value (or a newly created empty key) instead of deleting the whole HKCU
shell subtree that may still hold a working portable command.
When the saved preference says enabled, still confirm both shell verbs
remain registered; otherwise re-apply so interrupted installer rewrites
or partial cleanup cannot leave a permanently missing menu entry.
When HKLM registration exists, disable only writes ProgrammaticAccessOnly.
Deleting portable HKCU install verbs before a failed suppression left users
with no working Explorer integration and an unrepairable machine path.
Record a separate probe marker for ZIP/portable no-verb defaults so a
shared AppData profile cannot suppress a later NSIS install. Register
development Explorer verbs as electron.exe + absolute app entry.
After a failed machine repair, report any surviving shell verb as enabled
so Settings can disable it. Persist enabled:false for ZIP/portable defaults
so warm starts skip repeated registry probes.
When a partial machine registration exists, keep working portable HKCU
verbs until both HKLM shell entries are current, so unelevated enable
attempts cannot destroy the user's only working context-menu path.
Treat residual portable HKCU verbs as a hard enable failure when HKLM
exists, require suppression cleanup on user-scope enable, and restore
the previous preference when apply partially mutates the registry.
Codex P2 on #2671: portable/ZIP builds leave real HKCU shell verbs that
shadow later all-users HKLM registrations. When machine keys exist,
delete the per-user Netcatty verbs so Explorer uses the current install.
Codex P2 on #2671: if only one ProgrammaticAccessOnly value is written
during disable, delete the partial key so disable never leaves a single
hidden verb while the other remains visible.
Omit sourceSessionId for sftpSudo hosts in the picker and normalize the
browse connect path so reusedConnection (spinner/overlay/logs) matches the
dedicated sudo open. Addresses Codex review on #2674.
Codex P2s on #2671: remove treats any leftover runnable verb as still
enabled, and install restores ProgrammaticAccessOnly when enabling fails
after clearing a prior per-user suppression.
Codex P2 on #2671: when no preference exists but a single leftover shell
verb remains, still run install/repair so the Settings toggle cannot stay
off while Explorer still shows one Open-in-Netcatty entry.
Skip used to mark transfers cancelled without clearing conflict metadata, so reopening SFTP rehydrated the dialog while the transfer center looked empty. Clear conflict on skip/stop, only restore attention conflicts in the dialog, and strip stale payloads when loading persisted history.
Fixes#2636
Codex P2 on #2671: unelevated refreshes must not report success merely
because non-empty HKLM commands exist. Require writes to succeed or both
verbs to already match the expected executable/command contract.
Codex P2 on #2671: treat the integration as user-suppressed only when
both folder and background keys have ProgrammaticAccessOnly, so a partial
suppress write cannot hide one menu while claiming the feature is off.
List open SSH terminals in the SFTP Connected section even when sftpSudo
is enabled. Connection still opens a dedicated sudo SFTP channel and does
not reuse the terminal shell. Closes#2656.
Address Codex P2s on #2671: disabled preferences re-suppress on every
startup so NSIS updates cannot resurrect the menu, and registration is
only considered complete when both folder and background commands exist.
Codex P2 on #2671: a partially written registry verb (key exists, no
command value) must not count as an active menu registration, so install
and Settings toggle state stay honest and repair can still run.
Persist download fingerprints as sha256:pN:hex so coverage is explicit,
treat planned zero bytes as the empty digest, and fall back to a full-file
check for legacy bare sha256:hex identities saved by older builds.
Standalone dedicated reconnect was still coercing totalBytes=0 to
undefined via ||, so the bridge re-statted a grown remote and abandoned
the empty snapshot plan. Keep finite zeros in the stream payload.
Persist the last-applied executablePath in the preference record and
re-apply shell verbs when it differs from the current launcher path so
renamed/moved portable builds keep Open-in-Netcatty working.
Drop growth-aware compact identity experiments that either lost rewrite
proof or needed renderer node:fs. Compact entries keep full size+mtime
identities (retransfer on remote growth). Preserve explicit totalBytes=0
through bridge preflight so empty download snapshots do not re-stat into
a grown remote size.
Codex P2 on #2671: electron-builder portable apps expose the stable
launcher via PORTABLE_EXECUTABLE_FILE while process.execPath points at a
temp unpack that is deleted on exit. Resolve that path for shell verbs
and bump the preference schema so existing installs re-register once.
Path-only compact identities were too weak for rewritten/truncated files.
Download trees now key entry identity to path+planned size (omit mtime),
revalidate covered compact entries against local destination sizes, and
preserve explicit zero-byte snapshot plans through resume validation.
Address Codex P2 on #2671: the Settings toggle is per-user, so disable
only clears HKCU and suppresses machine verbs via ProgrammaticAccessOnly
instead of deleting HKLM (even when elevated). Also persist a schemaVersion
so healthy warm starts skip registry work after the first migration.
Codex P2 on #2671: warm starts no longer spawn a full reg.exe write pass
when installer/user shell verbs already match the expected command, label,
and icon. Still rewrites stale --open-terminal-path entries on upgrade.
Preserve the planned snapshot size for interrupted directory download
children, use path-stable compact identities for download trees so
append-only growth does not invalidate covered prefixes, and treat
zero-byte planned snapshots as complete in the sequential fallback.
Codex review on #2670: accept remote growth only after the full planned
prefix still matches the staged file, and skip the sequential stream when
the checkpoint already covers the snapshot so grown logs do not resume
from the old EOF.
Address Codex review on #2671: when all-users (HKLM) shell verbs cannot be
deleted unelevated, hide them for the current user via ProgrammaticAccessOnly
instead of failing the Settings toggle. Also stop mirroring machine verbs into
HKCU so uninstall does not leave a broken Open-in-Netcatty entry.
Add a Settings > System switch to enable/disable the Explorer folder
context menu, and fix shell launch so Chromium does not swallow
--open-terminal-path (args after --, =path form, trailing-dot roots).
Closes#2651Closes#2655
Address Codex review: after the async clipboard read, only insert when
the find input is still document.activeElement and still connected, so
a delayed paste cannot steal focus or hit the editor body.
SFTP downloads take a fixed size snapshot at start, then rejected the
transfer if the remote file grew before completion. Live logs and other
append-only sources commonly hit that post-check and failed with a size
mismatch. Accept remote growth when the planned prefix was transferred,
and keep resume identity keyed to that snapshot so pause/resume still works.
Closes#2653
Custom Ctrl/Cmd+V handling for Electron overwrote paste while the
snippet script editor find bar had focus, so search text landed in the
script. Route find-widget paste through shared helpers and reuse them
in the text editor.
Fixes#2661
Bound the main-process TCC probe to 3s, only treat real private IPv4/IPv6
literals as LAN, prefer proxy as first hop when set, and annotate
unreachability using either the target or the first hop. Closes the
remaining merge blockers for #2663.
Show manual compact for any Catty session with a configured model, not
only when enough history exists for a large head. External agents still
do not get the command.
Gate /compact behind canCompact so the composer is not cleared as a
silent no-op, hide the usage ring until a real context snapshot arrives,
and summarize only the UI head that the persisted compaction boundary
will drop. Drop unused clearSessionMessages surface and add slash-command
regression tests.
Emit plan items as { text, completed } with top-level running|completed status so sdkAgentAdapter and the activity UI can render labels and completion instead of empty rows stuck on running.
Remove the async rpc.request hop that let promptDone win Promise.race on session/prompt JSON-RPC errors. Gate emitDone on turnCompleted, treat any incomplete process close (including exit 0) as failure, and align streaming-json toolResult emission with ACP when rawOutput is present.
Permission replies must select an optionId offered in params.options instead of inventing allow-once. Process close(null, signal) before turnCompleted is a failure for both ACP and streaming-json drivers.
Attach a stdin error listener so async EPIPE after peer exit is not an
unhandled stream error. Treat EPIPE/ERR_STREAM_DESTROYED as benign
(processErrorGuards/terminalBridge); fail the turn only for other mid-turn
write errors.
Only turnCompleted (headless end / ACP prompt success) may ignore teardown
exit codes. streamedAssistantText must not suppress errors, or mid-response
crashes look successful.
Root cause of Token ~1: onPromptComplete resolved promptDone in the same
tick as session/prompt, so Promise.race often discarded the result and the
UI fell back to estimated usage (prompt length / 4). Emit usage when the
prompt response is handled, and map live Grok _meta.usage fields including
cachedReadTokens.
Drop the inactive acp/streaming-json in-memory session when switching
runtimes so switch-back cannot resume a pre-switch thread without
intervening turns. Forward optional session/prompt usage to emitter.usage.
Tool-only turns leave no assistant text; Windows teardown often exits with
code 1. Mark turnCompleted when session/prompt succeeds so close does not
emitError or skip emitDone.
Windows .cmd/.bat installer shims fail with spawn EINVAL when launched
without shell. Route ACP, headless, and models spawns through the same
helper other managed agents use.
When a stored session id cannot resume/load, still inject renderer history
into the new session prompt so multi-turn context is not dropped. Successful
resume/load paths remain unseeded to avoid stacked prior replies.
Prefer ACP session/resume (then load/new) without replaying history into the
current turn, authenticate when Grok advertises methods, isolate acp vs
streaming-json session identities, and apply MCP local-tool lockdown plus
--no-auto-update on both transports.
Suppress session/update emissions until session/prompt starts so
session/load history replay does not fill the current assistant bubble.
Also treat Grok like CodeBuddy: when a resume session id exists, do not
also inject renderer conversation history into the prompt.
Expose a Settings toggle on the Grok Build card (like Codex App Server)
to choose ACP agent stdio or the original headless streaming-json path.
Persist grokRuntime on ExternalAgentConfig and pass it into the driver
via NETCATTY_GROK_RUNTIME on the agent env.
Grok agent stdio session/new rejects plain object env (Invalid params /
McpServer enum). Emit type:stdio servers with env as [{name,value},...]
matching the live protocol, and assert the shipped shape in unit tests.
In MCP tool-integration mode, pass --disallowed-tools for Grok built-in
shell/edit/write so remote session work goes through injected Netcatty MCP,
matching Claude-style policy. Skills mode leaves local shell available for
the Netcatty CLI skill path.
Curate GROK_MODEL_PRESETS and wire getAgentModelPresets so the chat model
picker still has a non-empty list when live grok models discovery fails,
matching the Claude/Codex fallback pattern.
Expose Grok as a managed Settings agent card, icon, coding-CLI provider,
and runtime model discovery target. Add en/zh/ru strings for in-app Grok
Build (distinct from External MCP client install).
Add grok to ManagedAgentKey/meta, discovery known-agents list, XAI_API_KEY
and ~/.grok/auth.json auth probe, and closed sdkBackend unions so the CLI
is discoverable and routable like other managed agents.
Register a headless streaming-json driver for backend key grok that maps
ACP-derived NDJSON events into the shared emitter protocol and injects
Netcatty MCP via a project .grok/config.toml merge with restore.
Codex P2: restoreWorkspace() rebuilds the workspace object field-by-field
and omitted autoTitle, so with Restore Previous Session enabled an
explicitly named "Workspace" (rename / creation dialog / snippet) lost its
autoTitle:false on restore and got relabeled with a host name.
Carry autoTitle through restoreWorkspace with a boolean guard so a
deliberate false survives and legacy workspaces stay flagless. Adds restore
coverage for both the explicit-false and legacy-absent cases.
Codex P2: resolveWorkspaceTabLabel treated any workspace whose title equals
"Workspace" as an untouched default and replaced it with a host label — so a
workspace a user renamed to "Workspace" (or a snippet named "Workspace")
lost its chosen name.
Add an explicit Workspace.autoTitle flag. It is authoritative when present:
- set false on user rename, snippet-created, named "New Workspace", and any
createWorkspaceFromTargets call given an explicit name;
- absent/true means the tab may derive a host label.
Legacy workspaces without the flag fall back to the old default-title string
check, so already-open default splits still get host labels and previously
renamed workspaces keep their names.
- domain/models/workspace.ts: add autoTitle field.
- domain/workspace.ts: thread autoTitle through createWorkspaceFromSessionIds.
- application/state/useSessionState.ts: mark rename / snippet / named
creation paths as explicit; createWorkspaceFromTargets takes an optional
name and only marks custom when one is given.
- domain/sessionTabTitle.ts: derive only when autoTitle (with legacy string
fallback); tests for explicit "Workspace" name and explicit auto-title.
Third Codex P2: submitSessionRename rewrites BOTH customName and hostLabel
(useSessionState.ts:585,597), so counting distinct hosts by hostLabel still
mislabeled a renamed same-host pane as a separate host and added a spurious
"+1".
Count by session.hostId instead — the only identity a rename leaves
untouched. All local terminals share the stable LOCAL_TERMINAL_HOST_ID and
remote sessions carry their host config id, so same-host panes collapse to
one regardless of renames. The focused pane still shows its rename as the
primary label. Tests updated to carry hostId (including a rename that
rewrites customName + hostLabel but keeps hostId).
Follow-up Codex P2: the "+N" distinct-host set used getSessionConnectionLabel
(customName || hostLabel), so two panes on the same host where one session
was renamed produced different keys and a spurious "+1", presenting the
workspace as spanning multiple hosts.
Count distinct hosts by hostLabel alone. The focused pane still shows its
rename as the primary label; only the host count ignores per-session
renames. Adds coverage for the renamed-same-host and rename-with-multi-host
cases.
Review feedback (Codex P2 + Copilot): resolveWorkspaceTabLabel derived
its label and its distinct-host "+N" count from resolveSessionTabTitle,
which folds in the dynamic shell/agent title. Two problems:
- those live titles are published only to the session presentation store,
not the plain session records passed to the tab, so the label went stale
under dynamicTabTitleMode 'agent'/'all';
- per-pane dynamic titles differ on a single host, so the "+N" suffix
fired even when every pane was on the same host.
Use getSessionConnectionLabel (rename / host label) — the stable host
identity — for both the primary label and the distinct-host set. This is
also what the tab is meant to convey (which host), and it needs no
presentation-store subscription. Drops the now-unused dynamicTabTitleMode
argument from resolveWorkspaceTabLabel.
A tab holding a split workspace showed the generic default title
"Workspace", giving no hint which host it belonged to. Derive the tab
label from the workspace's focused session when the workspace still
carries the default title: a local shell reads as its host label
(e.g. "Localhost"), an SSH session as its configured host name. If the
workspace spans more than one distinct host, the focused host is shown
with a "+N" suffix. A user-renamed workspace keeps its custom title.
- domain/sessionTabTitle.ts: add DEFAULT_WORKSPACE_TITLE sentinel and
resolveWorkspaceTabLabel(), reusing resolveSessionTabTitle so labels
match what single-pane tabs already show.
- domain/workspace.ts, application/state/useSessionState.ts: reference the
shared DEFAULT_WORKSPACE_TITLE constant for the default title.
- components/top-tabs/TopTabItems.tsx: render the derived label (with a
title tooltip) instead of workspace.title.
- domain/sessionTabTitle.test.ts: cover rename, single/multi-host, empty.
Copilot review caught that the new showContextMenuOverFullscreenApps flag
only affected the TerminalContextMenu suppression helpers, but the
capture-phase contextmenu interceptor in useTerminalEffects
(shouldInterceptMouseTrackingContextMenu) still called preventDefault +
stopImmediatePropagation on every non-Shift right-click while mouse
tracking was active. That killed the contextmenu event before it could
reach Radix, so the menu never opened even with the setting on.
Route an unmodified right-click through the same path as Shift+right-click
when the setting is on and rightClickBehavior is 'context-menu':
- shouldInterceptMouseTrackingContextMenu returns false (let contextmenu
reach Radix so the app menu opens)
- shouldStopShiftRightClickMouseTrackingMouseDown returns true (stop the
button press from reaching the TUI, so tmux/vim don't also react)
The setting is menu-only: paste / select-word right-click behaviors are
unchanged. Adds predicate coverage in middleClickBehavior.test.ts.
Add an opt-in "Show menu over fullscreen apps" terminal setting
(showContextMenuOverFullscreenApps, default off). When enabled, the
right-click context menu opens even while a fullscreen app (tmux, vim,
less) holds mouse tracking, instead of the click being passed through to
the app.
Threaded via a new forceMenuInAlternateScreen flag through the
shouldSuppressMouseTrackingContextMenu predicate (single source of truth)
and its callers. Default off keeps current behavior unchanged; Shift+
Right-Click still works as the escape hatch when off.
- domain/models/terminal.ts: new field + default false
- application/syncPayload.ts: include key in synced terminal settings
- TerminalContextMenu.tsx: forceMenuInAlternateScreen through predicates + prop
- TerminalView.tsx: wire setting to prop
- TerminalBehaviorSettings.tsx: toggle row
- i18n en/ru/zh-CN/zh-TW: label + description
- TerminalContextMenu.test.ts: coverage for the opt-out
Chinese glyphs (PingFang etc.) paint outside a 1.0 em box, so leading-none
plus truncate was slicing vault tree, tabs, and dialog titles. Use safer
line-heights and slightly taller note title inputs.
The title-bar terminal icon only appeared on Vault/SFTP and vanished on
terminal surfaces with the host tree open. Drop the redundant control;
local shell remains on the host-tree toolbar and quick switcher.
Finish-path metadata checks treated mtime/ctime bumps as hard source
changes. On macOS, xattr/Spotlight can move ctime without rewriting
bytes, so repeated pause/resume often failed near 100%. Prefer digest
verification for uploads; keep strict timestamps for downloads.
After soft-resume, main may advance lifecycleEpoch past the worker-local
value. Progress fanout now stamps max(main, worker) so the transfer center
does not reject live progress as stale.
In worker-backed mode soft-resume must stamp the normalized main epoch
(broadcast by nextWorkerLifecycleEpoch), not the worker-local value, so
later progress is not rejected as stale.
Foreground Resume no longer joins the multi-minute background wait promise;
each caller waits with its own maxWaitMs, and only the final truncate is
single-flight. Failed settle attempts are not sticky on later Resume clicks.
Codex P1s: exclusive single-flight deferred truncate so background settle
cannot race resume unpause, and soft resume waits for/uses the pause-time
full SHA-256 fingerprint when available before unpausing.
- Soft resume identity: size + mtime (+ local head sample), not size-only,
so same-size in-place rewrites are rejected without full-file SHA-256.
- resumeQueuedTransfer returns lifecycleEpoch so soft-resume does not invent
a higher epoch and drop live progress.
- Ignore left-/right- SFTP pane connection ids as openSftpForSession targets.
- Pass resumeHosts (vault + ephemeral) separately from vault hosts used by tray.
Pause then resume was flaky: soft resume cleared lifecycle epochs so stale
paused events re-applied, soft failures always rehomed to dedicated-resume
(panel queue vanished, "reconnecting" then stuck paused), and concurrent
range soft-drain only waited 1.5s before "still finishing".
Soft resume now stamps bridge lifecycle epochs, only hard-reconnects when
the live stream is gone, dedicated resume reuses terminal/parked transports
(including ephemeral hosts), and deferred sparse settle runs in the
background with a longer resume wait for in-flight ranges.
Call the existing focus primitive directly on tab switch (no outer rAF
wrap). Resolve workspace Detach Session labels via per-session
usePresentedSession so dynamic titles stay live without remapping the
whole TopTabs bar.
Stop TerminalLayerWorkspaceSection from falling back to memoized ctx when
sidePanelLiveStore clears activeWorkspace (workspace → solo tab). Refuse
session-restore active-tab patches without a trusted in-memory full payload
so a connect+activate race cannot write stale disk sessions under a new
activeTabId; force full rebuild from live state instead.
Stop AppView from re-subscribing to activeTabId so shell composition no
longer rebuilds on every top-tab click; move plugin keybindings and host
editor surface visibility into leaf subscribers. Patch session-restore
activeTabId without re-serializing every session on tab switches, defer
chrome theme CSS work with fingerprint short-circuit + rAF, let terminal
workspace chrome read active workspace from the live store, apply TopTabs
presentation per tab, and keep hibernate wake chunked/idle with leaner
focus scheduling.
Encode null vs missing presentation fields for useSyncExternalStore, and
compare AI history list title chrome so renames refresh without stream thrash.
Skip clipboard writes on selection reattach, bound xterm wait polling, and
detect AI session create/delete for history lists without sibling stream thrash.
- Store null presentation tombstones so clears override stale snapshots
- Compare selected AI session identity for cross-scope history resumes
- Attach selection overlay after xterm runtime exists; skip copy-on-select
while preserveSelectionOnInput restores the selection
- Align system-sidebar hibernation source contract with resolvedSession
updateHosts now reuses unchanged host object refs instead of re-sanitizing the
whole vault, and terminal host patches use a functional update. Line-timestamp
toolbar toggles optimistically so the gutter paints before vault write work.
Auto-focus no longer claims keyboard focus when the caret is in the AI/side
panel. Selection overlay and copy-on-select move into TerminalSelectionAIOverlay
so clearing selection (e.g. focusing the AI input) does not re-render the whole
Terminal tree.
App/TopTabs consume useEditorTabChromeList so content keystrokes no longer
rebuild shell domains; dirty dots use useEditorTabDirty. AI side panels keep
the full sessions list for fuzzy history but areEqual only on exact-scope
session object refs so sibling stream ticks skip retained panels.
Stop appTerminalDomain from depending on the whole settings bag and stabilize
hotkey/capture callbacks via refs so opacity/settings/log writes do not rebuild
the terminal domain. Gate hidden History shellHistory subscriptions, use a
stable empty quick-switcher list, and move TopTabs activity dots onto per-tab
store snapshots so sibling activity no longer re-renders the whole tab strip.
useSyncExternalStore now reads a per-session snapshot string so sibling title
updates notify the store but do not re-render unaffected TerminalPane instances.
Merge main into the PR branch and keep the top-tabs local terminal control as a
fallback when the host-tree toolbar is disabled, collapsed, or not on a work
surface (Codex review).
Use the shared show/collapse/hide layout for the host-list toolbar, drop the
redundant top-tabs local-terminal button, and switch the local shell control to
the borderless Terminal glyph as the primary one-click entry.
Address Codex P2/P3 on #2628: feed live titles/providers to TerminalFocusSidebar
and TerminalPane chrome via sessionPresentationStore, and keep aiPanelContextsEqual
on domain-local types so domain does not import UI modules.
useThemeRuntime now returns a memoized bag with setters-stable callbacks, and
App domain memos depend on clear/pick/resolve members instead of the whole
runtime object so unrelated App re-renders no longer rebuild appTerminalDomain.
Split the main-window mega bag into domain-scoped AppView slices so Vault,
terminal, chrome, dialogs, and mounts only re-render when their slice identity
changes. Drive tab titles/coding-CLI icons through sessionPresentationStore
(store-only live updates + orphan map overlay), retain presentation-stable
sessions for domain memos, stabilize AI panel context Maps with structural
equal/retain, and keep shell history on shellHistoryStore so Vault host lists
ignore history-only churn.
- Memo side-panel chrome on stable equal; read live theme when shell is open
- Theme/System live subscribe only when those panels need it; scripts runs
subscribe only while Scripts is visible
- Treat workspaceById focus-only identity as stable for side panels
- Include knownHosts / add-known-host / transfer-count handlers in stable keys
- setScriptRuns publishes scriptRunsStore so automation has a single source
Address correctness and residual jank found in review:
- Expand pane session equality for connect/startup fields (pendingInitialCwd,
startupCommand, pending scripts, serial/local shell, etc.).
- Cache coding-CLI provider in the signal controller so memo-skipped
TerminalLayer renders cannot clear titles via a stale sessionsRef.
- Heal terminalCwdStore drift when the renderer ref already has the path.
- Publish shell history synchronously on write/load and via useLayoutEffect.
- Move script runs to scriptRunsStore; Scripts slot subscribes so automation
ticks no longer re-render TerminalLayerInner.
- TerminalLayerView equal uses stable side-panel keys only (cwd/theme live
via sidePanelLiveStore, not chrome re-renders).
- Compare terminalFontFamilyId / session log props; stabilize HostTreeView
callbacks and end-session-drag handler.
Decouple high-frequency UI state from TerminalLayer's memo boundary so
npm run dev is less dominated by full-layer reconciliation.
- Publish shell history through shellHistoryStore; History side panel
subscribes directly instead of receiving shellHistory props.
- Track terminal CWD in terminalCwdStore so OSC 7 updates do not setState
TerminalLayerInner; TabBridge updates side-panel live snapshots only.
- Move remote-history ownership into the History side-panel slot.
- Treat sessions as equal for pane/layer memo when only dynamicTitle or
codingCliProviderId changes (TopTabs still sees full session updates).
- Stabilize AppView terminal handlers; thin AI vault catalog props when
the AI panel is not visible; memo HostTreeView.
Keep retained AI panels mounted for session continuity, but skip
ChatMessageList/ChatInput while CSS-hidden so tab switches do not
reconcile Streamdown trees. Render assistant text as plain content
during streaming, lazy-load Streamdown only after the turn settles,
and split message layout from the markdown chunk for a lighter open path.
Bump @xterm/* betas so shared-atlas clear (#6055), no-mipmap upload
(#5987), and capacity eviction (#6043) ship in addon-webgl. Replace the
local isolation/backport postinstall mutator with a verify-only gate.
Default new-terminal scrollback to 3000 (closer to VS Code's 1000).
The post-install userns probe runs as root under dpkg/rpm, and root can
create a user namespace even when unprivileged userns is restricted (e.g.
Ubuntu 23.10+ with apparmor_restrict_unprivileged_userns=1). The probe
therefore always passes at install time and leaves chrome-sandbox at 0755,
so on machines where the app itself cannot use the userns sandbox Chromium
aborts: 'The SUID sandbox helper binary was found, but is not configured
correctly ... must be owned by root and have mode 4755'.
Set 4755 unconditionally (the historical electron/chrome default) so the
SUID sandbox works as a fallback whenever the userns + AppArmor path fails.
Refs: binaricat/Netcatty#2607
A cloned SSH session whose first connection fails before the inherited
cd is consumed lost the directory on manual retry: startReconnect(manual)
calls prepareRestoredReconnect(), which clears restoreCwdIntentRef for
non-restored sessions, and the initial-cwd prep only ran at runtime boot.
Re-run prepareInitialCwdIntent() in the manual branch; it no-ops once the
cwd was consumed or when there is no pending inherited cwd.
- hostById is a Map, not a function: my previous commit called it as
hostById(id), throwing TypeError on every Copy Tab / Split. Use
hostById.get(id), and fall back to terminalHosts for ephemeral hosts absent
from the saved-host map (P1)
- classify the DETECTED host.distro (not getEffectiveHostDistro, which returns
a cosmetic manual override) when deciding the network-device probe gate, so a
pinned Linux icon can't re-enable the exec channel on a Huawei/Cisco host (P1)
- clear pendingInitialCwd via app state when the inherited cd is consumed
(report the new cwd through onTerminalCwdChange), so shells that never emit
OSC 7 don't keep the transient seed and re-inject a stale dir on remount (P2)
Adds regression tests: Map-based hostById, network-device gate (deviceType,
detected distro, ephemeral terminalHosts).
- Local clones now inherit the live tracked cwd: expose getSessionRestoreCwd
(the OSC 7 cwd map, which is never mirrored onto session.lastCwd) and feed it
into captureInheritedCwd as the primary source, so Copy Tab / Split of a
running local terminal open in its current dir, not the launch dir (P1)
- Gate the SSH /proc probe like the app's own cwd-probe path: never probe
network devices (Huawei VRP etc. can drop the session on the extra exec
channel) and consult the SSH banner for unclassified hosts (P1)
- Mark the inherited cd consumed only when it is actually sent (from the
restore-cwd consumption callback), so a failed first connect can re-arm the
intent on retry instead of starting in the login dir (P2)
- captureInheritedCwd: race the SSH cwd probe against a 1.5s timeout so a
slow/wedged connection can't block clone/split tab creation; fall back to
lastCwd on timeout/failure
- clone factory: only set pendingInitialCwd for inject-eligible remotes
(ssh/undefined, non-mosh/et), not telnet/serial/mosh/et where it would be
dead, never-cleared state
- AppView: pass a stable useCallback for the new-local-terminal icon instead
of an inline arrow that defeated the TopTabs memo comparison
Reconnect can replace browse connection ids before save completes, so close
handlers that only matched sessionId skipped dirty editors and tore down their
writer. Remap as soon as reconnect is detected and match owners by sftpTabId.
Co-authored-by: Cursor <cursoragent@cursor.com>
- captureInheritedCwd: probe live SSH cwd before stale lastCwd snapshot (Codex P2)
- new-local-terminal icon routes through handleCreateLocalTerminal so sessions get a ConnectionLog + output capture (Codex P2)
- use single-quote import in AppHandlers (Copilot)
Reconnect during save changes the browse connection id before remapSessionId
runs, so session-id-only ownership briefly reports no owned editor and parks
the channel mid-write. Match promoted editors by sftpTabId as well.
Co-authored-by: Cursor <cursoragent@cursor.com>
Re-resolve the pinned pane after ensureRemoteSftpId so editorTabSave
remaps session ownership to the regenerated connection id.
Co-authored-by: Cursor <cursoragent@cursor.com>
Track sftpTabId on editor tabs, remap sessionId after reconnect, and
subscribe SFTP side panels to editor presence only so typing does not
rerender every mounted panel.
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop hostId-based pane fallback so non-owning SFTP writers keep throwing
"connection is no longer available" and editorSftpBridge can dispatch to the
correct owner when multiple useSftpState instances are mounted.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep browse sessions alive when promoting the built-in editor to a tab, and
reconnect the SFTP session on save when the browse mapping is missing.
Closes#2576
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(terminal): suggest Network Device Mode via a session-header tip
When a connected host is classified as a network device (auto-detected
vendor banner/os-release, or a manual distro-icon override) but Network
Device Mode is off, show a non-blocking one-line tip at the top of the
session. The user can enable the mode (persisted to the host) or dismiss
it; we only suggest once per host.
Driven by the host's effective distro so it also previews without real
hardware: set a host's device icon to a network vendor and reconnect.
- domain: shouldSuggestNetworkDeviceMode (exact vendor match, once-per-host)
- application/state: networkDeviceModeSuggestion persistence boundary
- TerminalView: header tip + reserve top offset so it never covers output
- i18n: terminal.networkDevice.tip.* for en/zh-CN/zh-TW/ru
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): gate network device mode tip to plain SSH sessions
Codex review: the suggestion tip used the host's effective distro (incl.
manual icon override), so a Mosh/ET/serial/telnet session with a
network-vendor classification would still offer it and persist a
host-level deviceType:'network'. The Host Details toggle is exposed only
for plain SSH hosts, so this could set a hidden mode that surprises later
SSH reconnects. Add an effectiveProtocol gate to shouldSuggestNetworkDeviceMode
and pass effectiveTerminalProtocol from TerminalView. (#2367)
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): make network device tip gate effective and popup/multi-pane safe
Addresses Codex re-review on the tip:
- The effectiveProtocol gate was dead: ctx never carried
effectiveTerminalProtocol, so it was always undefined (unrestricted).
Derive it from the host via resolveEffectiveTerminalProtocol instead.
- Suppress the tip when host updates are unavailable (detached popup has no
onUpdateHost) so Enable can't silently no-op; plumb canUpdateHost through ctx.
- Sync dismiss/enable across panes/windows for the same host via an in-process
subscription in the suggestion persistence module. (#2367)
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): make network device tip once-per-host, ephemeral- and multi-window-safe
Addresses Codex re-review round 3 on the tip:
- Exclude ephemeral deep-link/quick-connect hosts (isSavedVaultHost): they are
not in the persisted vault array, so Enable would silently no-op even though
canUpdateHost is true.
- Track first display separately from user interaction: record "shown" silently
on first display so simply closing the session no longer re-nags on every
reconnect, while the showing instance keeps the tip until the user acts.
- Propagate resolve/dismiss across separate BrowserWindows (#/session-window)
via a native storage-event listener that diffs newly handled host ids.
(#2367)
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): don't touch localStorage at import; keep network tip clear of speed dial
Addresses Codex re-review round 4:
- P1: networkDeviceModeSuggestion read localStorage at module scope
(knownHandledIds initializer), which threw ReferenceError under the Node
test runner and broke `npm test`. Initialize it lazily inside the existing
browser-only window guard instead.
- P2: when the host info bar is hidden and search is closed the full-width tip
strip overlapped the compact speed-dial toggle (top-right) and swallowed its
clicks. Reserve right-side clearance for the toggle via a pure
resolveNetworkDeviceTipRightInset helper (with unit test).
(#2367)
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): drop network tip once the host is classified elsewhere
Addresses Codex re-review round 5: while the tip is latched open, enabling
Network Device Mode from Host Details or a synced pane updates the host to
deviceType:'network', but the eligibility effect's early return kept the tip
(and its now-redundant Enable action) visible. Clear the latch whenever
host.deviceType becomes 'network'. (#2367)
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): persist only the deviceType override, not the effective host
Addresses Codex re-review round 5 (P1): the tip's Enable spread the *effective*
session host (group defaults / proxy profile already materialized) into
onUpdateHost, so mergeTerminalHostUpdate froze every inherited field
(credentials, appearance, proxyConfig) as host-level overrides and later
group/profile changes stopped propagating. Send a sparse
{ id, deviceType: 'network' } update instead. (#2367)
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor(terminal): move network device tip lifecycle into a state hook; per-host keys
Addresses Codex re-review round 6:
- P1 (architecture): TerminalView no longer imports the persistence API or owns
the handled-state subscription/eligibility/writes. Extract
useNetworkDeviceModeSuggestion under application/state; the component consumes
{ visible, enable, dismiss } and keeps only view glue (sparse host update +
toast), per AGENTS.md's layer boundaries.
- P2 (cross-window clobber): persist one key per host instead of a single shared
array. localStorage has no atomic read-modify-write, so concurrent appends
from two windows could drop a marker; independent keys never clobber, and the
storage event recovers the host id directly from the key.
(#2367)
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Main-process progress IPC was ~10 Hz and each tick remapped the full
transfer list plus published the global center, pegging the main window
renderer at 100%+ CPU during large copies. Raise IPC throttle to 250ms/1MB
and coalesce progress-only React/store patches to one paint per frame.
Restart resume and bulk dedicated opens were still calling openSftp, which
silently borrowed a parked/shared terminal transport. That reattached
checkpoint resume to a lease-bound conn instead of an independent dial.
Dedicated transfer sessions now pass reuseTransport:false so they always
open a fresh vault SSH connection.
Remove ensureTransportShape upgrade of bare { count, conn } descriptors.
Borrow requires a registry transport from createConnectionRef/createTransport.
Update tests to construct real transports instead of hand-rolled count objects.
acquireConnectionRef / borrowTransport now ensure leases Map and registry
fields exist on pre-registry { count, conn } descriptors so older tests and
in-memory sessions do not throw on transport.leases.has.
Password-only automatic login now digests the password so vault rotation
invalidates parked reuse, while multi-material auto keeps publicKey-based
matching so key-first transfer opens still find the shared transport.
Auth material fingerprints are method-scoped so key-first / password-retry
SFTP opens still match a parked multi-material transport. Password rotation
invalidates password auth; key/cert content rotation invalidates those methods.
Digest password/privateKey/certificate/passphrase/identity paths into the
auth fingerprint so key or password rotation under the same keyId invalidates
parked transports. Secrets are not retained on the transport registry — only
the digest is indexed.
Bind-failure cleanup must remove close/error handlers while conn is still
attached; releasing first cleared conn and left stale listeners on the
shared transport after local bind errors.
Add resolveSftpTransferSourceSessionId that walks all reusable terminal
sessions instead of the picker one-per-hostId list, so transfers can still
borrow a live transport when another tab for the same hostId has a different
endpoint.
Dedicated dials that registered a transport lease were leaving the lease
held after local/dynamic server errors. Always release managed leases so
authenticated connections are not orphaned until quit.
Record remote bind target before forwardIn so cancel-during-listen always
unforwards (or discards). Shared PF transport errors discard instead of park;
identical idle TTL re-sends no longer reset idle deadlines.
Remote unforward callback errors now discard the shared transport like
timeouts, so a half-open remote listen cannot be idle-parked. Shared
port-forward reuse attaches close/error lifecycle before bind so mid-listen
transport drops cannot leave zombie local listeners.
Shell and parked-shell lookup now use endpointAllowsReuse(..., "shell") so
disabling ForwardAgent cannot reattach to a warm conn that still exposes the
local agent. SFTP/port-forward keep asymmetric channel reuse so they can still
borrow a ForwardAgent-enabled terminal transport.
Store agentForwarding on the session/transport endpoint and apply an
asymmetric reuse check: opens that need ForwardAgent reject parked conns
that never enabled it, while SFTP/port-forward can still borrow a
ForwardAgent-enabled terminal transport.
Transfer pool source sessions now require hostname/user/port parity so
multi-tab or overridden endpoints do not borrow the wrong shared transport.
Remote forward cancel-during-forwardIn and stop paths share one timed
unforward helper that discards the transport when the server listen stalls.
Avoid shell/sftp lease id collisions across reconnect generations, and
discard the shared transport when remote unforward cannot be confirmed
within the stop timeout.
If the user stops a shared local/dynamic/remote forward while listen or
forwardIn is still pending, close the listener and resolve cancelled
instead of re-registering the tunnel as active.
Track accepted forward sockets per tunnel and destroy them on stop, end
already-dead transports instead of parking them, and fingerprint
command-proxy routes so edits invalidate warm reuse.
Catch transport registration failures inside async bind callbacks so a
dead shared socket cannot crash the main process, and fingerprint jump
hops by both vault id and effective endpoint/proxy.
Include proxy/jump profile identity in transport keys, normalize loopback
remote-forward addresses, detach shared listeners on cancel, and avoid
MFA-retrying dedicated dials for local bind failures.
Attach error/close lifecycle to reused port-forward transports, match
wildcard remote binds by expected listen address, and end unusable
transports whose sockets are destroyed during lookup.
Scope transport keys by vault hostId so different profiles cannot share
an authenticated connection. Fix createConnectionRef to preserve hostId.
Route remote-forward accepts by destPort/bind address, await unforwardIn
before success, return stopAllPortForwards as a promise, and update
async cancel tests.
Introduce a main-process SSH transport registry (borrow/return leases,
ControlPersist-style idle park) shared by shell, SFTP, transfer, and
port-forward. Transfer pool becomes channel concurrency only; remove the
separate transfer-pool idle TTL UI in favor of a single SSH keep-alive
setting. Register dedicated SFTP dials, reuse parked transports, and fix
TTL 0 (park until quit), jump-host endpoint keys, and remote unforwardIn.
* fix(terminal): suppress autocomplete popup on alternate screen (#2530)
Codex CLI's TUI (and other full-screen apps like vim/htop/less) render
their own input UI on the alternate screen buffer. Netcatty's autocomplete
only gated on its shell-prompt heuristic, which codex's composer line
matches — so typing "/" inside codex popped up Netcatty's path/command
list on top of codex's slash-command menu.
Bail out of fetchSuggestions (the single query path for both popup and
ghost text) when term.buffer.active is the alternate buffer. Reuses the
existing isTerminalAlternateScreenActive helper already used by hibernate.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(terminal): keep simple alt-screen autocomplete ban (#2530)
Drop the bloated TUI-vs-multiplexer heuristics from the codex auto-fix loop.
Disable autocomplete unconditionally on the alternate screen buffer — same
simple tradeoff as other hosts; tmux/screen attach has no Netcatty completions.
* fix(terminal): drop alt-screen completions after async lookup too
Same unconditional policy as the entry gate: if the buffer switched to
alternate while getCompletions was in flight, discard results so popup/ghost
cannot paint over a TUI. #2530
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(ai): route auto-detected network devices to raw PTY exec (#2367)
AI exec paths (Catty, worker, MCP) decide whether to send commands raw
(no shell wrapping) based on meta.deviceType === "network". That field
only reflected the manual Network Device Mode toggle (host.deviceType),
so auto-detected switches (Huawei VRP, Cisco IOS, …) still went through
the POSIX shell wrapper. Their vendor CLIs reject the wrapped command,
the start marker never arrives, and the call stalls until the startup
timeout.
Report deviceType: "network" when the detected distro/vendor classifies
as a network device too, mirroring the terminal's own gating. This also
gives the AI system prompt vendor-CLI guidance before the user manually
flips the toggle. Mosh/ET sessions stay suppressed since they require a
shell-backed PTY.
Extract the pure buildAITerminalSessionInfo helper into its own module
for testability and add unit coverage.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(ai): guard network-device classification against substring false positives
Address Codex review: replace non-ASCII ellipsis with ASCII per the
ASCII-only convention, and add a regression test proving classification
is exact-match against the vendor id list (so a custom distro that merely
embeds "cisco"/"huawei" is not treated as a network device).
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* perf(vault): virtualize host pickers for large inventories
Virtualize Select Host, Quick Switcher, SFTP host picker, and workspace
dialogs so thousands of hosts only mount a viewport window. Shared scroll
and keyboard clamp helpers keep selection and filter-while-scrolled paths
stable under virtualization.
* fix: address Codex review on PR #2553
* fix(vault): plugin row heights and Select Host keyboard types
Give Quick Switcher plugin command/view rows a taller virtual slot so
two-line chrome does not overflow into the next absolute row. Narrow
Select Host navigable rows to group|host so Enter keyboard activation
typechecks cleanly.
* fix(vault): finish host-picker review feedback
Clip and truncate fixed-height Quick Switcher / workspace rows so long
labels never overlap the next virtual slot. Wire Select Host listbox
aria-activedescendant to stable option ids for keyboard AT feedback.
* fix: address Codex review on PR #2553
* fix: address Codex review on PR #2553
* fix: address Codex review on PR #2553
* fix: address Codex review on PR #2553
* fix(vault): clear remaining host-picker codex findings
Declare multi-select listboxes, drop empty SFTP Hosts headers when only
connected rows remain, size the SFTP list to content under a 360px cap,
and give Quick Switcher / workspace pickers a definite max scroll height
so large inventories remain reachable.
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
Packaged Netcatty launched from Finder often has process.cwd() === "/", so
merging .cursor/mcp.json failed silently and netcatty-remote-hosts never
mounted. Point CLI turns at Netcatty temp and fail loudly on merge errors.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore: switch .gitignore to allowlist layout
Default-deny root paths so a mistaken git add cannot pick up secrets,
agent state, or build artifacts. Re-include only known source paths and
keep the existing classical denylist for nested outputs.
Closes#2534
* fix: address Codex review on PR #2554
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
* feat(snippets): open quick add/edit as a centered modal
Replace the scripts side-panel AsidePanel drawer with a Dialog so
snippet create/edit no longer slides over the terminal workspace, while
keeping the same form fields and shortkey capture behavior.
* fix: address Codex review on PR #2552
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
* feat(vault): optimize large imports and vault rendering (#2526)
* fix(vault): address import review findings
* fix(vault): preserve filtered selection and import consistency
* fix(vault): complete import review fixes
* fix(vault): make import cancellation concurrency-safe
* fix(vault): preserve concurrent edits during import rollback
* fix(vault): handle concurrent saves and reset import target
* fix(vault): drop empty source groups after targeted import
* fix(vault): preserve sidebar accessibility check
* fix(vault): correct group counts and selection semantics
* fix(vault): preserve imports across concurrent saves
* fix(vault): preserve concurrent group changes during import
* fix(vault): close concurrent import edge cases
* fix(vault): retry rollback and enable tree keyboard selection
* fix(vault): retain concurrent sources and visible selections
* fix(vault): merge imported sources with persisted state
* fix(vault): serialize duplicate managed imports
* fix(vault): keep imports non-blocking and grouped views responsive
* fix(vault): preserve concurrent managed sessions
* fix(vault): preserve concurrent groups and keyboard access
* fix(vault): serialize cross-window import commits
* fix(vault): make import commits atomic
* fix(vault): surface import rollback failures
* fix(vault): recover import transactions safely
* fix(vault): commit imported hosts atomically
* fix(vault): preserve unfinished import recovery
* fix(vault): wait for edits and preserve keyboard focus
* fix(vault): protect group settings and lock fallback
* fix(vault): keep virtual focus aligned
* fix(vault): complete keyboard navigation semantics
* fix(vault): finish keyboard navigation
* fix(vault): close large-vault concurrency gaps
* fix(vault): finish large-vault interaction safety
* fix(vault): harden filtered large-vault flows
* fix(vault): keep managed deletion atomic
* fix(vault): coordinate managed file deletion
* fix(vault): close cross-window managed races
* fix(vault): refresh persisted managed state
* fix(vault): preserve distinct imported sessions
* fix(vault): keep failed progress accurate
* fix(vault): keep search tree collapsible
* fix(vault): close final review gaps
* fix(vault): reveal filtered tree matches
* fix(vault): close final review edge cases
* fix(vault): preserve concurrent import changes
* fix(vault): serialize all vault saves under one cross-window lock
Hold the shared import lock for ordinary host/group/key writes and the
full import commit path so check-then-write can no longer interleave
across windows. Make the lock re-entrant in-window to avoid nested
deadlocks, and announce large tree item positions for screen readers.
* fix(vault): keep concurrent saves serialized and fix tree ARIA siblings
Stop treating same-window concurrent work as nested lock re-entry; nested
helpers skip re-acquire only when the outer critical section already owns
the lock. Announce treeitem position among true siblings at each level.
* fix(vault): require explicit lock handle for nested saves
Independent concurrent vault writes always queue on the shared lock.
Nested import/deletion helpers continue only when they pass the active
lock handle from their outer critical section.
* fix(vault): avoid lock deadlocks with encrypt-then-write saves
Encrypt outside the shared lock and only acquire it for the final write so
importers waiting on pending work cannot deadlock on lock acquisition.
Retry plugin commits outside the lock when concurrent edits intervene, and
rebase imports onto in-memory host edits when disk is still stale.
* fix(vault): release import lock before concurrent-edit retries
Drain encrypt work under the lock and full disk writes only outside it.
When an import or group deletion is superseded by a concurrent edit, release
the shared lock so that edit can finish, then retry. Functional group updates
now base on the latest in-memory snapshot while a write is still pending.
* fix(vault): tidy import dialog destination and SecureCRT prompts
Move import destination settings behind a bottom-left control with its own
step, and keep SecureCRT guidance in a dedicated chooser instead of inside
the format tile.
* test(vault): fix import dialog layout guard test under ESM
* fix(vault): simplify import destination footer control
Replace the heavy two-line destination card with a single quiet text link
that shows the current placement choice.
* fix(vault): simplify import destination settings page
Drop the nested card and duplicate headings. Show only the three placement
choices, finish immediately for preserve, and keep Done only when a group
name is needed.
* fix(vault): simplify SecureCRT chooser and iconify destination options
Remove redundant SecureCRT prompt copy while keeping the two source cards
with icons. Add small folder icons to the import-location choices so that
page is less plain.
* fix(vault): use SecureCRT logo in import chooser header
* fix(vault): drop border around SecureCRT import logo
* fix(vault): clarify import location footer with icon and label
Show a folder icon plus "Import location · current choice" so the control
is recognizable without becoming a heavy card again.
* fix(vault): remove border from import progress status icon
* fix(terminal): keep Enter reconnect working after disconnect
Disconnected sessions advertised "Press Enter to reconnect" but often
swallowed the key when focus left xterm (body blur or dialog controls),
and an open terminal search bar globally hid the hint and disabled the
shortcut. Give the disconnected overlay a focus sink + local Enter
handler, and stop treating search-open as a global reconnect gate while
still leaving real buttons/inputs alone.
Closes#2544Closes#2546
* fix(terminal): stop disconnected dialog focus theft
Only claim Enter-reconnect focus when it is already lost or still inside
this session tree, and restore xterm focus when the overlay unmounts.
Avoid stealing focus from other panes/side panels on disconnect.
* fix(terminal): restore dialog focus only when overlay leaves
Split claim/restore effects so showLogs/error rerenders no longer
yank focus off dialog buttons onto xterm mid-interaction.
* fix(terminal): restore Enter-reconnect focus in popup terminals
Popup Terminal windows lack data-session-id ancestors. Walk up from
the dialog to the local xterm root so claim/restore still work there.
* fix: address Codex review on PR #2550
* fix: address Codex review on PR #2550
* fix: address Codex review on PR #2550
* fix: address Codex review on PR #2550
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
- Remove sdkRequestRuntimes entries on chat session teardown to prevent
stale runtime references accumulating across sessions.
- Cancel pending elications (resolve with deny) when the owning chat
session closes, so elicitations never hang indefinitely.
- Use crypto.randomUUID() as fallback elicitation id when the SDK does
not provide one, avoiding collisions on empty-string keys.
- Surface interrupt failures via console.debug for easier diagnostics
without changing best-effort stop behavior.
Behavior preserved:
- Session key fingerprinting (config-based reuse) unchanged.
- Stop/interrupt flow: signal-first, then queryRef.interrupt().
- Permission mode routing (auto/confirm/observer) unchanged.
- Stream handler event protocol and dedup logic unchanged.
- Upgrade @tencent-ai/agent-sdk to 0.3.230 (elicitation support)
- Add CodebuddyElicitationCard with schema-driven form fields and
accept/decline/cancel actions; wire full event chain from driver
through shared elicitation store to ChatMessageList
- Pass agents/thinking/effort to V2 SessionOptions instead of forcing
query() fallback; include them in the session fingerprint
- Close stale V2 session before query() fallback to prevent context
divergence when resuming the same persisted conversation
- Forward codebuddyOptions from renderer config through IPC to the
main-process driver context
- Add i18n strings (en/ru/zh-CN/zh-TW) and test coverage
- Fix test process hang: stale-session test no longer triggers real SDK
import which spawned a live CodeBuddy backend and prevented exit
- Fix plugin management API: remove non-existent removePlugin, correct
enablePlugin/disablePlugin second param to marketplace string
- Wire elicitation handler in production path via session manager's
pending map; expose elicitation-response IPC to renderer
- Skip V2 Session when query-only options are configured (maxBudgetUsd,
sandbox, fallbackModel, enableFileCheckpointing, agents, outputFormat,
effort, thinking) so settings are not silently ignored
- Expose plugin/mcp-status/account-info IPC channels in preload + types
- Add renderer handling for hook, elicitation-create/complete events
OpenSSH keeps the first HostName value. Setting HostName to the jump
alias under the forced -F session config blocked later Include of
~/.ssh/config from resolving HostName aliases, and could diverge from
the vault snapshot built via ssh -G against the real config.
Drop the process-lifetime ssh -G cache so HostName/HostKeyAlias and
known_hosts path edits are observed on the next connect. Keep a
per-prepare Map only so target and jump discovery in one session can
share probes.
Reset Host context with Match all so Included user/system ssh_config
applies to every hop, not only the trailing jump Host stanza. Prepend
the ssh -F wrapper onto the session PATH from options.env so custom
ProxyCommand helpers remain available.
-F replaces both the per-user and system-wide ssh_config. Append
Include directives for the real ~/.ssh/config and system ssh_config
after session Host blocks so HostName aliases and other user settings
still apply while session ProxyJump/vault overrides keep first-match
priority.
Avoid removing the current target's system known_hosts entry when the
vault only contains unrelated pins, so strict ET stats probes keep
working for already-trusted hosts.
When rewriting vault pins under a resolved HostName, retain
[host]:port encoding for non-default ports so OpenSSH lookup finds the
vault key. HostKeyAlias continues to use the bare default-port form.
OpenSSH ignores $HOME for user config. When ET generates a private
config for ProxyJump and jump host-key policy, put a PATH-fronted ssh
wrapper that always passes -F so interactive ET and follow-up probes
both honor the vault-authoritative Host stanzas.
When the connection target is an SSH-config alias, OpenSSH records and
looks up host keys under the resolved HostName. Rewrite the vault pin
and filter selectors accordingly so accept-new cannot ignore the vault.
OpenSSH ignores $HOME for user config on POSIX, so pass -F to
execOnEtSession so ProxyJump host-key policy is actually loaded. Cache
real ssh -G probes briefly to limit main-process blocking.
Disable KnownHostsCommand when enforcing vault authority so dynamic trust
cannot override vault pins. Rewrite multi-host known_hosts lines instead
of dropping them so unpinned hop patterns remain trusted.
ET --ssh-option applies only to the destination hop. Keep vault-authoritative
UserKnownHostsFile and StrictHostKeyChecking in the ProxyJump Host stanza so
the separate jump OpenSSH process still enforces key verification.
Apply vault-authoritative known_hosts through --ssh-option so OpenSSH
enforces it even when a temp-HOME Host config is not read. Reject
fingerprint-only publicKey tokens when building vault pins.
Write vault pins under the effective HostKeyAlias when present, filter
system entries for both alias and hostname, and invoke ssh -G with -p/-l
so %p/%r known_hosts path tokens expand correctly.
Build separate authoritative known_hosts files for target and jump hops
using each hop's hostname for ssh -G discovery. Reuse the same vault
authority builder for requireTrustedHost exec probes so system pins
cannot override vault keys on stats/shell follow-ups.
Apply vault-authoritative known_hosts only on hops the vault pins, so
unpinned ET jump/target hops keep the persistent user known_hosts.
Also merge ssh -G UserKnownHostsFile paths and preserve spaced path
names when discovering configured trust files.
Discover administrator-configured global known_hosts paths via ssh -G
when building the vault-authoritative snapshot, so replacing
GlobalKnownHostsFile does not drop custom admin pins or revocations.
Evaluate OpenSSH positive/negative host patterns when filtering system
known_hosts so vault-covered hosts do not drop jump-host pins that use
negation. For ET follow-up ssh, do not prepend accept-new when the
session already set StrictHostKeyChecking (including verifyHostKeys=no).
Only switch to a session known_hosts snapshot when the vault pins the
active target or jump host, so ET accept-new still persists first-seen
keys otherwise. Filter OpenSSH wildcard patterns covering vault hosts
and keep @revoked markers so admin revocations remain authoritative.
OpenSSH accepts a match from any known_hosts source, so a rotated system
pin could override a vault pin. Build an authoritative snapshot that
keeps vault keys exclusive for vault-covered hosts, force Mosh
StrictHostKeyChecking=ask, and quote trust-file paths that contain
whitespace.
Prefer waking the terminal runtime so executor encoding (including
bracketed-paste mode checks) is used, instead of inventing paste markers
on a blind backend fallback path.
Preserve OpenSSH default global known_hosts when injecting vault pins by
merging both into a single GlobalKnownHostsFile. When verifyHostKeys is
off, neutralize UserKnownHostsFile and GlobalKnownHostsFile with an empty
file so StrictHostKeyChecking=no cannot still block password auth against
a stale pin.
When multi-tab fan-out falls back to a direct backend write (hibernated
pane), wrap multi-line paste/noAutoRun payloads so newlines do not submit
as Enter.
Mosh and Eternal Terminal bootstrap via system OpenSSH, so Netcatty vault
known_hosts were ignored and a key rotated after a prior SSH connect could
still be accepted. Inject usable vault entries as GlobalKnownHostsFile and
honor verifyHostKeys=false so key-change interception matches SSH trust.
Closes#2501
Skip terminal focus steal during multi-tab snippet fan-out and restore the
original pane afterward. Trap Tab focus inside the quick-add drawer and
restore the opener element on close.
Restore modal dialog contract for quick-add (role/data-state/escape),
harden package path validation, skip sensitive sessions on multi-tab
snippet sends, and show a single run-on-all-tabs action for plain snippets.
Address #2502: bind shortkeys when quick-adding snippets, add package
creation via a split + menu, convert quick-add to a right-side drawer,
and let code snippets run on all workspace tabs from the context menu.
Capture tabId/connectionId at paste time and resolve external folder/entry
uploads against that pane after awaits so mid-transfer tab switches cannot
retarget remaining multi-folder items to another host. Prefer the pinned
pane host when reconnecting and reconnect by tab id without clobbering the
active tab's lastConnectedHost.
PR #2509's TransferRuntime unify accidentally regressed per-task external
upload cancel (#2495), clipboard confirm close-before-upload (#2478), and
main SftpView interactive browse sessions (#2498). Restore those behaviors
on top of the process-level control plane, keep Pausing copy, and gate
broadcastGlobalTransferEvent so bare Node unit tests do not download Electron.
When Observer → Confirm/Auto → Observer, drop the inactive ask/agent
in-memory session so switch-back cannot resume a stale thread and skip
the intervening conversation history.
Update Settings copy to use `cursor-agent login` and note that a saved API
key is retained while CLI login mode is active.
Co-authored-by: Cursor <cursoragent@cursor.com>
Re-apply the stored key explicitly when toggling CLI login and API Key so
mode switches cannot drop a previously saved credential.
Co-authored-by: Cursor <cursoragent@cursor.com>
Stop falling back to bare `agent` on PATH so other CLIs (for example Grok)
cannot be mistaken for Cursor during auth probes, model presets, or turns.
Co-authored-by: Cursor <cursoragent@cursor.com>
Skip duplicate stream-json assistant flushes that include model_call_id, and
isolate Cursor CLI resume sessions by ask vs agent so switching Observer to
Confirm/Auto starts a writable turn instead of keeping Ask.
Only automation bot PRs re-check source-issue pending comments before
mark-ready, so maintainer Fixes-only PRs are not stuck draft. Write
WebSearch/WebFetch denials after the isolated research pass so classify
and follow-up research can still call those tools.
Pause and resume now go through one process-level control plane that survives
panel/terminal close: TransferRuntime + soft latches/epochs/walk registry,
soft-then-hard resume, dual-epoch-safe progress, and no-owner soft control.
Load @xterm/addon-image in the shared xterm runtime so remote programs can
draw real raster images (kitten icat, chafa --format kitty, image previews
in file managers and TUIs) instead of ANSI approximations.
- domain/terminalInlineImages.ts owns the limits and turns TerminalSettings
into addon options; disabled settings resolve to null so the addon is not
loaded at all and the terminal keeps advertising no graphics capability.
- The addon is loaded right after term.open, before the WebGL renderer, so it
patches IRenderService.setRenderer first and its canvas layers survive every
DOM <-> WebGL swap (deferred WebGL, soft-hide suspend, context-loss rebuild).
It is disposed before term.dispose so bitmaps never outlive their terminal.
- Hibernate restores a tab from a text-only snapshot, which cannot carry image
data. XTermRuntime.hasInlineImages reads the live image cache, and Terminal
degrades such a session to soft-hide: hibernateRuntime takes the soft-hide
branch, canFinishHibernate re-checks after every async step, and an eviction
request leaves the session soft-hidden. The block lifts by itself once the
cache is emptied by a terminal reset or FIFO eviction.
- Settings > Terminal > Inline Images exposes the master switch, per-protocol
switches (Kitty / SIXEL / iTerm IIP) and the memory limits, translated for
en, zh-CN, zh-TW and ru. Protocol switches cloud-sync; the memory limits stay
local like the other per-device renderer tuning.
Co-authored-by: Wine Fox <fox@ling.plus>
Issue titles and bodies are auto-validated; agents reading only AGENTS.md or
CLAUDE.md were missing the [Bug]/[Feature]/[Other] prefix and template
requirements. Point all three guides at the shared .github templates.
Closes#2492
When scanning the system known_hosts file or importing from a file,
exclude well-known public service hostnames (github.com, gitlab.com,
bitbucket.org, Azure DevOps) from being added to the Known Hosts vault.
These entries represent third-party services rather than user-managed
hosts and are not meaningful in an SSH host management context.
- Add PUBLIC_SERVICE_HOSTNAMES exclusion list
- Apply filter in both system scan and file import paths
- Show a toast notification when entries are filtered
- Add locale strings for filtered count (en, zh-CN, zh-TW, ru)
Make folder pause latch-first with barriers and a child pause watchdog so
workers stop claiming files after soft-drain; soft-resume live walks instead
of full rewalks. Surface path conflicts with toasts, keep pause progress
visible, and show a resume spinner. Restore verified shell rm -rf with SFTP
confirmation for fast directory delete, and prefer reconnect over wiping the
pane to the host picker when listing fails on some hosts.
Do not paint transferring when every backend resume misses after restart.
Refuse starting or resuming a second job with the same source and target
while another is still active, matching FileZilla-style single-writer
destination handling.
Track UploadController instances per transfer task so queue cancel of one
external upload does not abort another concurrent paste/drop upload.
Scope pending conflict prompts to the owning controller as well.
SFTP queue pause/resume/cancel now call sftpTransferCenterStore (same as the
global transfer center), harden action-button pointer handling, retry
"cannot be paused yet", and keep progress updates from undoing a paused row.
Paint paused optimistically, stop counting paused rows as "active", freeze
visible progress while paused, and soft-drain concurrent pause in ~50ms
without long writeStream waits on the contiguous-range path.
* fix(sftp): close clipboard upload dialog before transfer
Clear the confirmation request before awaiting the upload so the modal
overlay no longer blocks side-panel and standalone SFTP during large
clipboard transfers (issue #2478). Keep the existing background transfer
path and post-upload refresh; guard double-clicks and skip refresh on
transfer failure.
* fix(sftp): scope clipboard confirm guard to request identity
Only block double-clicks on the same confirmation request so a later paste
can still Upload while an earlier background transfer is in flight.
Prefer contiguous bridge checkpointBytes over high-water transferred for
resume offsets, read remote modifyTime for meta pause identity, clear
deferredSparseTruncate on failed pause unpause, and forward fingerprint
fields through drag-drop upload progress.
Wait for in-flight concurrent ranges on resume with a deadline and cancel
checks so stalled SFTP requests cannot hang Resume forever. Propagate
sourceFingerprint through external-upload progress updates.
Embed self-hosted light/dark star history charts after api.star-history.com
stopped serving public embeds, and add a weekly workflow that refreshes them
via RELEASE_TOKEN.
Confirm pause only after a cheap size+mtime source identity is recorded
and published for transfer-center persistence. Wait for in-flight
concurrent ranges before sparse-tail truncation on resume, and refuse
truncate after cancel during that wait.
Pause felt stuck because the panel hid the pausing state, and the
backend waited for every in-flight range plus a full source fingerprint
hash. Soft-drain concurrent ranges, skip blocking fingerprint work, and
show clear pausing feedback in the panel and transfer center.
Raise UPLOAD_TRANSFER_CONCURRENCY from 32 to 64 so the default in-flight
window is ~2MiB, matching Electerm transfer.js / ssh2-style defaults while
keeping the safe 32KiB chunk size.
Remove the unused uploadFileResumableFast alias and the always-null
activeSftpUploads.stream field from the buffer-upload cancel path after
serial WriteStream crawl was fail-closed for #2449.
On promoteLocalTransfer failure after publish, only unlink/restore when the
target still matches the published ready identity. Concurrent post-publish
replacements leave the concurrent file and backup intact.
Do not publish a staged local download over a concurrent file that appears
at the target path after the original was moved to backup. Leave the
concurrent target in place and retain the backup for recovery.
Always content-hash remote destinations before staged promotion (even when
ino/fileId is stable), pass AbortSignal through destination hashing so cancel
closes read streams, and revalidate local download backups before publish.
* fix(sftp): raise upload WRITE fanout for higher throughput
Increase UPLOAD_TRANSFER_CONCURRENCY from 8 to 32 so resumable and
fastPut uploads keep ~1MB in flight (32 × 32KB). Keeps the safe 32KB
packet size from #2022 while closing most of the gap with ssh2/Electerm
defaults on multi-ms RTT paths (#2449).
* fix(sftp): never fall straight into serial WriteStream uploads
Serial ssh2 WriteStream/put is RTT-bound (one 32KB WRITE at a time) and
is the usual cause of sub-MB/s speeds, not the fanout setting alone.
- Prefer concurrent WRITE ranges on an isolated channel, then fastPut,
then concurrent ranges on the shared browse channel; serial stream is
last resort only.
- Do not swallow post-upload size/content verification into fallback.
- uploadLocal and memory-buffer progress uploads use fastPut with the
configured fanout instead of serial put.
- Add a regression test that sudo/shared sessions stay pipelined.
* fix(sftp): fail closed instead of serial WriteStream fallback
Align with OpenSSH/Electerm/WinSCP: default SFTP uploads stay on
pipelined WRITE strategies only. When concurrent isolated, fastPut,
and concurrent-shared all fail, throw the last error — do not crawl via
serial createWriteStream/put (RTT-bound, #2449).
uploadLocal and writeSftpBinaryWithProgress require fastPut; no silent
serial put path. Tests assert createWriteStream is never invoked on
forced concurrent failure.
* fix(sftp): restore pipelined upload on session-backed clients
Session-backed SFTP clients (openForSession / terminal reuse) are not
ssh2-sftp-client instances and lacked client.fastPut after serial put
was removed. Expose fastPut via the raw channel and route uploadLocal /
writeSftpBinaryWithProgress through pipelinedUploadLocalFile so
session-backed paths keep concurrency fanout.
* fix(sftp): make pipelined fastPut abortable and throttle progress
Address codex review on the upload fanout PR:
- Prefer a disposable SFTP channel for cancelable uploads so
cancelSftpUpload / AbortSignal can end the transfer immediately.
- Honor abort signals for session-backed fastPut instead of ignoring
them after the call starts.
- Restore 100ms / 1MB progress throttling for binary-with-progress
fastPut step callbacks.
* fix(sftp): wait for shared-channel fastPut to settle on abort
When abort uses a non-disposable browse/sudo SFTP channel, do not reject
until fastPut's callback fires so temp/staged cleanup cannot race
in-flight WRITEs. Disposable channels still end immediately.
* fix(sftp): harden fastPut abort, channel errors, and pause ads
Codex re-review fixes:
- Attach SFTP channel error listeners during fastPut to avoid unhandled
EventEmitter crashes on disposable channels.
- Wait for fastPut callback (with short force timeout) after disposable
channel abort so temp files are not unlinked while still open.
- Mark pause unsupported during transferBridge fastPut fallback; restore
pause ads for concurrent-shared.
- Create AbortController before staging ArrayBuffer to disk and pass
signal to writeFile.
* fix(sftp): settle fastPut after errors and verify fastPut content
Codex P2 follow-ups:
- Channel errors during fastPut wait for the callback or a short force
timeout before settling (same pattern as cancel) so temp files are not
unlinked while still open.
- transferBridge uploadViaFastPut uses the same settle discipline so
fallback strategies do not overlap a still-running isolated fastPut.
- Resumable fastPut fallback captures and rechecks a local content
fingerprint before promoting success.
* fix(sftp): reset fastPut checkpoint and verify staged size
Codex re-review:
- After isolated fastPut fails, reset checkpointBytes so concurrent-shared
does not resume past non-contiguous progress holes.
- Rethrow noTransferFallback/sourceChanged after fastPut fingerprint check.
- uploadLocal verifies staged remote size against local before rename.
* fix(sftp): avoid hang on cancelled close and unsafe fastPut checkpoints
- Skip/timeout remote CLOSE after disposable channel abort/failure so
concurrent upload finally does not hang waiting on a dead channel.
- fastPut progress updates UI without advancing durable checkpointBytes
(non-contiguous chunk progress is not crash-safe resume state).
* fix(sftp): address remaining remote Codex review notes
- Fall back to the shared browse SFTP channel when opening a disposable
upload channel fails (MaxSessions / subsystem refused), unless aborted.
- Force-settle concurrent range uploads after cancel if in-flight WRITEs
stall on a non-disposable shared channel (2s grace).
* fix(sftp): bound shared-channel fastPut cancel with force-settle
Shared browse/sudo channels cannot call sftp.end() on abort without
killing the session, but a stalled fastPut callback must still settle.
Schedule the same 2s force-finish used for disposable channels, and
cover it with a stall test that asserts the shared channel is not ended.
* fix(sftp): force-settle shared-channel fastPut on channel error
Shared browse/sudo channels cannot be ended on error, but a stalled
fastPut callback after an error event still must not hang forever.
Schedule the same 2s force-finish for shared-channel errors without
calling sftp.end(), and cover it with a stall regression test.
* fix(sftp): stage binary uploads and cleanup shared-channel cancel
writeSftpBinaryWithProgress now uploads to a remote .part path and
renames into place, so a stalled shared-channel fastPut cannot keep
mutating the final destination after cancel returns. Shared-channel
force-settle also best-effort unlinks the in-progress remote target
without ending the browse/sudo session.
* fix(sftp): harden staged upload replace semantics
Default to stage+rename for cancel-safe finals, but:
- write symlinks in-place so the link node is not replaced
- restore previous mode bits after rename overwrite
- fall back to in-place when creating a .part is permission-denied
Covers mode restore, symlink, and parent-dir permission regressions.
* fix(sftp): encode after staging names; never unlink finals
- Build stage/backup names from the logical path, then encode (GB18030-safe)
- Existing files/symlinks write in-place to preserve inode/metadata
- Shared-channel force-settle only unlinks .netcatty-upload-*.part paths
* fix(sftp): keep AbortSignal aborted in dispose cancel handler
When cancel replaces transferControl.abort for a disposable channel,
also abort the AbortController so staged rename/promotion cannot
complete after the UI has already cancelled the upload.
* fix(sftp): stage regular overwrites; throttle fastPut progress
Regular files always stage+rename (cancel cannot mutate finals on shared
channels) and restore mode after promotion. Symlinks stay in-place.
Clip stage/backup basenames to NAME_MAX and stop forcing every fastPut
step progress event through IPC.
* fix(sftp): tighten staging plan and permission fallback
- Without native lstat, existing paths write in-place to avoid clobbering links
- Permission fallback uses SFTP/error codes only (not message substrings)
- Cover size-mismatch paths whose names contain words like "access"
* fix: address Codex review on PR #2452
* fix(sftp): write SCP uploads through existing symlinks in-place
SCP stage+rename was replacing the symlink node itself. Detect symlink
destinations first and upload through them so the link target is updated.
* fix(sftp): drain shared writes before cleanup
* fix(sftp): track generated upload stages explicitly
* fix(sftp): preserve upload recovery paths
---------
Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
- Format recovery dispatches triage before clearing invalid-format
- Shared CJK-friendly title rules; codex label terminal state machine
- Research steps in classify; agent TITLE + PR body for bot PRs
- Single @codex review via CODEX_REQUEST_GITHUB_TOKEN (binaricat)
Use TRIAGE_GITHUB_TOKEN for Codex review loop jobs. Treat convert-to-draft
and mark-ready permission errors, and closed PRs, as warnings so @codex
still runs instead of failing the whole automation job.
Public issue comments no longer show a generated-by line. Grounding stays
in code_findings/reasoning only so reply can use UI language without file
paths, symbols, or dense parentheses. Classify prompt and rewrite templates
match that tone.
Use the bot PAT for classify prepare/apply and implement needs-human
comments so issue activity shows netcatty-bot instead of github-actions.
Treat netcatty-bot as an own actor for automation PR loops.
* fix(ci): stop Cursor issue triage crashing on Search pagination
Octokit normalizes Search API pages so response.data is already the items
array. Mapping response.data.items returned undefined and then crashed on
candidate.user during daily-limit admission — so every valid new issue
failed before Cursor classify could run.
* fix(ci): classify already-available issues with how-to and auto-close
Add an already_available triage category for requests the product already
ships: after code-grounded inspection, reply with the concrete UI entry
path, then close as completed. Low confidence falls back to other instead
of closing. Keeps the Search pagination fix so new issues can classify.
* fix SFTP transfer throughput regression
* fix: address Codex review on PR #2429
* fix resumable transfer review findings
* fix remaining resumable transfer review findings
* fix: address Codex review on PR #2429
* fix(sftp): harden resumable range fallback and channel cleanup
Truncate staged sparse tails to the contiguous checkpoint before stream
fallback or pause, always release isolated download channels on cancel and
failed fast paths, and stabilize concurrency unit tests.
* fix(sftp): abort range transfers on isolated channel errors
Attach a temporary SFTP error listener during concurrent range copies so
channel resets reject cleanly instead of crashing main, and force-publish
the contiguous checkpoint when pausing.
* fix(sftp): never truncate S2S temp source on upload fallback
stagedLocalPath during SFTP→SFTP upload is the fully-downloaded temp
source, not a partial target. Only truncate partial download/local
targets and remote .part staging files.
* fix(sftp): truncate direct-download sparse tails on range fallback
Direct SFTP→local resumable transfers keep resumeStage "direct" and never
copied targetType onto the transfer object, so prepareStreamFallback skipped
truncating the staged .part after out-of-order range failure. A later stream
pause could then stat the oversized sparse file and advance past holes.
Treat any staged local path outside the S2S upload phase as a partial target,
persist target metadata on the transfer, and fix the sparse-tail test to assert
against the real staged path.
* fix(sftp): always end isolated upload channel on open failures
uploadFileResumableFast assumed callers only saw throws after the isolated
channel was already ended, but a failed local fs.open left the channel open
while the catch path cleared fastSftp without disposing it. End the channel
in a single finally covering local open, remote open, and range transfer.
* test(sftp): stabilize local-open channel cleanup regression
Make the missing-source upload case delete the file only after the isolated
channel opens, and keep stream-fallback errors handled so the suite asserts
channel disposal without unhandled stream ENOENTs.
* fix resumable transfer fallback safety
* fix(sftp): allow cancel while resumable OPEN is in flight
Install transfer.abort before awaiting local/remote handles so cancel ends
the isolated channel if the server stalls SFTP OPEN. Covers upload and
download fast paths, with a regression test for stalled upload OPEN.
* fix(sftp): detect same-size source rewrites via content samples
Metadata-only checks can miss in-place rewrites when mtime/ctime do not
advance. Sample SHA-256 digests through the open local handle before range
upload and re-check after, and do the same path-level check for stream
fallback. Harden the regression test by freezing utimes after rewrite.
---------
Co-authored-by: netcatty-cursor-bot <41898282+github-actions[bot]@users.noreply.github.com>
Classification must open real source files first. The prompt mandates
search→read→classify, JSON now requires code_paths/code_findings, and
normalizeClassification rejects ungrounded replies so agents cannot answer
from issue text alone.
Cursor's --sandbox enabled fails on ubuntu-latest due to AppArmor, so classify
and implement jobs never ran. Use --sandbox disabled and keep secret isolation
via token stripping, frozen helpers, and post-run scans.
Isolate publish onto fresh runners, harden Codex loop head scoping,
protect fork bootstrapping, and polish classification replies and
mark-ready error handling after local codex review.
Route checked out main for trusted helpers, but scripts/cursor-automation.cjs
only exists on this PR until merge, so require() failed with MODULE_NOT_FOUND.
Fetch the PR head helper when the default branch does not have it yet.
The SFTP transfer center trigger was missing the shared
--top-tabs-muted color used by adjacent utility buttons, so it
rendered as pure foreground white.
Tighten re-triage, Codex single-flight signals, protected-path checks on
commit ranges, trusted helper loading from RUNNER_TEMP, and failure
handling so own/bot loops stay safe and forks only re-@codex.
Add missing Terminal snapshot-effect deps, drop unused cursorAuthMode
deps in SettingsAITab, and remove dead test imports/state so dev lint
starts clean.
Drop Cursor CLI review for third-party/fork PRs. Initial Codex review
stays with the existing connector; after contributor synchronize we only
comment @codex review (deduped per head SHA).
Wire GitHub Actions to classify and implement issues via Cursor CLI,
open draft PRs, request @codex review for own/bot PRs, fix findings,
and only post read-only review comments on third-party PRs.
Cancel wind-down can leave child transferIds latched when they are not in
activeTransfers; clearPendingTransferCancel before reusing those ids so
startStreamTransfer does not abort immediately. Regression test models the
sticky latch.
Soft-unpause only live streams; directory dedicated pause winds down then
startFresh. Resume replace-mode under stagedTargetPath and promote on full
success. Refuse pre-stream pause, force R2R progress without corrupting stage
offsets, and cover the directory pause-resume path with a regression test.
Urgent interrupt bypasses xterm's native scrollOnUserInput. Treat Ctrl+C
as scroll-on-input so interrupting a scrolled-up stream (e.g. tail logs)
returns the viewport to the bottom when that setting is enabled.
Keep browse sessions independent of pool transfers, complete dedicated resume
for files/folders after restart, roll back partial pause safely, clamp crash
checkpoints to durable .part size, and open upload targets by connecting the
host when no terminal tab is active.
Seed erase-scrollback with open sync-block state from prior chunks so a
split H/2J redraw that returns to the live bottom does not append CSI 3 J
and wipe history (Codex review on #2415).
Keep cursor-home and strip only erase-display while reading scrollback,
and ignore 1-row sticky lag so agent TUI frames cannot append under the
previous frame (#2291).
* feat(ai): support Cursor CLI login for subscription quota
Allow the managed Cursor agent to authenticate via local `agent` CLI
login as an alternative to CURSOR_API_KEY, so Catty can use subscription
Auto quota. Keep API key and CLI login mutually exclusive, isolate
resume sessions by auth mode, and expose selectable CLI models with
auto as the default.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ai): harden Cursor CLI login path after review
Address multi-agent review findings: soft-cancel abort without late
stream errors, prefer cursor-agent over ambiguous agent binaries,
mode-aware availability without wiping API keys or sticky-disabling,
and concurrent MCP merge refcount restore. Add unit coverage for the
new contracts.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(terminal): batch hidden log output
* fix(terminal): preserve ordered hidden output
* fix(terminal): bound hidden output overhead
* fix(terminal): respect custom tab stops in timestamps
* fix(terminal): preserve terminal parser state
* fix(terminal): preserve hidden output boundaries
* fix(terminal): retain batching with prompt formatting
* fix(terminal): preserve prompt boundaries through transforms
* fix(terminal): handle unbatched prompt output
* fix(terminal): preserve batched prompt and time boundaries
* fix(terminal): retain background timestamp boundaries
* fix(terminal): preserve visible timestamp boundaries
* fix(terminal): separate shell output from tui frames
* fix(terminal): separate output after tui exit
* fix(terminal): preserve prompts across output slices
* fix(terminal): flush output before context reads
* fix(terminal): time-slice timestamp marker cleanup
* fix(terminal): preserve prompt columns after bare LF
* fix(terminal): preserve background write yielding
* fix(terminal): retain yields across timestamp boundaries
* perf(terminal): scan output boundaries once
* fix(terminal): track prompt cursor movement
* fix(terminal): resume prompt scan after resets
* fix(terminal): preserve stateful prompt ordering
* fix(terminal): drain close output before capture
* fix(terminal): measure control-only prompt prefixes
* fix(terminal): preserve prompt control boundaries
* fix(terminal): preserve prompt mode toggles
* fix(terminal): bound hidden batches and unfocus policy
Always drain write-coalescer size caps even when scheduled frames are gated,
keep unfocused-but-visible panes on throttled batching instead of per-chunk
force flush, compute prompt starts on post-transform display data, and model
full-width wrap so prompt-on-newline does not insert a blank line.
* perf(terminal): skip off-path timestamps and share alt-screen probes
When host line timestamps are disabled, write plain bytes without the
segmenter/marker hot path. Reuse one alt-screen CSI probe per coalesced
chunk for frame split and schedule mode, and reuse a single full-batch
visual-row measure on the single-segment batched timestamp path.
* fix(terminal): read line-timestamp enable from live hostRef
Session data handlers close over boot-time ctx.host, so toolbar/vault
toggles of showLineTimestamps were ignored. Prefer hostRef.current for
the marker hot-path gate and keep hostRef synced on every Terminal render.
* perf(terminal): per-second timestamp ledger while gutter is off
When line timestamps are hidden, keep a lightweight one-stamp-per-second
ledger without xterm markers. Opening the gutter materializes recent
ledger entries into markers for paint; while visible, keep per-line
markers for accuracy.
* perf(terminal): separate timestamp record from gutter paint
Always record a one-stamp-per-second ledger on the write path with no
xterm markers. Gutter rendering maps the ledger to visible rows, so open
and closed modes share the same cheap record path.
* fix(terminal): fill gutter gaps with previous second stamp
When painting line timestamps from the per-second ledger, blank rows
between stamps inherit the preceding stamp's label so multi-line output
in the same second is fully labeled.
* fix(terminal): stop empty gutter paint and false scrollback rebase
Only rebase ledger anchors when the buffer is actually full and baseY
grows from top trim — not when baseY rises while the buffer is still
growing (which deleted MOTD/login stamps on scroll). Cap gutter paint at
the last content line so empty viewport rows past the cursor stay blank.
* fix(terminal): soft-wrap stamp placement and sparse reflow anchors
Estimate ledger lines with visual-row measurement so narrow terminals
do not pin the next second on a wrap continuation. After each write,
attach at most one xterm marker per stamped second so reflow and
scrollback trim keep anchors honest without per-line marker storms.
* fix(terminal): ignore alt-screen rows when placing timestamp anchors
Stamp line estimates froze incorrectly through vim/less alt-screen
output, so sparse reflow markers landed far below the restored normal
buffer. Skip visual-row advancement while DEC alt-screen is active,
key one-stamp-per-second from the batch arrival date, and only attach
anchors still present in the ledger after capacity trim.
* fix(terminal): seed stamp lines from normal buffer when already on alt
When a write begins on the alternate screen, active cursor is the TUI
row — freezing that through 1049 leave mis-pinned sparse anchors and
dropped them past normal bufferLength. Seed and restore stamp estimates
from buffer.normal, and cover multi-write already-on-alt leave+prompt.
* fix(terminal): keep same-chunk pre-enter line on alt leave
Leave CSI must not always re-read pre-write buffer.normal: when enter
happened in the same walk, the frozen estimate already includes normal
advances before the TUI. Only restore buffer.normal when the write
started already on the alternate screen.
* fix(terminal): pure alt stamp transitions that never rewind lines
Stamp estimates stay in normal-buffer coordinates: seed once (active or
buffer.normal when already on alt), freeze while alt is active, and on
leave only clear altActive — never re-read the live term mid-walk.
Export applyAltScreenAction with a table-driven unit test covering
spurious leave, plus write-path cases for already-on-alt, same-chunk
pre-enter advance, and leave-without-enter.
Parent resume clears sticky per-child cancelledTasksRef entries so directory
re-walk can retry cancelled files. Route clearPendingCancel to the terminal
worker (where skipAdmission latches live), re-check cancel on live resume,
and clean per-child stage artifacts on parent cancel.
Re-check cancel inside setTransfers so late cancels are not overwritten,
keep partial progress on cancelled directory downloads, and clear the
pre-start cancel latch on intentional resume/retry.
downloadToLocal previously treated cancelled child counts as partial
failure and overwrote the parent to failed. Cancel now wins, matching
processTransfer, with a regression test for the final-status helper.
Keep replace/staging on directory adopt, skip byte size validation for
directory soft-resume, and treat per-child cancel as cancelled without
aborting sibling workers or overwriting status as failed.
Reassign parent+children together on adopt, stop spurious cancelTransfer
after failed dedicated reconnect, and clear pending-cancel when a queued
job is cancelled so same-id resume is not permanently poisoned.
When a directory transfer is re-adopted after restart, pull orphaned child
rows into the new owner so completed checkpoints are honored. Show badge
count/attention for paused and interrupted work after restore.
Server-to-server dedicated soft-fail rehomes via adopt instead of a no-op
resume, Resume/Pause All skip child rows, and orphaned failed tasks remain
controllable with a clean Retry from byte zero.
Server-to-server soft-fail from dedicated resume rehomes ownership so a
live panel can resume; pause during dedicated reconnect no longer cancels
(so quit confirmation does not destroy in-flight resume).
Pause on dedicated reconnect cancels the open, resolveConflict never
resurrects cancelled rows after async duplicate naming, and background
agent restart admits before opening session-backed SFTP handles.
Guard processTransfer against cancel after conflict stats, and make batch
Stop cancel scheduler jobs, release pause waiters, sync refs, and clean
artifacts like single-task cancel.
When the user stops a conflict batch, cancel every non-terminal sibling
(including attention conflict rows) so they do not remain stuck without
resolve UI or resume.
No-op pause on conflict rows, keep transfer/conflict refs in sync on cancel,
eagerly clear conflictsRef on resolve to stop double processTransfer, and
surface adoption failures when resolving orphan conflicts.
Keep conflictsRef updated during adopt so global conflict resolution applies
immediately, re-check cancel after adopt, gate replace/merge like the panel
dialog, and ignore dedicated progress while paused/cancelled.
Drop panel-local rows reassigned to dedicated-resume, seed conflicts on
adopt without auto-resume, cancel directory children on orphan cancel,
gate dedicated resume on !conflict, and hide invalid global merge actions.
Exclude conflict-pending transfers from dedicated resume and Resume All so
users cannot overwrite targets without resolving Replace/Skip/Duplicate.
Also skip Pause All on dedicated reconnect spinner rows.
Reassign store ownership to dedicated-resume before reconnect work so
panel publishOwner cannot clobber progress, and open vault SFTP sessions
only after the renderer admission pool grants a slot.
Directory cancel now stops all non-terminal children on the renderer
scheduler, and transfer workers re-check cancel before acquiring pool
leases so cancelled bulk jobs do not open dedicated sessions.
Remember cancels before startTransferNow registers the id, cancel the
renderer scheduler on orphan cancel, avoid pause completion resurrecting
cancelled rows, forward skipAdmission for temp downloads, and persist
progress checkpoints on background events.
Share dedicated resume with the renderer admission pool, preserve queued
pause checkpoints, refuse to resurrect cancelled agent rows, and complete
dedicated resumes that finish after a reconnect-spinner pause.
Settle directory streams on cancel return values, detach idle pool slots
before close, make force hard-close lease-aware, honor skipAdmission on
the worker IPC path, fix MCP non-worker admission, and block dedicated
resume from resurrecting cancelled/paused rows.
Keep soft-close sticky across re-acquire, re-check before hard-close,
holder-aware pool discard, admit-then-lease for uploads, directory/cancel
resume edge cases, MCP skipAdmission, and vault-based reconnect identity.
Add dedicated transfer connections (1–2 per host) so bulk uploads/downloads
no longer block browse sessions. Also cover session leases, resume after
restart, auto-reconnect, skipAdmission, and transfer-center UX fixes for #2396.
* Improve keychain identity layout
* Preserve key search results with identities
* Show keychain search empty state
* Show all matching keychain results
* Restore full keychain key view
- Add computeOptionsFingerprint to detect option changes between turns;
close stale session and create fresh one when model/env/mode/etc change
- Store resolved binPath in sdkRequestRuntimes so steer builds the same
session key as runTurn (fixes steer returning 'unsupported')
- Register abort listener that calls session.interrupt() immediately,
so Stop reaches the CLI even while parked in stream().next()
- Update tests for { session, fingerprint } map structure (35 passing)
* fix(sftp): follow terminal cwd on macOS/BSD remotes and first open
The "follow terminal directory" probe read the interactive shell's cwd
only via /proc, which does not exist on macOS/BSD remotes, so
getSessionPwd fell back to the home directory (or failed) and the SFTP
panel never tracked the terminal. Add an lsof fallback (read_shell_cwd)
so the probe works on non-Linux remotes; Linux keeps using /proc.
Also fix the first open: while the panel is closed the per-command cwd
probe does not run, so activeTerminalCwd can be stale (login home) even
after the terminal cd-ed elsewhere. On that stale value the follow sync
saw currentPath === terminalCwd and did nothing, leaving the panel at
home. Force one fresh backend probe when the panel first becomes visible
for a connected remote, and re-sync on reopen.
Fixes#2335
Co-authored-by: Cursor Agent <cursor-agent@cursor.com>
* fix(sftp): keep first-open follow from snapping back to stale cwd
Addresses PR review: the first-open resync navigated to the freshly
probed terminal cwd but left the stale `activeTerminalCwd` cache (login
home) in place. Because the one-shot ref was already set, a later
dependency change that re-runs the normal follow sync (e.g. closing an
editor toggles hasActiveWork) would navigate the pane back to that stale
home. Mark the stale cached cwd as already handled before navigating so
the normal sync no-ops until the live cwd catches up;
invalidateInFlightFollowSync clears the guard once activeTerminalCwd
actually changes, letting follow resume.
Co-authored-by: Cursor Agent <cursor-agent@cursor.com>
* fix(sftp): re-check follow eligibility before first-open navigation
Addresses PR review: the first-open resync awaited a fresh terminal-cwd
probe but only re-validated the connection afterward. If the panel was
hidden or interactive work started (editor/dialog) while the probe was
in flight, it still navigated, moving the pane while the follow feature's
own visible/work guards say it should be paused.
Add a live followStillEligible() check (generation, follow enabled/
allowed, visible, no active work, same connection) that gates both the
post-probe continuation and the navigateTo call via shouldApply, matching
the normal follow path. Reset the one-shot guard when bailing mid-probe
so the resync can retry once follow is eligible again.
Co-authored-by: Cursor Agent <cursor-agent@cursor.com>
* test(host-details): align auth row assertion with unified row height
The HostDetailsSection row was unified to `flex h-12 ... px-3` (#2378)
but HostDetailsConnectionSections.test still expected the old
`min-h-12 ... px-3 py-2` class, failing lint-and-test on main. Update the
regex to match the shipped markup.
Co-authored-by: Cursor Agent <cursor-agent@cursor.com>
* fix(sftp): harden terminal cwd resync
---------
Co-authored-by: Cursor Agent <cursor-agent@cursor.com>
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(ui): open AI silent sessions in an attach terminal popup
Tray jumps for hidden MCP sessions attach the existing terminal popup
to the live PTY instead of activating a tab-less main-window surface.
Output is rebound to the popup and restored when the popup closes.
* fix(terminal): register rebindOutput handlers under worker mode
Worker-enabled builds returned early from terminalBridge.registerHandlers
without registering rebind/restore IPC, so the first AI silent-session
attach popup always failed with "No handler registered". Register those
handlers in both paths and rebind display routing via terminalWorkerManager.
* fix(terminal): harden AI attach popup for worker mode lifecycle
Address codex review P1s: resume flow control before restoring output,
route exit/events to the rebound renderer, and replay home scrollback
via a snapshot request before rebinding display output.
* fix(terminal): restore attach routing on popup close and dual-notify exit
Hardening for AI observe popups: restore output from BrowserWindow closed
lifecycle (not only React cleanup), keep attach home for exit events so
main/tray lifecycle updates, and resume paused backend flow on attach.
* fix(terminal): resume flow on attach restore and close snapshot gaps
Resume backend output when attach popups are force-closed, fan out
lifecycle exit events to home+display in non-worker mode, and pause
during snapshot→rebind so live bytes are not dropped from the popup.
* fix(terminal): harden attach restore and worker lifecycle edges
Prefer live display for ZMODEM dialogs after rebind, dual-notify worker
crash exits to attach-home, and avoid clearing attach-home when restore
targets a dead renderer.
* fix(terminal): sync observe-popup state home and fan out SSH exits
Push popup serializations home before restore, fall back to hibernate
snapshots, settle briefly after pause for worker handoff, and dual-notify
SSH exits to attach-home owners in non-worker mode.
* fix(terminal): fan out exits for mosh/telnet/et attach owners
Use shared fanout for in-process protocol exits so attach-home and
display renderers both receive netcatty:exit under non-worker mode.
* fix(terminal): restore attach only onto main app windows
Avoid routing silent-session output to settings/prewarm windows when the
original home renderer is gone; fall back only to registered main windows.
* fix(terminal): harden silent session popup handoff
* fix(terminal): close observed popup with session
* fix(terminal): keep observe popup from reconnecting
* fix(terminal): preserve cleared observe snapshots
* fix(terminal): route transfer prompts to observer
* fix(terminal): keep context after observe restore
* feat: fold top-bar utilities into a control panel
Collapse External MCP, window opacity, theme, and cloud sync into one top-bar control panel so the right rail only keeps AI, controls, and settings.
* fix: keep the cloud sync panel and append quick controls
Restore the original detailed cloud sync popover as the host surface, and place External MCP, window opacity, and theme controls in a footer section beneath it.
* fix: split quick controls from the cloud sync panel
Restore the original cloud sync popover and move External MCP, window opacity, and theme into a dedicated quick-controls entry so the two surfaces stay separate.
* fix: simplify quick controls panel chrome
Drop the explanatory subtitle and card-heavy rows so the panel reads as a compact control list.
* fix: separate appearance controls from External MCP
Group window opacity and theme under one appearance section, with a divider from the External MCP switch.
* fix: compact window opacity controls in the quick panel
Replace the tall slider-plus-presets block with a single-row preset selector to free vertical space.
* fix: make window opacity controls expandable
Keep the opacity row compact by default and reveal the slider plus presets only when the row is expanded.
* fix: put appearance controls above External MCP
Reorder the quick controls panel so window opacity and theme sit first, with External MCP below the divider.
* fix: harden quick controls opacity matching and drop dead copy
Compare opacity presets by percent to avoid float mismatch, and remove the unused quick-controls description strings.
* fix: clean quick controls accessibility and dead top-bar opacity code
Move Switch accessible names onto the focusable control, restore popover autofocus, delete the unused window opacity button, and drop obsolete top-bar theme copy.
* fix: tighten quick controls peer-window and switch labeling
Assert showExternalMcpToggle is forwarded into the quick panel, and name the External MCP switch from its visible label only.
* fix: add icon to quick controls panel title
Prefix the panel header with the same sliders icon used by the top-bar entry.
* fix: remove icon from quick controls panel title
Keep the header as plain text after the title icon felt unnecessary.
* feat: add external MCP top bar toggle
* fix: polish external MCP toggle accessibility
* fix: harden External MCP top-bar toggle ownership and status sync
Hide the quick toggle in peer session windows, poll runtime status at the same cadence as settings, and drop an unrelated zh-CN copy change from this branch.
* fix: prevent External MCP top-bar poll from clearing startup state
Wait for main-window startup reconcile before runtime status can turn the shared switch off, and keep peer windows from owning the main-process enable path.
* fix: await External MCP startup enable before top-bar status polling
Mark startup ready only after the async enable/disable reconcile settles so persistent mode is not cleared by a still-disabled runtime.
* fix: scope External MCP startup gate and preserve enable intent
Only main App shells wait on startup reconcile, keep waiters single-flight, re-read storage after await gaps, and avoid clearing always-on preference on start errors.
* fix: ignore stale External MCP startup enable after concurrent toggles
Bump an enable generation on top-bar changes and skip outdated startup apply work so boot reconcile cannot overwrite a newer user toggle.
* test: fix External MCP toggle lint errors in unit coverage
Remove a duplicate import and use globalThis.localStorage in tests so eslint no-restricted-globals passes.
---------
Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
* fix(sftp): preserve active transfers when panel closes
* fix(sftp): preserve completed transfer history after panel close
* fix(sftp): bound retained transfer history lifetime
* fix(sftp): close retained panel cleanup races
* fix(sftp): protect transfer history during panel reopen
Jump hosts reuse the same SSH bridge authentication flow as the target host, but the renderer did not serialize the per-host requiresMfa preference into jumpHosts. A bastion configured to prefer keyboard-interactive was therefore still authenticated with the default password-first order when used in a host chain.
Forward requiresMfa from each resolved chain host into the NetcattyJumpHost payload and extend the startSSH serialization test to cover the flag alongside existing jump host proxy and timeout settings.
The terminal search bar left the previous match decorations on screen
after the input was cleared. Two causes:
- TerminalSearchBar only called onSearch when the term was non-empty, so
clearing the field never notified the search hook.
- handleSearch's empty-term branch returned early without clearing
decorations or resetting the stored term.
Now clearing the input fires onSearch(''), and the empty-term branch
resets searchTermRef and calls clearDecorations() so highlights vanish
immediately and a subsequent find-next won't reuse the stale term.
Problem: some SSH servers require the login password and the MFA challenge through keyboard-interactive. They reject the plain SSH password authentication method even when the password is correct, which makes Netcatty report password failures and can close the session before a usable shell opens.
Fix: add an explicit per-host Prefer interactive auth setting, reuse the existing requiresMfa host flag, forward it from the renderer to the native SSH bridge, and place keyboard-interactive before password only when that setting is enabled and a password is available. Hosts that do not enable the setting keep the existing auth ordering.
Tests: add a bridge regression test for the MFA auth order and extend the terminal starter test to assert the host option is forwarded.
MCP host_open unconditionally surfaces and focuses the main window,
which interrupts whatever the user is doing when an AI agent connects
to a host in the background. Add a toggle in Settings -> AI -> External
MCP (defaults to on, preserving existing behavior) so users can opt out.
* feat(settings): support local CJK fonts
* refactor: move CJK font rules to domain
* fix(settings): improve CJK font preview safety
* fix(settings): refresh local font previews
* fix(settings): improve font picker keyboard behavior
* fix(settings): handle unavailable font detection
* fix(settings): cover font picker edge cases
* fix(settings): quote custom font families safely
The onTerminalOutput handler had two near-identical branches (with/without an
external onTerminalOutput callback), each inlining the same
/password|passphrase|口令/i test that runs on every output chunk. Collapse them
into a single handler and hoist the pattern to a module-level constant so it is
compiled once and not duplicated. Behavior is unchanged.
* fix: keep non-hibernated tabs active in background
* fix: scope background work to hibernation policy
* fix: bind background monitoring to its tab
* fix: measure hidden local workspaces
* fix(ui): replace native confirms in system manager panels
Windows native confirm dialogs steal focus after process/tmux/docker
destructive actions. Use SystemPanelConfirmDialog so the side panel
stays usable after confirm/cancel.
Fixes#2242
* fix(ui): clear system manager confirms on session switch
Drop pending process/docker confirms when sessionId changes so a
dialog opened for one host cannot execute against another.
* fix(ui): clear docker image action busy on session switch
Reset actionBusy when sessionId changes so a previous host's
in-flight remove/prune cannot leave the new session's confirm
dialog disabled. Guard stale completions with a generation counter.
Covers password-only, dual KI (TOTP / secondary password), password+KI
partial (mock model A), and password-full-skip-MFA gap (mock model C).
Live cases run against the lab host when SSH_MFA_LIVE=1.
Always try password before keyboard-interactive for the first factor. After
any partial success, prefer keyboard-interactive when the server still allows
it so multi-factor/EDR second factors work without a per-host switch. Remove
the requiresMfa UI and "remember MFA" checkbox; keep secondary-prompt
protections and hostId-aware password save.
Default stays password-first for ordinary hosts. Hosts with requiresMfa
prefer keyboard-interactive so EDR secondary factors are not skipped.
Secondary prompts can suggest enabling MFA mode for that host.
Reject recovered-trailing-garbage parses during upload verification, pad
stale fixed temp files before MOVE, and re-check the destination so a
successful upload cannot leave non-whitespace junk on non-truncating
servers.
Fail closed when the existing vault length cannot be read, re-read and
re-pad after upload to heal concurrent stale-length races, and reuse a
single .tmp path so cleanup failures cannot pile up full vault copies.
When MOVE is unavailable, fall back to in-place PUT padded to the previous
byte length with spaces. Non-truncating servers then leave only JSON-legal
whitespace, the canonical vault never disappears mid-replace, and concurrent
clients cannot observe an empty remote (#2223).
Avoid empty remotes when MOVE falls back to DELETE+PUT: do not in-place
PUT after a failed delete, and retain the temp recovery copy if the final
PUT fails after the old vault was removed (#2223).
Only fall back to DELETE+PUT after a successful temp write, and abort if
destination delete fails so a non-truncating in-place PUT cannot corrupt
or wipe the previous vault (#2223).
Some WebDAV servers overwrite existing files without truncating when the
new body is shorter, leaving leftover bytes that break JSON.parse on the
next download.
Upload now uses temp PUT + MOVE (DELETE + PUT fallback), and download
recovers trailing garbage when V8 reports a position after valid JSON.
Home/scp probes during Auto fallback or forced SCP can hang forever if
the remote accepts exec but never closes. Abort after 15s so the file
panel cannot stay stuck connecting.
Store host sftpFileProtocol on SSH sessions so openSftpForSession used by
Catty/MCP/clipboard respects SFTP-only or forced SCP without payload.
Destroy the local read stream when the peer ACK loses the upload race.
Auto/utf-8 first-open used lossy UTF-8 on non-UTF-8 $HOME bytes, so
Chinese homes opened as mojibake and failed to list. Strict-decode with
gb18030 fallback and promote session encoding for subsequent shell ops.
When writeAll fails after waitForAck is armed, stream close would reject
the ACK promise unhandled. Centralize write+ACK in writeAndWaitAck and
guard Promise.all losers in uploadFile.
Listen for local write-stream errors before opening the SCP channel, pass
encoding/signal into download metadata stat, and restore remote mode after
external-editor SCP uploads.
Track active SCP exec streams per client and close them when the handle is
released, so agent Stop/timeout cancels transfers without killing the terminal SSH.
Detect GB18030 basenames under auto encoding for SCP listings, pass encoding
into source stat for transfers, and allow POSIX backslash in SCP basenames.
Await stream and final ACK together, keep SCP remote-to-remote paths as
strings, decode source control-line names with session encoding, and cancel
SCP homeDir via abort signal.
Reject failed local writers during download, always use fresh local file size
for SCP headers, pass encoding into parent mkdir, and require `scp` on the
remote before advertising SCP-mode connectivity.
Arm final ACK before trailing NUL, pass encodings through transferBridge,
harden base64 listing fallback, encode control-line basenames, and fail open
when SCP shell probe cannot run.
Do not end terminal-reused SSH sockets when closing SCP panes, and pass the
session filename encoding through SCP read/write/stat/rename/delete/chmod paths.
Tear down underlying SSH clients on SCP close, pass AbortSignal into homeDir
probes, and use session filename encoding when quoting remote paths for shell/SCP.
Avoid invalid do; in list for-loops, preserve setuid/setgid/sticky when
parsing ls modes, and clear sftpSudo when the host file protocol is set to SCP.
Stage SCP AI downloads/uploads before replacing destinations, use metadata
for remote list sizes, include file protocol in reconnect cache keys, refuse
Auto→SCP fallback when sudo elevation was requested, and apply download
backpressure. Update reuse-credentials contract tests.
Some hosts (e.g. NAS/Synology root) expose SSH but not the SFTP subsystem.
Add hybrid SCP mode: shell-backed list/manage and OpenSSH scp -t/-f transfers
behind the existing SFTP UI, transfer queue, and sftp.* AI/CLI/MCP tools.
Hosts can choose Auto (SFTP then SCP), SFTP only, or force SCP. Include unit
tests and optional env-gated real OpenSSH integration tests.
Same-endpoint session rebind was replacing the pane in place and closing the
SFTP session mid-transfer. Force a new tab when pending/transferring tasks
still reference the current connection id.
Same-endpoint rebind on terminal focus change was replacing the active SFTP
connection in place, which invalidates promoted editor saves keyed by the old
connection id. Force a new tab when editors still reference the current one.
Do not reuse a healthy same-endpoint SFTP tab across terminal session focus
changes — proxy/jump can differ while host keys match. Capture the visible
path first and reconnect in place with remembered initialPath + new
sourceSessionId so the directory stays sticky without stacking tabs.
closeSession clears preload ready listeners for the session id. A React
effect alone can lose a race with xterm-driven startMosh on retry; arm
the UI ready subscription synchronously after cleanup and again right
before startMosh.
Do not advance the last source session id until auto-connect can actually
rebind, so closing an editor/dialog still switches SFTP to the focused
terminal session.
Session switches can share a saved host key while live credentials/endpoints
differ, so always rebind to the focused session. Restore the last browsed path
on that reconnect so multi-terminal use no longer drops back to $HOME.
A always-truthy backend wrapper made the no-ready-event fallback dead
code and left scripts waiting forever on older bridges. Surface the
method only when the preload API actually implements it.
Use the connect-time connection cache key for skip/reuse and path memory so
same-hostId endpoint switches are not mis-attributed. Only restore previous
path on reconnect when the target host matches the prior connection.
Do not cancel ready/startup work when disposeExitRef is cleared for
hibernate detach. Dispose the pre-start ready subscription when
startMoshSession rejects before attach so retries do not leak listeners.
When a menu cannot fit above or below the trigger, stop flipping it
off-screen. Prefer the side with more space and cap max-height so
overflow scrolls instead of clipping trailing actions.
Require the active tab's mapped connection key to match the focused host
before skipping auto-connect, and re-key last-browsed paths from the live
connection so host-picker switches do not poison another host's memory.
Subscribe to mosh ready before startMoshSession and drain a ready that
fires during the await after attach. Default moshSessionReadyListeners
in createPreloadApi so lightweight test contexts do not throw on close.
Fix DropdownContent side=top so the menu sits fully above the trigger
instead of covering it. Match QuickConnect continue/save menu styling
to TerminalAuthDialog (open below, same z-index).
Fixes#2194
Closing follow mode still dropped back to $HOME when switching terminals or
after SFTP reconnect. Reuse a healthy same-host tab and restore the last
browsed path on rebind/reconnect.
Fixes#2193
closeSession clears preload mosh ready listeners for the session id.
Re-register on every transition into connecting so retry/auto-reconnect
do not leave scripts stuck unready or replaying into the handshake PTY.
Codex review P2s:
- Dismiss the connection overlay on first handshake output so password/OTP
prompts remain reachable; only defer startup commands and connect/pending
scripts until mosh-client ready.
- Dispose the ready listener via disposeExitRef and closeSession so cancel
does not leak preload callbacks when exit is suppressed.
Do not treat shell verbs after git-status markers as directory chrome, and
only strip multi-word path prefixes for privilege commands or clear path
sigils so `git status` and `My Project ls` stay correct (#2191).
Mosh connects through an ephemeral SSH handshake PTY before swapping to
mosh-client. Marking connected and firing startup commands too early
sent snippet/script input into that handshake PTY, so run-on-connect
scripts and host startup commands never reached the real shell (#2199).
Tag handshake output with moshHandshake meta, emit mosh ready after the
client swap, and defer connected status + scheduleStartupCommand until
then.
Accept resolved trailing privilege commands in shouldRecordShellHistory so
themed multi-word dirs still arm. Scan no-space prompts without a cache,
and do not peel echo/ls prefixes as directory chrome (#2191).
When password-prompt assist is open, Enter is hijacked to paste the
session host password. Clipboard paste did not clear that pending state,
so after pasting a different password (e.g. nested SSH via jump host)
Enter could append the wrong secret and fail sudo (#2198).
Dismiss the assist on paste/typed content input so Enter submits what
the user actually provided.
Never promote painted same-token tails over a non-empty keystroke buffer
(g + git status stays g); only prefer the full line when history yields a
privilege command the buffer does not. Accept unicode/punctuated themed
directory names before su/sudo, and keep double-space glyph first words.
Prefer trailing su/sudo/doas when the themed prefix looks like a path
(including multi-word dirs). Avoid over-peeling double-space glyph prompts
and do not treat a trailing-padded cwd token named su as a command (#2191).
Do not absorb post-cursor paint when it looks like a space-prefixed
suggestion (git + status). Prefer the keystroke buffer for single-word
incomplete echo (su→sudo), while still using the live line when history
shortens a multi-word typed buffer (#2191).
When typed text is only a trailing argv of a recalled sudo/su command,
prefer the full live line. Apply lastPromptText before peel so multi-word
directory themes resolve the real command first (#2191).
Peel path chrome on prefixed themed prompts (⚡ ➜ ~ su -). Prefer live
when history shortens a typed command (sudo→su), and prefer the typed
buffer when live still ends with chrome+command (#2191).
Reject decoration-only cached remainders and single cwd tokens on prefixed
themed prompts. When an aligned buffer is only a mid-line prefix of the
full recalled command, prefer the expanded live line (#2191).
Use lastPromptText when boundary detection fails for prompts without a
trailing space, and expand submitted input across wrapped rows so mid-line
Enter still sees the full history-recalled command (#2191).
Skip non-executable desktop CLI candidates, keep Claude on the macOS
app-bundle path, and surface desktop-resolved absolute paths in the
External MCP copyable setup command without breaking PATH installs.
Allow glyph-only one-word su/sudo/doas history to arm password assist,
limit path decoration filtering to bare themed prompts, and expand past
the cursor so mid-line Enter still resolves the full recalled command.
Empty Enter on ➜/git-status decorations must not record cwd tokens or
status glyphs as commands, which would pollute history and false-arm
password assist (#2191).
Validate cached prompt remainders against the live detector split so a
partial cache cannot yield git-status chrome as the command. Accept
multiword userInput on complete Powerline prompts, and allow history
recording when themed chrome reconciles away from the command.
Prefer the live line when ↑/Ctrl+R replace a typed prefix, while still
keeping the keystroke buffer for direct-send and echo lag. Peel themed
prompt decorations via reconcile when lastPromptText is missing or stale
after cd so su/sudo still arm (#2191).
- Strip themed prompt chrome via lastPromptText before falling back to
live userInput; reuse getCommandToRecordOnEnter so decoration pollution
is never armed or recorded (#806/#2191).
- Soft-dismiss password assist on all printable keys except plain Ctrl+C
so AltGr/Option characters still switch to manual entry.
Shell history (↑) redraws the line remotely without updating commandBuffer,
so Enter never armed su/sudo assist. Resolve the submitted command from the
live prompt line when the keystroke buffer is empty.
Ctrl+C was soft-dismissing the picker (same path as typing a password),
leaving dismissedWhileArmed and blocking the next bare Password: line.
Hard-abort on interrupt and ignore Ctrl/Meta/Alt keys for soft-dismiss.
* fix(ai): stop OpenCode process spawn storms when unused (#2184)
OpenCode model catalog loads were spawning full servers for discovered
agents, skipping main-process cache, and not aborting on timeout—so
idle Netcatty could accumulate many opencode processes.
Only load catalogs for the selected agent, cache/coalesce list-models,
abort and tear down on timeout, and share a short-lived list-models
server pool per binary.
* fix(ai): address OpenCode list-models review findings
Restore the main-process env immediately after spawning OpenCode so an
idle list-models server cannot leave PATH/OPENCODE_BIN on a temp shim.
Key model caches and the list-models pool by catalog-affecting env so
profiles that share a binary do not receive each other's catalogs.
* fix(ai): tighten OpenCode model-cache invalidation
Include profile-affecting env in the renderer runtime model cache key so
OpenCode config switches do not reuse a stale catalog. Skip caching empty
list-models results in the main process so transient OpenCode failures can
recover before TTL expiry.
* fix(terminal): prevent osc7_cwd errors after su
OSC 7 setup installed a bare osc7_cwd PROMPT_COMMAND entry. After
non-login su, that string could be inherited without the function
definition, printing "osc7_cwd: command not found".
Use a guarded prompt hook, unexport PROMPT_COMMAND, and upgrade
existing v1 rc snippets in place when setup is re-run.
* fix(terminal): safe OSC7 rc upgrade when markers are incomplete
Do not rewrite/truncate shell rc files when the Netcatty OSC 7 block is
missing an end marker or markers are unbalanced. Append a complete v2
snippet instead so setup still installs tracking without dropping user
config after an open start marker.
* fix(terminal): harden OSC7 rc upgrade safety
Address Codex review findings for OSC 7 setup upgrades:
- Never truncate incomplete/unbalanced marker regions; append v2 only
- Detect a complete v2 block for idempotent recovery
- Resolve full symlink chains; atomic same-dir replace with mode preserve
- Build stripped+v2 content in one temp write so read-only configs cannot
lose the legacy block without receiving the replacement
* fix(terminal): replace OSC7 v1 blocks in place
Upgrade complete legacy OSC 7 blocks by substituting the marked region
at its original location instead of stripping and appending at EOF. This
keeps surrounding control flow (if/fi wrappers) valid and still writes
the full result atomically with mode preservation.
* fix(terminal): match OSC7 markers as whole lines only
Use trimmed whole-line equality for start/end markers so echo statements
that embed the marker text are not treated as block boundaries during
legacy upgrades.
* fix(terminal): preserve ownership on OSC7 rc atomic replace
When upgrading a legacy block via temp+mv, restore the original
uid:gid on the temp file before replacing so a root-run setup against
another user's HOME cannot leave a root-owned bashrc.
* fix(terminal): harden OSC7 PROMPT_COMMAND array and chown
Process every PROMPT_COMMAND array element when installing the guarded
hook so leftover osc7_cwd entries cannot duplicate OSC 7. Abort the
atomic rc replace when ownership cannot be restored, leaving the
original file untouched.
* fix(terminal): fix exported array PROMPT_COMMAND handling
Detect array PROMPT_COMMAND via the -a attribute even when combined with
-x, and stop force-unexporting PROMPT_COMMAND now that the guarded hook
is safe to inherit across su.
* test(terminal): update OSC7 assertions for export-preserving hook
* fix(terminal): fall back when OSC7 upgrade temp dir is not writable
If same-directory mktemp fails (writable file in a non-writable managed
home directory), leave the original config intact and fall back to the
append path instead of aborting setup with set -e.
* feat(ui): customizable dense toolbars with show/collapse/hide
Add a shared toolbar layout model so terminal, SFTP, and side-panel
action strips can right-click customize placement, overflow collapsed
items into the more menu, and persist order plus placement.
* fix(ui): harden toolbar layout placement after review
Address review findings: availability-aware reachability, skip
unavailable reorder neighbors, Popover overflow for nested SFTP menus,
path chrome outside customize context menu, and side-panel hide close.
* fix(ui): only close side panel when hide placement sticks
Return the next layout from setPlacement so hide-of-last-reachable
does not tear down the panel, keep an active hidden tab chip visible,
and rebuild terminal shown order with highlight collapse coercion.
* fix(ui): narrow SFTP overflow spill and close ⋮ after leaf actions
Respect user show/collapse/hide, then temporarily move non-pinned shown
actions into ⋮ when the SFTP toolbar is narrow. Close overflow after
leaf clicks while keeping nested bookmark/encoding panels usable.
* feat(terminal): configurable su/sudo password prompt assist (#2156)
Extend the existing confirm-to-fill sudo assist to arm on su as well, and
add a Terminal setting for off / quick Enter fill / WindTerm-like credential
picker. Picker candidates come from the host password plus keychain password
identities; secrets are never shown in the list or sent without confirmation.
* fix(terminal): tighten password prompt assist after codex review
- Hint mode only uses the session host password, never an arbitrary
keychain identity as a silent Enter target.
- Build autofill candidates from the effective session host so group-
inherited passwords participate.
- Clear a stale credential picker when the session disconnects.
* fix(terminal): more password-assist polish from codex review
- Do not swallow arrow keys while the quick-fill hint is pending; only the
multi-credential picker consumes them.
- Clear the picker overlay on hibernate and wake so it cannot outlive the
autofill controller.
- Show the resolved auth username on the host candidate row (identityId /
group identity), not a stale host.username after password dedupe.
* fix(terminal): keep password picker select callback stable
Avoid forcing TerminalView memo invalidation on every Terminal render by
using a stable useCallback for credential selection.
* fix(terminal): do not offer full keychain on unarmed sudo prompts
Picker mode only lists all password identities after a real su/sudo
command was armed. Unarmed explicit [sudo] lines still get host-password
quick-fill only, blocking remote prompt phishing of other credentials.
* fix(terminal): fix picker mode switch and armed picker test
Arm before inspecting the picker payload, and when switching settings
mid-prompt recompute whether the command arm is still valid so picker
mode can open the full list.
* fix(terminal): reopen password picker after a wrong credential
Keep the su/sudo arm active after confirm-to-fill so a rejected password
re-prompt can offer the full credential list again instead of falling
back to host-only unarmed assist.
* fix(terminal): only re-assist real auth retries after fill
Keep a short post-fill arm for wrong-password re-prompts, but require an
explicit [sudo] line or authentication-failure text before reopening
assist. Prevents sending the host password into child prompts after a
successful sudo (e.g. sudo mysql -p).
* fix(terminal): scope sudo assist away from child password prompts
Track whether the armed command was sudo or su. su still accepts bare
Password: lines; sudo only assists on [sudo] tags or user-scoped prompts
(password for … / 输入密码), not generic Enter password when sudo is cached.
* fix(terminal): tighten when the full credential picker may open
Exclude child-program prompts (Enter password, Password for user …).
Full keychain picker only for explicit [sudo] lines or armed su Password:
prompts; Kylin-style sudo bare prompts still get host-password hint only.
* fix(terminal): limit full credential picker to armed su only
Multi-identity picker is the WindTerm-style su workflow (#2156). Sudo
keeps host-password quick-fill only, so a cached sudo child cannot open
the full keychain list via a forged or nested password prompt.
* fix(terminal): derive password assist candidates in Terminal + mode gate
- Standalone Terminal popups without TerminalLayer now resolve candidates
from host/keys/identities so su picker mode still works.
- When switching to picker mid-prompt, keep the su-only full-list gate
(do not open multi-identity list for an armed sudo prompt).
* fix(terminal): reject SSH-style prompts for su assist and drop dupe keys
- su bare matching only accepts short Password:/密码 lines, not user@host
SSH password prompts after passwordless su -c.
- Remove duplicate sudoAutofillCandidates keys that failed eslint.
* fix(terminal): cursor-anchor password picker and soft-dismiss Esc
Position the su credential picker with the same cursor-relative layout
helpers as autocomplete instead of fixed bottom-center. Esc only closes
the UI while keeping the arm so Esc/arrows can reopen the list on the
same Password: prompt.
Selected list borders were eating into content and looking like extra
left padding. Use inset primary ring (no layout shift) and reduce list
row horizontal padding from px-3 to px-2.
Unselected rows keep hover-only chrome with no extra border/bg.
Selected list/tree add a primary border; grid only recolors the
existing soft-card border to the accent color.
Selection was easy to miss because list mode reused hover glass fill.
Use full primary border, light primary wash, and ring so focus reads
clearly in grid, list, and tree.
Include hostClickBehavior in VaultView memo equality so the settings
toggle applies immediately, clear focus when the mode changes, and
apply select-then-expand to tree group rows with focus highlighting.
Add a Settings > Appearance vault option that defaults to single-click
connect, but can switch to select-then-click-again to connect. Grid mode
shows an accent ring on focus; list/tree reuse the hover fill. Groups
follow the same pattern when the option is enabled.
Store probed --version on ExternalAgentConfig from settings resolve-cli
and discovery enable, and prefer that when gating GPT-5.6 so custom
paths not on PATH still unlock Sol/Terra/Luna when compatible.
Hide minCliVersion presets when CLI version is unknown so pre-discovery
cannot default to Sol on old installs. Require exact path matches for
filesystem command configs so PATH discovery cannot gate a different
manual Codex binary.
Netcatty is BYO-CLI: upgrading codex-sdk does not replace the user's
binary. Hide Sol/Terra/Luna when discovery reports Codex CLI < 0.144.0
so old installs do not auto-default to an unsupported model.
Address PR #2170 Codex review: stop auto-selecting the last thinking
level (which defaulted Sol to ultra), add defaultThinkingLevel from the
official catalog, and keep gpt-5.2 selectable so stored model IDs do not
silently fall back to Sol.
Surface GPT-5.6 Sol/Terra/Luna in the curated Codex model picker and
bump @openai/codex-sdk to 0.144.3 so the bundled CLI meets the official
minimal client version for those models. Align reasoning efforts
(max/ultra) with the Codex catalog.
Fixes#2169
Always run filter, erase-scrollback, and paste prepare/cleanup so long
multi-line pastes still clear residual cells under large-output pressure.
Bulk-plain only skips prompt cosmetics when the post-paste stream is plain.
Decide bulk-plain shortcut after the stateful filter so retained CSI
prefixes still get erase/prompt transforms. Yield inside flood-merged
steps on hop count or WRITE_QUEUE_TURN_BUDGET_MS wall time.
Always run stateful filterTerminalSessionData before bulk-plain shortcuts so
split CSI continuations are not emitted as text. Cap synchronous recursion
inside flood-merged write steps to avoid Maximum call stack size exceeded.
Do not skip forcePromptNewLine preparation when bulk-plain degrade is active.
Bulk highlight catch-up only waits on time-bounded largeOutput, not sticky
longLine, so a single long line cannot leave a permanent 50ms poll.
Split timestamp skip from general bulk degrade. Full-scrollback multi-line
output (docker ps) no longer drops gutter markers; only high-rate floods
(>=64KB/100ms) or long lines suppress registerMarker storms.
Under large-output pressure, plain batches skip paste/prompt/filter prep and
go straight to xterm (bytes unchanged). Keyword highlighting no longer
schedules per-write scans during bulk — one quiet catch-up after pressure
drops. Sizable bulk queue items also yield after the write callback so paint
and input can interleave, matching Tabby FlowControl intent.
Lower the high-rate threshold to 16KB/100ms and treat multi-line writes on
a near-full scrollback as large-output immediately so second dumps skip
timestamp/highlight work. Extend the quiet window while saturated so
prompt gaps do not reopen the expensive path between seq runs.
Cap plain xterm writes (including short-line dumps like seq) to ~128KB and
yield after each intermediate slice so the UI can paint and accept input.
Under large-output pressure use the flood coalesce cap and rAF scheduling
instead of microtask packing. Leave SSH flow high-water at 1MB for #1961.
- abortTerminalWriteCoalescer always clears alt-screen schedule state so a
direct oversized enter-alt probe cannot stick after Ctrl-C drops the batch
- flood merge no longer forces a timer after every shard; inter-step yields
honor per-step yieldAfter (drain-budget pacing from writeLargeTerminalBatch)
Call resolveScheduleMode before early-returning when pending exceeds the
byte cap while auto-flush is gated (hidden pane). Without this, enter-alt
CSI in oversized hidden batches never latched rAF for follow-up repaints
after reveal.
Abort drops enter-alt CSI that never reaches xterm, so reset schedule
latches; treat ESC c (RIS) as leaving alternate so normal output returns
to the microtask path.
Drop enter-pending once the alternate buffer is seen or after an unobserved
exit (RIS), and reprocess ESC/C1 bytes that abort an incomplete private CSI.
Replace raw 16-char tail retention with a phase/params parser that handles
7-bit and 8-bit CSI in encounter order, long split sequences, and oversized
batches that bypass the coalescer frame arm.
xterm parses enter-alt-screen asynchronously, so buffer.active can stay
normal after ESC[?1049h is written. Keep frame scheduling until the
alternate buffer is observed (or leave-alt is seen).
xterm accepts \x9b?1049h as well as ESC[?1049h; force rAF for both forms
so the first TUI repaint is not microtask-scheduled while still on the
normal buffer.
Keep incomplete private CSI tails across coalescer flushes without
quadratic pending joins, and measure bulk-output rate with a true rolling
sample window so high-rate bursts are not missed at window boundaries.
Avoid control-character regex for alt-screen detection, join pending PTY
chunks so split CSI still upgrades to rAF, and reset timestamp segmenter
state when marker work is skipped under output pressure.
Restore debounced keyword refresh while panes are hidden so decorations
still apply after reveal, and force rAF scheduling when output enters the
alternate screen (including the first burst before buffer.active flips).
Reduce stutter from tiny write shards and vsync batching while keeping flow
control, TUI rAF coalescing, and interrupt safety intact. Bulk dumps use larger
shards, fewer yields, microtask scheduling on the normal screen, and degraded
timestamp/highlight side work under output pressure.
#2106 rewired the workspace toolbar X to detach the pane into a
standalone tab, duplicating the existing detach control. Restore X to
closeSession so it closes the pane again; detach stays on the arrow
button.
Expose Settings > Terminal > Normalize terminal text on copy (default on).
When off, all copy paths use raw xterm getSelection(); when on, strip
display padding and join soft wraps as before.
- Compact disposed timestamp entries on every write so clears cannot leave
a huge dead store while the gutter is off.
- Select bulk markers by measured visual rowOffset window rather than
timestamp count, so soft-wrapped floods do not pin out-of-buffer markers.
Drop ambiguous mid-token alnum continuation for padded wraps. Keep strong
continuations (path punctuation, hyphen at split, CJK) and treat multi-space
padding after a finished token as a word boundary.
Queue dropped/duplicate markers and dispose them with a per-pass budget
instead of abandoning forever or mass-disposing in one frame. Keeps
rewrite/scroll-region sessions from leaking unbounded xterm markers
while avoiding O(n²) freezes on flood output.
Deduping rewritten marker.line entries no longer calls dispose() for each
older duplicate. Mass dispose is O(n) per marker in xterm and can stall
rewrite-heavy output; abandoned markers leave with scrollback trim.
DECSTBM regions recycle rows without trimming normal scrollback. Bulk
row-offset measurement would invent history and prune still-valid labels,
so fall back to segmented marker registration when margins are active.
Collapse multi-space TUI padding between ordinary words to a single space so
Pi-style wrapped prose stays readable. Keep strong token continuations (CJK,
path punctuation, URL query) tight, and only treat URL mid-token alnum joins
as tight when padding is multi-space (not a single separator after a URL).
Codex review follow-up:
- Stop wiping prior timestamp entries when a bulk batch hits capacity;
DECSTBM regions can recycle rows without trimming scrollback.
- Throttle onScroll only under time-bounded largeOutput pressure so
sticky longLine state cannot lag user scrolling after output stops.
Codex review follow-up:
- Only register the last capacity timestamps in a bulk flood batch, and drop
excess store entries without per-marker dispose (xterm dispose is O(n)).
- Size capacity as scrollback + viewport with headroom above the unlimited
scrollback cap so oldest still-visible rows keep labels.
- Do not treat sentence punctuation as path continuations
- Scope URL/path detection to the trailing token only
- Cover Hangul and CJK punctuation on both sides of the wrap
Codex review follow-up:
- Treat xterm onScroll as throttled under large-output pressure so
output-driven scroll events cannot bypass the gutter paint budget.
- Collapse duplicate marker.line entries to the latest label before
applying the timestamp capacity cap.
- Prefer the latest marker label when cursor reposition rewrites an earlier
line (entries are not always sorted by marker.line).
- Advance the flood throttle clock on every render attempt so same-second
labels still rate-limit viewport rescans during sustained output.
- Prefer getTrimmedLength() columns when deciding full-row vs partial selection
- Apply token-continuation checks before single-space word-boundary handling
- Detect URL/path context so mid-token wraps do not gain spaces
- Do not invent spaces for URL/path/CJK token continuations across padding
- Keep a single space only for clear word-boundary soft wraps
- Preserve explicitly selected trailing spaces on partial last rows and column selections
Keep always-on timestamp semantics, but cut flood-path work:
- Merge validate+measure into one pass and fast-path printable ASCII
CR/LF floods (seq-style) without escape/unicode scans.
- Binary-search sorted marker entries for the viewport window.
- Reuse gutter row DOM nodes and throttle paints under large-output
pressure while keeping scroll/resize immediate.
- Collapse soft-wrap padding to a single word separator (no CJK space insert)
- Intercept the native copy event so Edit>Copy uses the same normalization
Always-on per-line timestamp markers used an O(n) filter on every
scrollback dispose, which made seq 1 500000 freeze the UI and back-pressure
SSH flow control. Keep always-on history for gutter expand, but compact
disposed entries lazily, cap capacity to scrollback, intern same-second
labels, and skip listener notify when the gutter is closed.
xterm getSelection() turns every physical buffer row into a hard newline, so
soft-wrapped TUI output (e.g. Pi agent responses) pastes with broken wraps and
display padding. Rebuild clipboard text from buffer coordinates: trim row
padding, join isWrapped rows, keep real hard breaks.
Use the helper on copy-on-select, context/hotkey copy, paste-selection, and
add-selection-to-AI paths.
Fixes#2162
- Keep unlocked encrypted keys eligible after passphrase retry even when
the target is password-only (jump-chain retry path).
- Fire onAuthAttempt from the simple ordered auth handler so jump/SFTP
progress logs still update for password-only sessions.
Direct terminal sessions still tried ~/.ssh default keys after a saved
password failed, while jump-host and SFTP paths (buildAuthHandler) only
tried password. That made a wrong/stale host password look fine on direct
login but fail ProxyJump and SFTP until credentials were re-saved (e.g.
via Keychain).
Align startSession with #266 password-only policy and pin buildAuthHandler
behavior with regression tests.
Fixes#2079
Only suppress KI password auto-fill when the password method already
succeeded as a prior factor (EDR step-up). publickey/agent partialSuccess
still allows filling the saved host password into a following Password:
challenge (AuthenticationMethods publickey,keyboard-interactive).
Do not suppress saved-password prefill for multi-prompt keyboard-interactive
forms just because the challenge name mentions Duo or two-factor. Prefill
still targets only the password slot; skipAutoFill covers true second factors.
autoFilledOnce still blocks re-prefilling a stale login password into the
retry modal, but no longer hides the save checkbox. Saving is suppressed
only after partialSuccess or for an explicit single secondary/OTP field.
createOrderedStringAuthHandler no longer permanently consumes methods
that are merely absent from the current methodsLeft list. After a
publickey partialSuccess the server can re-request password even if it
was skipped earlier when only publickey was advertised.
allowSavePassword only turns off for post-first-factor rounds or a single
secondary/OTP field. A combined Password: + Verification code: challenge
still offers saving the password slot (Codex P3 on #2151).
Pass allowSavePassword=false for post-partialSuccess / EDR / multi-round
keyboard-interactive challenges so the modal cannot overwrite the host
login password with a secondary secret (Codex P2 on #2151).
Expand secondary-password regex to allow words between "secondary" and
"password", and scan keyboard-interactive name/instructions so Chinese
"二次认证密码" banners still block auto-fill when only the English field
label is in the prompt text.
Multi-round keyboard-interactive exchanges may not report partialSuccess
between prompts. After the first auto-fill, later password-looking rounds
open an empty modal so an EDR secondary secret is not pre-filled.
Track partialSuccess on simple/agent ordered auth handlers, omit saved
password from second-factor modal payloads, and align modal prefill
deny-list with the backend MFA vocabulary.
Do not auto-fill keyboard-interactive challenges that look like
secondary/EDR passwords, and skip saved-password auto-fill after a
first-factor partialSuccess so step-up prompts always surface the modal.
When the host info bar is hidden, the script execution banner used a
fixed top:34 under empty space and full right edge under the circular
toggle. Raise it and reserve a right gutter so it sits beside the dial
instead of being pushed under it.
Replace the dense radial-dot “chessboard” grip in the hidden-host-info
speed-dial with a lucide GripVertical control sized like the other
toolbar icons, so drag remains available without looking like a grid
button.
When the host info bar is hidden, the circular action toggle is an
overlay. Reserving a right inset for it pushed the xterm scrollbar
inward and left a dead strip beside the button. Keep the normal body
inset only so the dial floats on top of the terminal.
Match toggle and action pill at h-7 with the same border/shadow treatment,
swap the dense dots for ChevronsLeft / X, and pad the expand clip box so
the soft downward shadow is no longer sliced by overflow-hidden.
.terminal-topbar sets container-type:inline-size, which size-contains the
inline axis so the spring-out tray stayed width 0 and no controls appeared.
Expand with a 0fr→1fr grid instead, drop that class from the tray, shrink
the circular toggle, and use three horizontal dots.
Replace the cramped top-right strip with a circular toggle. On click, the
full action toolbar springs out to the left as a rounded pill (scale +
slide + fade), so every control is visible instead of stacking on the
dots button.
When the host info bar is hidden, the action strip used to open at the
same top-right corner as the dots toggle. That stacked the first control
(host keyword highlight) and its tooltip on the toggle, so it looked like
only “关键词高亮” appeared. Open the full toolbar as a bordered panel
under the toggle instead.
When the host info bar is hidden, the action cluster sits at the top-right
edge. Opening host keyword highlighting with side=top clipped the panel
and left the tooltip stacked on the trigger. Open both below the toolbar,
align the panel to the end of the cluster, and suppress the tooltip while
the panel is open.
Raise the packaging floor past 0.1.5 so Netcatty pulls host-before-ack
Confirm, Pending-continue, and related mosh-client fixes. Local resources
fetch to moshcatty-0.1.6 (binaries remain gitignored).
Raise the packaging floor from 0.1.4 to 0.1.5 so Netcatty bundles the
stock-aligned Diff-path speculative echo fix for high-latency typing.
Handshake diagnostics already landed via #2128.
When SSH exits without a parsed MOSH CONNECT line, users only saw the
mosh-server banner and "[Mosh session closed (code 0)]", which looked
like a successful session that immediately died (#2121 residual
connect failures).
Print an explicit handshake-failure hint and put a matching error on
the exit payload. Document that speculative local echo lives in
MoshCatty 0.1.5+ (prediction is not implemented in the renderer).
Workspace toolbar X was calling closeSession and destroying the pane
instead of returning it as its own tab. Route that control through
detach when available, harden close/detach against stale session state,
and record the workspace id in tabOrder when drag-to-split creates a
workspace so later detach can put tabs back correctly.
#2096 gated split layout on viewMode === "split", but drag-to-split
workspaces from createWorkspaceFromSessions leave viewMode undefined
(default tiled split). Visible panes then fell back to full-size stacking
and looked like a broken split. Treat any non-focus workspace as split
geometry, matching pre-2096 isSplitViewVisible behavior.
Refresh AppImage SRI hashes for the re-published v1.1.62 release assets
(including the SFTP opaque-background fix). Release workflow cannot push
directly because main requires a pull request.
After continuous terminal rendering (#2096), inactive terminal panes stay
visible under other surfaces. SFTP had no solid background, so terminal
content bled through when switching from a terminal tab. Use bg-background
so the layer is opaque and still follows the active theme.
Mirror the published AppImage SRI hashes from the v1.1.62 release so Nix packaging tracks the new version. The release workflow could not push this update directly because main requires changes through a pull request.
When the terminal side panel is docked on the left, default top tooltips
for the tab rail (SFTP, scripts, etc.) rendered under the traffic lights.
Match the host-tree toolbar and force side="bottom" (#2095).
* feat(mosh): default bundled client to MoshCatty releases
Wire Netcatty packaging and npm run dev to pull pure Rust mosh-client
binaries from binaricat/MoshCatty (moshcatty-* tags), document the cutover,
and mark the old Cygwin Windows fetch path as legacy-only.
* fix(mosh): accept pure MoshCatty packages (exe-only, no dlls/terminfo)
Align fetch/packaging with MoshCatty pure-Rust releases: require only
mosh-client[.exe], treat Cygwin dll bags and terminfo as optional legacy
layout. Document moshcatty-0.1.1 (ConPTY Ctrl+C + static MSVC CRT).
* refactor(mosh): drop Cygwin legacy; MoshCatty-only pipeline
Remove FluentTerminal/mosh-bin fallbacks, build-mosh C++ CI, and
dll/terminfo runtime helpers. Fetch accepts only moshcatty-* pure
binaries; packaging ships a single mosh-client per platform.
* docs: align ET checklist and et README with MoshCatty-only mosh
Update mosh template references after removing Cygwin build pipeline and
legacy fallbacks. Point ET packaging notes at fetch-mosh / MoshCatty
instead of deleted build-mosh-binaries workflow.
* docs(mosh): require MoshCatty 0.1.2+ for Linux glibc floors
Codex review vs main: defaulting to MoshCatty Linux binaries built on
ubuntu-latest required GLIBC 2.34, above Netcatty's package floors
(x64 2.28 / arm64 2.31). Document the floors, prefer moshcatty-0.1.2+,
and drop trailing whitespace in the design note. Upstream MoshCatty
release CI now builds in almalinux:8 / debian:bullseye with assert.
* fix(mosh): reject MoshCatty releases below 0.1.2
Codex re-review: docs alone still allowed MOSH_BIN_RELEASE=moshcatty-0.1.0/0.1.1,
which produce packages that fail to start on Netcatty's Linux glibc floors.
Validate the minimum tag in resolve and fetch, skip pre-0.1.2 when picking
latest, and cover the reject path in unit tests.
* fix(mosh): pin MoshCatty owner and reject floor prereleases
Codex review vs main (P2):
- Always default MOSH_BIN owner/repo to binaricat/MoshCatty; do not
inherit fork owner from GITHUB_REPOSITORY in resolve or fetch.
- Treat moshcatty-X.Y.Z-rcN as below final X.Y.Z so pins like
moshcatty-0.1.2-rc1 cannot bypass the glibc floor.
* fix(mosh): accept build metadata in MoshCatty release tags
TAG_RE rejected '+' so moshcatty-0.1.2+build.1 failed validation even
though the version parser and isAtLeastMinRelease accepted it. Align
the regex and require a successful semver parse.
* Fix system-to-dark theme race
* Cover peer windows in theme race fix
* Exercise production theme sync path
* fix(settings): announce all changed appearance fields over IPC
Theme sync only broadcast STORAGE_KEY_THEME, so receivers that hit the
stale-storage race for UI theme or accent kept the old value. Emit a
keyed notify for each appearance field that actually changed so the
reducer race guard covers light/dark UI theme ids and accent state too.
* fix(settings): keep current appearance fields across keyed IPC
Sequential notifies for one multi-field appearance change were
re-reading non-announced keys from still-stale storage, so a later
UI-theme IPC could revert an earlier theme update. Preserve in-memory
current values for non-matching keys, compose IPC applies via a ref,
and cover the multi-notify sequence in tests.
Build Linux x64 native modules in an AlmaLinux 8 environment with a newer toolchain while keeping the RHEL 8 compatibility target. Stabilize RPM and pacman packaging in that container, and harden bundled mosh/ET binary builds against transient dependency download failures.
After the 1MB high-water mark fix, bulk dumps like `tail -2000f` still slowed
down because pause/flood mode shrank the coalescer to 8KB batches. That made
the renderer drain the 1MB backlog slowly, so each pause/resume RTT stayed
long and total time regressed toward ~10s on WAN links.
Keep the full bulk coalesce size while flow is paused so the backlog drains
fast enough to resume the SSH channel quickly; only use the flood cap when the
write queue is flooded but flow is still open. Also raise flood coalesce to
128KB and per-turn queue drain to 256KB so plain-text floods do not shard into
tiny setTimeout yields.
Show the active write permission mode as a dedicated status row, and move the
lengthy how-to / security copy into a header help tooltip so the card stays
scannable. Also fix usage copy that incorrectly said the toggle was "below".
Agents could list vault hosts and run commands on open sessions, but could not
open a host themselves. Add vault.host.open (MCP: host_open) that opens a
terminal tab via the vault agent bridge, merges the new session into MCP scope,
and documents the flow in the Catty system prompt.
Also redesign External MCP client configuration into segmented tabs with
shared copyable code blocks so setup matches the settings design system.
* fix(ai): probe remote login shell before PTY wrappers (#1854)
SSH/Telnet sessions never set shellKind, so AI exec defaulted to the
posix wrapper and broke fish login shells with "Unsupported use of '='".
Probe the remote login shell once via a silent SSH exec channel before
AI/MCP PTY execution, cache session.shellKind, and leave et/mosh
shellKind unset so they can take the same path. Fish wrapper coverage
includes a real-fish binary regression test.
* fix(ai): harden remote shell kind probing
* fix(ai): keep PowerShell prompt override after posix login probe
Do not pin probed posix login shells onto session.shellKind. Unset still
defaults to posix wrapping, while leaving the kind open preserves the
live PS ...> prompt override for bash/zsh login shells that entered
pwsh interactively (Codex P2 on #2061 / issue #841 path).
* fix(ai): make remote shellKind probe cancellable before PTY write
Register a pending activePtyExecs marker for the pre-exec shell probe so
Stop during the probe window latches cancellation and does not still type
the command after the probe resolves (Codex P2 on #2061). Wire through
Catty, MCP, and worker foreground exec paths.
* fix(ai): release session lock if job shell probe rejects
terminal_start reserves the session before ensureSessionShellKind; if that
promise rejects, the previous .then-only path never released the lock.
* fix(ai): cancel pending terminal_start during shellKind probe
Register background job entries before the remote shell probe so chat
cancel can latch and abort job start before startPtyJob types into the
PTY (MCP + worker paths; Codex P2 on #2061).
* fix(ai): do not pin login shell as active; default to posix_sh
Login-shell probe no longer sets session.shellKind for fish/posix — only
powershell/cmd are pinned. Unset shellKind resolves to posix_sh (sh -c
inner POSIX wrapper), which both fish and bash interactive shells can
parse, fixing #1854 without assuming login shell === active shell
(Codex P2 on #2061).
* fix(ai): use login shell as soft hint, not sh -c / dash
Drop posix_sh default that ran commands under /bin/sh (often dash) and
broke bash/zsh source, [[ ]], and functions. Keep fish/posix probe as
session._loginShellKind soft hint for resolveEffectiveShellKind so fish
login still gets the fish wrapper and bash/zsh keep the native posix
wrapper, while live PS prompts can still override.
* test(ai): cover shell probe cancellation gaps
* fix: build Linux x64 packages on Debian Buster for glibc 2.28
Rebuild node-pty (and serialport) inside debian:buster so x64 releases
load on RHEL 8 / CentOS 8 / UOS / Deepin instead of requiring glibc 2.35
from ubuntu-22.04. Mirrors the arm64 containerized build pattern (#2062).
* fix: run Buster build-deps step with bash
Container jobs default to /bin/sh; dash does not support [[ so the
archive.debian.org rewrite would be skipped and apt-get update would fail.
* fix: disable apt Valid-Until for archived Buster mirrors
archive.debian.org security metadata for Buster is expired; without
Acquire::Check-Valid-Until false, apt-get update fails in the container.
* fix: install Python 3.11 for node-gyp on Buster x64 builds
Buster ships Python 3.7; node-gyp 12 uses walrus syntax and fails during
npm ci when rebuilding node-pty. Keep the glibc 2.28 container and supply
a modern interpreter via actions/setup-python.
* fix: install Python 3.11 via uv inside Buster x64 builds
actions/setup-python is not reliable on glibc 2.28 containers. Install a
manylinux CPython with uv so node-gyp 12 can rebuild node-pty during npm ci.
Keep only the confirmed product fixes for 奇安信-style auto-login:
1. Seed startup screen from viewport or live buffer so on-screen menus
stay waitable (never mark the whole buffer consumed at script start).
2. sendLine emits body then CR separately, matching real keyboard input.
3. After sendLine, consume only pre-send buffer length so peer prompts
that arrive between body and Enter remain matchable for the next step.
Same-host Connected preference depends on session order; ignoring
reorder left the picker bound to a stale sourceSessionId.
Co-authored-by: Cursor <cursoragent@cursor.com>
Connected picker names a specific live session; renderer username/port
can lag the authenticated bridge endpoint, so reuseOnly must not reject
on endpoint mismatch before attaching to that session.
Co-authored-by: Cursor <cursoragent@cursor.com>
When session.port is undefined, use SSH default 22 instead of a vault
host.port that may have been edited after the terminal connected.
Co-authored-by: Cursor <cursoragent@cursor.com>
Host-ready only refreshes an already-issued external token so cold-start enable cannot write a short-lived discovery token before resolveHostCredentials rotates it.
Co-authored-by: Cursor <cursoragent@cursor.com>
Endpoint-only Connected picker attempts must not fall through to a
fresh SSH dial. Also correct zh-CN/zh-TW Connected section labels.
Co-authored-by: Cursor <cursoragent@cursor.com>
Ignore Catty/CLI authToken from onBridgeHostReady and re-assert the cancel flag after scoped metadata cleanup so soft-revoke stays intact.
Co-authored-by: Cursor <cursoragent@cursor.com>
Try endpoint-only openSftp with sourceSessionId before getHostCredentials
so Connected picker rows work when saved password/key is missing or
undecryptable on this device.
Co-authored-by: Cursor <cursoragent@cursor.com>
Issue a rotatable external-only TCP token on enable, soft-revoke it on disable without killing long-lived stdio sockets, force external sockets onto the reserved chat scope, and only seed empty external metadata when the scope key was never written.
Co-authored-by: Cursor <cursoragent@cursor.com>
Reject disabled/in-flight scope resurrection, move session sync to App mount, cancel the external chat session on stop, and broadcast approval cards to main + settings windows.
Co-authored-by: Cursor <cursoragent@cursor.com>
Only hide a vault host when its endpoint matches the live Connected
entry, so post-connect host edits still offer the new saved target.
Co-authored-by: Cursor <cursoragent@cursor.com>
Skip peer/settings windows, listen for cross-window enable, only mark payloads sent after success, and mount the MCP approval IPC bridge at app startup before TerminalLayer lazy-loads.
Co-authored-by: Cursor <cursoragent@cursor.com>
Sudo SFTP never reuses a terminal shell connection; advertising those
hosts as Live would fall back to a fresh auth while hiding the normal row.
Co-authored-by: Cursor <cursoragent@cursor.com>
Vault host edits after connect must not break sourceSessionId reuse;
overlay hostname/username/port from the terminal session onto the picker host.
Co-authored-by: Cursor <cursoragent@cursor.com>
Serialize enable/disable, cancel in-flight external work on stop, refresh discovery env for live permission mode, sync all terminals from TerminalLayer, host confirm approvals globally, and treat Claude local/project scope as upgradeable.
Co-authored-by: Cursor <cursoragent@cursor.com>
Skip rebroadcast when HTTP proxy settings are unchanged across windows, and force rejectUnauthorized onto the tunneled target TLS hop when allowInsecure is set.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep app-wide external hosts when a Catty sidebar push arrives, and re-read discovery permissionMode so long-lived stdio clients pick up Safety changes without restart.
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the vault-host mosh/et filter so plain SSH terminals opened against
a mosh/et-default host (e.g. ssh:// deep links) still appear as reusable.
Co-authored-by: Cursor <cursoragent@cursor.com>
In terminal-worker mode mirror renderer session payloads into
__external_mcp__ and seed from other chat scopes when the live map is empty.
Co-authored-by: Cursor <cursoragent@cursor.com>
Lets Windows users (and others) route Google Drive / OneDrive / GitHub sync and AI provider traffic through system or custom proxies without touching SSH ProxyJump settings.
Co-authored-by: Cursor <cursoragent@cursor.com>
In terminal-worker mode the main-process sessions map can be empty; avoid
overwriting renderer-pushed __external_mcp__ metadata with an empty sync.
Co-authored-by: Cursor <cursoragent@cursor.com>
Merge prior scoped host metadata when syncing live sessions, and parse
Claude Environment: KEY=VALUE blocks so configured entries are not
misclassified as missing discovery env.
Co-authored-by: Cursor <cursoragent@cursor.com>
Do not fall back to the expected launcher path when the existing Grok
entry carries args; that masked conflicts as configured.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep disabled same-name entries visible to classifiers so one-click setup
can mcp remove them before writing the discovery-env launcher config.
Co-authored-by: Cursor <cursoragent@cursor.com>
Exclude connecting and Mosh/ET sessions so Connected rows always map
to a live ssh2 shell that SFTP can reuse without a fresh login.
Co-authored-by: Cursor <cursoragent@cursor.com>
Parse Scope/Args from `claude mcp get`, remove the blocking scope before
re-adding with discovery env, and treat non-empty Args as a conflict.
Co-authored-by: Cursor <cursoragent@cursor.com>
When multiple live terminals share a hostId, pick the later same-status
session so Connected picker reuse targets the newest endpoint match.
Co-authored-by: Cursor <cursoragent@cursor.com>
Treat launcher-only Codex/Claude/Grok entries as not_configured so one-click
setup can remove and re-add them with NETCATTY_EXTERNAL_MCP_DISCOVERY_FILE.
Co-authored-by: Cursor <cursoragent@cursor.com>
Always show reserved-scope approval cards in Catty, stop rewriting
discovery after startup errors, and fail closed when an explicit discovery
env path is missing instead of falling back to another profile.
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop unsupported `-s` from `claude mcp get`, treat only starting/running as
enabled for RPC gates, and reject launcher commands that carry extra args.
Co-authored-by: Cursor <cursoragent@cursor.com>
Disconnect marked external sockets on disable, await in-flight stop before
re-enable, write Claude MCP entries to user scope, and stop spawning client
CLIs on the quiet status poll.
Co-authored-by: Cursor <cursoragent@cursor.com>
Expose the existing catalog MCP as a Settings-managed local bridge with
discovery lifecycle, one-click client setup, and reserved external scope
so third-party agents can use Netcatty without a sidebar chat session.
Co-authored-by: Cursor <cursoragent@cursor.com>
Use sftpPickerSessionsEqual in SftpView and SftpSidePanel memo
comparisons so OSC title updates do not force full SFTP re-renders.
Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid re-rendering mounted side panels on OSC title churn by comparing
id/hostId/protocol/status for the Connected picker, and ignore local
.omo run-continuation state.
Co-authored-by: Cursor <cursoragent@cursor.com>
Include sessions in the side-panel stable context equality check so the
Connected host list updates when terminal sessions connect or change.
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep WindowOpacityButton in sync with Settings so 96–99% stays
selectable from the top-tabs control as well.
Co-authored-by: Cursor <cursoragent@cursor.com>
The appearance slider previously stepped by 5%, so 96–99% was unreachable
even though the clamp already allows any value in [0.5, 1]. Fixes#2019.
Co-authored-by: Cursor <cursoragent@cursor.com>
Let users pick currently connected SSH sessions from the SFTP host
picker and reuse the existing connection, including ephemeral deep-link
hosts.
Co-authored-by: Cursor <cursoragent@cursor.com>
Local Terminal used a per-session hostId, so autocomplete history never
accumulated, and the store never imported ~/.zsh_history. Stabilize the
hostId and seed from local histfiles so prefix suggestions match Ghostty.
Closes#2037
Co-authored-by: Cursor <cursoragent@cursor.com>
Do not trim password values when validating auth forms or attaching
credentials to SSH connect options, so a single-space password works
(issue #2036).
Co-authored-by: Cursor <cursoragent@cursor.com>
Closing the hibernate setting must restore already soft-hidden or
hibernated tabs immediately, instead of waiting until the user selects
them again.
Co-authored-by: Cursor <cursoragent@cursor.com>
Solo tab switches only flip isVisible. Skipping that prop in Terminal's
memo left isVisibleRef stale, so hidden panes kept the visible write path
and #1995/#1996 tab-return recovery never ran (#1985).
Co-authored-by: Cursor <cursoragent@cursor.com>
Detect complete password prompts on the last line independently of the
whole-chunk promptCandidateBytes cap, so a large stale prefix plus a
sudo/password prompt is not dropped during Ctrl+C drain.
Co-authored-by: Cursor <cursoragent@cursor.com>
Attackers switched to hash-named zips with soft bait, so drop the
scoring heuristics and treat any zip/dangerous attachment from
non-maintainers as spam.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: let script waits match the visible startup screen
Auto-login scripts that wait for bastion menus already on screen were
timing out because startup snapshot sync marked the whole buffer as
consumed. Replace the script buffer with the current viewport so waits
can match visible text while still ignoring scrolled-off scrollback.
Fixes#1960
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: keep startup viewport waitable across sync races
Address Codex review on #2035: merge the visible snapshot with any
output that arrives during the snapshot IPC (e.g. bastion BEL), and seed
the whole viewport as fresh so waitFor* can match headers beyond the
512-byte tail slack on long menus.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: do not seed buffer-fallback scrollback as visible screen
When the renderer misses the snapshot request, requestScreenSnapshot
returns the full script buffer, not the viewport. Mark that path and
keep the consumed baseline so scrolled-off keywords cannot rematch.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: preserve live output during fallback snapshot sync
Baseline only the pre-sync buffer length on empty/fallback snapshots so
bytes that arrive while waiting for the snapshot stay matchable, matching
the viewport path's trailingFresh behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: keep waitForPrompt scoped to the live tail after seeding
Seeded full-viewport freshness is for waitFor/waitForText/waitForRegex
only. waitForAny still uses the 512-byte tail window so an older prompt
still visible above long-running output cannot satisfy waitForPrompt.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: advance scan offset when consuming a preserved startup prompt
waitForPrompt could resolve a seeded live-tail prompt without consuming
the viewport above it, so a later waitForText rematched older visible
lines. Advance scanOffset through the preserved prompt end.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: consume the full seeded viewport after startup prompt
When waitForPrompt resolves a preserved live-tail prompt, advance
scanOffset through the entire seeded snapshot — not just the prompt —
so later waitForText cannot rematch older visible text after the prompt.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: keep sync-race trailingFresh outside seeded viewport
seededLength must end at the visible snapshot so waitForPrompt does not
consume bytes that arrived during the snapshot IPC. Those trailingFresh
bytes stay matchable for later waitForText/waitForRegex.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: dedupe trailingFresh against blank-padded viewport snapshots
Full-viewport snapshots often end with blank rows after live content, so
a plain endsWith check missed sync-race duplicates. Compare after
stripping trailing blank lines before appending trailingFresh.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: let generic waitForAny match the full seeded viewport
Tail-only freshness is for waitForPrompt (allowPreservedTailMatch).
Generic waitForAny must still see menu labels near the top of a long
seeded startup screen, matching waitForText/waitForRegex.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: trim partial overlap from sync-race trailingFresh
When the viewport snapshot already contains a prefix of trailingFresh,
append only the non-overlapping suffix so waitForText cannot rematch a
phantom duplicate of the overlapped text.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: match partial trailingFresh overlap against full viewport
Use the unstripped viewport when trimming sync-race prefixes so an
overlapped trailing newline is not left behind as a phantom blank line.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: keep waitForPrompt from rematching short seeded prompts
After live output clears preservedTailMatch, currentTailFreshBoundary
must start at seededLength so a short startup prompt cannot satisfy
waitForPrompt through the normal 512-byte window.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: invalidate preserved prompts once scanOffset passes them
If waitForText/waitForRegex already consumed output after a preserved
startup prompt, clear that prompt via advanceScanOffset so waitForPrompt
cannot reuse it. markOutputConsumedThrough still keeps the one-shot
startup prompt for waitForPrompt.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: trim blank-padded overlap without dropping duplicate sync markers
Use syncStartText to keep genuinely new duplicate suffixes during snapshot
sync, while still trimming blank-padded and partial overlaps from trailingFresh.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: treat scrollback-backed stale viewports as pre-sync
When syncStart has scrollback above the visible suffix, a stale snapshot can
still equal that suffix without matching syncStart exactly — keep trailingFresh
so duplicate markers printed during the IPC round-trip are not trimmed away.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: invalidate startup seed after automated script input
sendLine/send must not leave the seeded viewport or preserved prompt
matchable, or common send-then-wait scripts can complete against pre-command
output. Keep sync-race trailingFresh beyond seededLength still waitable.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: keep long sync-race output waitable after startup prompt
After waitForPrompt consumes the preserved prompt, re-seed remaining
trailingFresh so markers ahead of a >512-byte burst stay matchable. Also
consume all buffered bytes on automated input, including pre-input trailingFresh.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
When multiple restore controls are preserved, peel complete leading
restore sequences that are a suffix of preserved from the password
prefix so droppedBytes stay accurate and restores are not re-emitted.
Co-authored-by: Cursor <cursoragent@cursor.com>
Hold incomplete CSI with password prefixes, but drop standalone SGR
fragments so they cannot leak into a later shell prompt. Restore/OSC
prefixes remain holdable alone.
Co-authored-by: Cursor <cursoragent@cursor.com>
Only strip a full preserved restore prefix from password holds, and when
discarding a mid-CSI held prefix also consume the CSI final byte so
shell prompts are not corrupted.
Co-authored-by: Cursor <cursoragent@cursor.com>
When a drain chunk preserves alternate-screen restore and also holds a
password prefix on the same line, strip the overlapping restore from
pending so droppedBytes stay accurate and restore is not re-emitted.
Co-authored-by: Cursor <cursoragent@cursor.com>
Styled prompts can split mid-CSI (Pass + ESC[ / 0mword:). Hold both
the password-prefix body and the trailing control prefix so the prompt
still completes across chunks during Ctrl+C drain.
Co-authored-by: Cursor <cursoragent@cursor.com>
Include the new resume reason in TerminalInterruptDisplayFilterReason
so typed returns from the one-chunk password path type-check.
Co-authored-by: Cursor <cursoragent@cursor.com>
Password prompts often emit nothing further until the user types, so
dropping a complete prompt while waiting for promptQuietMs leaves a
blank terminal. Resume immediately on complete password candidates.
Co-authored-by: Cursor <cursoragent@cursor.com>
Match password-prefix candidates after stripAnsi so SGR-styled chunks
like ESC[31mPass still hold across chunks, while keeping raw pending
bytes for display when the prompt completes.
Co-authored-by: Cursor <cursoragent@cursor.com>
Classify keyword bodies without punctuation/spaces so full-width
colon targets do not collapse minLen to 1 and hold lone "p"/"pa".
Co-authored-by: Cursor <cursoragent@cursor.com>
A held Pass prefix followed by \nPassword: is a fresh flood line, not a
same-line completion. Discard the prefix and keep quiet-gap so stale
prompts cannot bypass drain via the held-prefix resume path.
Co-authored-by: Cursor <cursoragent@cursor.com>
Only bypass promptQuietMs when a held password-prefix chunk completes.
Fresh Password:/Enter password: lines in the flood wait for the quiet
gap like shell prompts, so canceled prompts do not resume drain early.
Co-authored-by: Cursor <cursoragent@cursor.com>
Detect trailing password-keyword prefixes at word boundaries so split
prompts like "alice@host's pass"+"word:" or "用户 的密"+"码" survive
Ctrl+C drain instead of being dropped mid-keyword.
Co-authored-by: Cursor <cursoragent@cursor.com>
Align complete-password-prompt detection with terminalSudoAutofill so
prompts like "用户 的密码" resume Ctrl+C drain instead of being dropped.
Co-authored-by: Cursor <cursoragent@cursor.com>
Limit held prefixes to true prompt-prefix forms so ordinary lines like
"Password authentication failed" are drained, and include discarded held
prefix bytes in returned droppedBytes so renderer flow ack stays accurate.
Co-authored-by: Cursor <cursoragent@cursor.com>
A held "Pass" that never completes as a password prompt must be dropped
before the generic shell-prompt matcher runs, otherwise "Pass$ " leaks
into the terminal after Ctrl+C drain.
Co-authored-by: Cursor <cursoragent@cursor.com>
Buffer probable password-prompt prefixes (e.g. "Pass") across chunks so a
split "Password:" / "[sudo] password…" is not dropped before it completes,
and resume immediately once the held prefix forms a complete prompt.
Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Opening SFTP (or other side panels) can shrink the terminal in pixels
without changing cols/rows, so term.onResize never clears the atlas and
WebGL keeps painting stale glyphs as black squares (#2013).
Co-authored-by: Cursor <cursoragent@cursor.com>
Interrupt output gates only resumed on shell-style prompts, so a password
prompt arriving in the quiet window was dropped as stale flood. Treat
sudo/password prompts as resume points on both main and renderer gates.
Co-authored-by: Cursor <cursoragent@cursor.com>
Version opacity updates and skip rebroadcasting incoming IPC/storage
echoes so a fast drag in Settings no longer fights delayed main-window
values (#2018).
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): prevent corrupt uploads from oversized fastPut chunks
Restore ssh2's 32KB default chunk size, verify remote size after upload,
and treat stream finish (not close) as success so truncated zip/tar.gz
transfers fail loudly instead of looking complete (#2022).
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sftp): wait for stream close after finish on upload fallback
Address Codex review: resolving on finish alone can miss close-time
server errors while the remote handle is still open. Require finish then
close, and fail on premature close.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
SSH key passphrase prompts previously checked "Remember this passphrase" by default; make it opt-in for safer defaults (#2024).
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: make Windows Mosh handshake survive ConPTY and Cygwin terminfo
Windows ConPTY can inject CSI into MOSH CONNECT lines and exit without a
trailing newline, so the sniffer never swapped to mosh-client. Also convert
bundled TERMINFO paths to /cygdrive/... because Cygwin ncurses splits on ':'.
Fixes#2025
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: defer unterminated MOSH CONNECT parse until EOF
Avoid accepting a 22-char key prefix mid-stream before optional "=="
padding arrives; recover unterminated CONNECT only on SSH PTY flush.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify Netcatty MCP environment context so external agents that read resources can see the terminal execution tools, and cover the MCP resource path with a test.
* Add telnet URL deep link support
* Fix telnet deep link review issues
* Keep ssh deep links independent from telnet registration
* Address Codex telnet deep link feedback
* Support JumpServer jms:// client launch links
Register Netcatty as an optional jms:// protocol handler (opt-in,
default off to avoid conflicting with the official JumpServer client).
SSH/SFTP connection payloads decode to an ephemeral host that connects
to the JumpServer gateway with the one-time connection token, without
saving anything to the vault.
Fixes#1958
* Mark jms deep link hosts as ephemeral for session restore exclusion
* Open the SFTP side panel for JumpServer sftp launch links
jms:// payloads with protocol "sftp" previously landed in a plain
shell. Mark the ephemeral host with an autoOpenSftpPanel hint that the
session factory forwards as autoOpenSidePanel, and let TerminalLayer
open the SFTP side panel for that session once it connects.
* Support JumpServer telnet deep links
* Keep JumpServer telnet links on SSH gateway
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Support password in ssh deep links with ephemeral connect
ssh://user:password@host URLs now connect directly using the URL
credentials without saving the host to the vault, covering bastion
one-time password flows. Password-less links keep the existing
match-or-prefill behavior.
Fixes#1890
Co-authored-by: Cursor <cursoragent@cursor.com>
* Keep ephemeral deep-link hosts out of vault update paths
Terminal-layer host updates (e.g. the SFTP follow-CWD toggle) map over
the merged terminal host list, which could persist an ephemeral host
and its plaintext password into the vault. Route terminal-layer host
updates through a splitter that applies ephemeral entries to in-memory
state only and forwards just the vault hosts to updateHosts.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Exclude ephemeral deep-link sessions from session restore
Sessions backed by an in-memory ephemeral host cannot survive a
relaunch (the one-time password only lives in memory), so persisting
them would leak the ephemeral host metadata into restore storage and
restore a tab that can never reconnect. Mark ephemeral hosts and their
sessions, and filter them out of the session-restore payload.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Treat ephemeral hosts as unsaved in appearance classification
The terminal theme/font panel and pane appearance resolution decided
"saved vault host" via hostMap membership. Ephemeral deep-link hosts
are now in that map, so theme/font changes were routed to the
persisted-host updater and silently dropped. Classify via
isSavedVaultHost (ephemeral flag aware) so those changes fall back to
the session/global setting path as before.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Reuse saved host settings for password deep links and keep ephemeral marker on clones
Password deep links now run saved-host matching first: a uniquely
matched vault host contributes its non-credential settings (proxy,
jump chain, charset, group, ...) to the ephemeral host while the URL
credentials override vault identities and key references. Session
clones (split/copy/copy-to-new-window) now carry the ephemeralHost
marker so cloned tabs stay excluded from session restore.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Block group credential inheritance on password deep-link ephemeral hosts
buildSshDeepLinkEphemeralHostFromSaved now takes the group-resolved
effective host and clears group/identityFilePaths in addition to
identity references, so a later resolveEffectiveHost pass cannot
re-inherit group default credentials (identity, key, password) over
the one-time URL password. Non-credential group defaults (proxy,
jump chain, charset, ...) are preserved via the effective host.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Route ephemeral-host font zoom through the per-session font-size path
Ctrl+zoom on a non-workspace ephemeral deep-link session hit the
saved-host update path, where the vault updater silently dropped the
change (ephemeral ids are not in the persisted hosts array). Zoom and
the theme panel font-size slider/reset now store the size on the
session (rendered via applySessionFontSizeToHost) for ephemeral
hosts, matching the workspace-pane behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix ephemeral session font zoom routing
* Prevent ephemeral deep-link sudo autofill
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): detach stale keychain identity when saving retry credentials
When a host references a Keychain identity (host.identityId) with wrong
credentials, re-entering credentials via the auth-retry dialog's
"Continue & Save" saved them onto the host but kept the identity
reference. On reconnect, resolveHostAuth prefers identity credentials
over host fields, so the stale keychain credentials kept failing.
Clear identityId when the user explicitly saves new credentials so the
saved username/password (or key) actually takes effect.
Fixes#1956
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): keep saved retry credentials over group-inherited identity
Writing identityId: undefined is treated as "unset" by applyGroupDefaults,
so a group-level identity would be re-inherited on reconnect and shadow the
credentials saved from the auth-retry dialog. Store an empty string instead
and register identityId in EMPTY_STRING_OVERRIDES_GROUP_DEFAULT so the
explicit "no identity" override sticks. All consumers check identityId
truthiness, so "" behaves as "no identity".
Addresses Codex review on #1970.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Re-inject tool call names on OpenAI-compatible stream desync
Some OpenAI-compatible gateways emit tool_call chunks the AI SDK
rejects or ignores (non-standard `type` values, tool calls outside
choices[0]). The chunk normalizer had already recorded the tool call
id, so later nameless continuation chunks were forwarded with an
injected id and the SDK threw "Expected 'function.name' to be a
string." on what it saw as a brand-new tool call.
Remember each tool call's function name when its id is assigned and
re-inject it (plus type "function") into continuation chunks so every
forwarded chunk is self-describing, and coerce non-standard tool_call
type strings to "function" so the naming chunk itself is not dropped
by schema validation.
Fixes#1954.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Preserve argument prefixes from SDK-invisible tool call chunks
Codex review on #1966 flagged that when the chunk establishing a tool
call is invisible to the AI SDK (which only reads choices[0]), any
argument fragment it carried was lost: the recovery path re-injected
the name but forwarded only the suffix arguments, producing truncated
tool input.
Track the full concatenation of argument fragments per tool call key
and which keys have been forwarded at choices array position 0. The
first chunk forwarded where the SDK can see it now carries the full
accumulated arguments; already-visible tool calls keep streaming
incremental fragments as before.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): raise SSH flow high-water mark to stop WAN pause ping-pong (#1961)
Bulk terminal output over SSH (e.g. `tail -2000f big.log`) was far slower
than other clients on high-latency links. The renderer's output flow control
pauses the source stream once its unacked backlog crosses FLOW_HIGH_WATER_MARK
(previously 100KB). For SSH the source is the ssh2 channel, so pause() stops
the remote until resume() plus a full round-trip.
ssh2's own channel window is 2MB (WINDOW_THRESHOLD 1MB), so a 100KB watermark
made Netcatty pause/resume dozens of times during a multi-MB dump — a 4MB dump
triggered ~61 pause cycles, each costing ~1 RTT. At 300ms RTT that turned a
~2s dump into ~21s.
Raise FLOW_HIGH_WATER_MARK to 1MB so it sits near the ssh2 window; the same
4MB dump now settles in ~4 pause cycles (~2-3s at 300ms RTT) while still
bounding renderer memory. FLOW_LOW_WATER_MARK stays at 8KB to keep interactive
acks responsive.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(terminal): align deferred-ack test with 1MB flow high-water mark
The deferred IPC ack batch threshold (XTERM_WRITE_CALLBACK_BATCH_BYTES)
now sits far below FLOW_HIGH_WATER_MARK, so deferral alone can no longer
accumulate up to the watermark. Assert the batch-flush invariant instead.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(zmodem): keep transfer listeners across same-session reconnects
The preload netcatty:exit handler dropped the per-session zmodem
listener sets, but auth-failure retries and auto-reconnects reuse the
same sessionId without remounting the terminal, so useZmodemTransfer
never re-subscribed and rz/sz progress + overwrite dialogs silently
stopped appearing (#1955). Move listener cleanup to explicit
closeSession and prune empty sets on subscriber dispose instead.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(zmodem): gate event delivery instead of dropping listeners on close
Codex review caught that reconnects also call closeSession with the
terminal still mounted (startReconnect -> cleanupSession), so clearing
listener maps there reintroduced the bug for manual/auto reconnects.
Keep listener sets owned by renderer subscribers and gate zmodem event
delivery on closedTerminalDataSessions, which is cleared when a session
restarts with the same id.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix directory tracking setup after su / sudo su (#1942)
After switching users in the terminal (e.g. `sudo su -`), SFTP directory
following stops: the new user's shell has no OSC 7 prompt hook, and the
backend pwd probe runs on an exec channel owned by the login user, which
cannot read another user's /proc/<pid>/cwd. The advertised remedy — the
OSC 7 setup action — also failed in this exact scenario because its silent
exec-channel script cannot verify or configure a foreground shell owned by
another user.
The setup script now detects that the active foreground shell belongs to a
different uid, reports the target shell via a marker (exit 5), and the
renderer falls back to typing the setup command into the terminal itself,
where it runs as the target user. The config lands in that user's rc file,
so OSC 7 reporting resumes immediately and persists for future su sessions.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address Codex review: stage typed setup remotely, forward shell-local config paths
The typed fallback previously pasted the whole multi-line setup script into
the terminal, which could leave many entries in the target user's bash
history when cmdhist is off (the appended history -d only removes the last
one). The setup script is now staged into a self-deleting remote temp file
over the silent exec channel, and the typed command becomes a short single
line — one history entry that the existing bash cleanup reliably removes.
The typed wrapper also forwards shell-local (possibly unexported) ZDOTDIR /
XDG_CONFIG_HOME to the child sh via the NETCATTY_* overrides the script
already honors, so zsh users with a custom config dir get the prompt hook in
the right rc file (mirrors buildOsc7SetupCommand).
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address Codex review: hash-verify the staged setup script before the su shell runs it
The staged temp file stays writable by the login user until the typed
command runs, so a same-uid process could swap its contents in that window
and have the su-target (e.g. root) shell execute arbitrary code. The typed
runner now reads the file into memory once, deletes it, verifies the
renderer-computed SHA-256 of the in-memory copy, and only then pipes that
same copy to sh — no TOCTOU window between verification and execution.
Verification failure prints an error instead of running anything.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
The "Authentication failed…" retry prompt and progress-log line in
createTerminalSessionStarters were hardcoded English and bypassed i18n,
so they rendered in English regardless of the selected language.
Route both through the existing tr() helper and add
terminal.auth.retryMessage / terminal.auth.retryLog to en, ru, zh-CN
and zh-TW.
* 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>
* fix(ai): allow OpenCode native skill dirs in permission rules
Netcatty's OpenCode permission config denied external_directory access
for everything outside its own allowlist, so skills discovered by
OpenCode itself (~/.opencode/skills, ~/.config/opencode/skills,
~/.claude/skills, ~/.agents/skills, remote skill cache) could not read
their reference files. OpenCode evaluates rules last-match-wins and its
read permission matches worktree-relative paths, so wildcard-anchored
patterns for the well-known skill directories are added to both the
read and external_directory rules in MCP and skills+cli modes.
Fixes#1939
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ai): re-deny dot-env files inside OpenCode skill dir allows
The broad skill-directory read allows would win over OpenCode's default
.env / .env.* approval gates (last matching rule wins), silently exposing
secret files placed inside native skill directories. Append targeted deny
rules after the allow entries so dot-env files stay protected.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix manual session log capture in terminal worker mode
Manual session logs (and script session logs) start their write stream in
the main process, but with the default terminal worker runtime all session
output is appended to the worker process's own sessionLogStreamManager
instance, so the saved file only ever contained the initial prompt line.
Tap the worker output mirror into the main-process stream manager so
main-process log streams receive terminal output, and mirror sudo-autofill
and programmatic command log rewrites when forwarding writes to the worker
so those logs stay sanitized like worker-owned auto session logs.
Fixes#1938
Co-authored-by: Cursor <cursoragent@cursor.com>
* Dedupe fallback worker output before session log taps
The runtime sender announces every chunk with an output-tap message and
falls back to a plain output message when the output port is unusable;
the manager notified taps for both, double-writing manual/script session
logs in the fallback path. Mark fallback output as already tapped so taps
fire exactly once per chunk.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Every output chunk was walked char-by-char up to four times in JS
(sync-block filter, erase-scrollback rewrite, replay-safe log sanitizer,
line-timestamp segmenter) plus two more per-char scans for long-line
pressure, before xterm.js ever parsed it. Replace those loops with
native indexOf/regex hops and single-slice appends, and gate the
quadratic pending-suffix scan in the sync filter behind a cheap
incomplete-escape check. Output is byte-for-byte identical (fuzzed
old-vs-new over 4000 mixed chunks); colored-output floods drop from
~350ms to ~0.03ms per 64KB batch in the sync filter alone.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix terminal backlog when window is unfocused in background.
Extend the background write fast path to occluded-but-visible windows (common on Windows Alt+Tab), skip wasteful repaints during that path, and flush any remaining coalescer/queue backlog when the app returns to foreground.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix resume hook wiring and keep unfocused repaint in fast path.
The onWindowShown resume flush never fired because useTerminalBackend did not expose the bridge listener. Also restore scheduleTerminalRepaintWhenUnfocused on the background fast path: unfocused-but-visible windows have no rAF render loop, so skipping it froze visible output (#1761 regression).
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add macOS Dock new connection menu
* Fix Dock menu window readiness
* Wait for renderer before Dock menu delivery
* Queue Dock host connects until vault ready
if [[ ! "$tag" =~ ^mosh-bin-[A-Za-z0-9._-]+$ ]]; then
echo "Invalid mosh binary release tag: $tag" >&2
exit 1
fi
printf 'name=%s\n' "$tag" >> "$GITHUB_OUTPUT"
- name:Create / update release
env:
GH_TOKEN:${{ secrets.MOSH_BIN_RELEASE_TOKEN }}
RELEASE_REPO:${{ inputs.release_repo }}
RELEASE_TAG:${{ steps.tag.outputs.name }}
run:|
set -euo pipefail
if [[ -z "${GH_TOKEN:-}" ]]; then
echo "::error::MOSH_BIN_RELEASE_TOKEN is required to publish into ${RELEASE_REPO}."
exit 1
fi
{
printf '%s\n' 'Pre-built `mosh-client` binaries consumed by `scripts/fetch-mosh-binaries.cjs` during `npm run pack`.'
printf 'Linux/macOS artifacts are built from `mobile-shell/mosh` upstream ref `%s`.\n' "${MOSH_REF}"
printf '%s\n\n' 'Windows x64 is the SHA256-pinned Netcatty runtime bundle, with the FluentTerminal standalone `mosh-client.exe` kept as a fallback asset.'
'Title must start with `[Bug]` or `[Feature]` followed by a short summary (at least 8 characters after the prefix). Legacy app links using `Bug: ...` are also accepted. Example: `[Bug] SFTP upload fails on Windows`'
);
}
if (body.length < 120) {
errors.push(
'Body is too short. Please use the Bug Report or Feature Request template and fill in all required fields.'
git commit -m "chore: update star history charts [skip ci]"
# Auth comes from actions/checkout (RELEASE_TOKEN), not GH_TOKEN above.
git push -u origin "HEAD:${branch}" --force
existing="$(
gh pr list \
--head "$branch" \
--base "$default_branch" \
--state open \
--json number \
--jq '.[0].number // empty'
)"
if [[ -n "$existing" ]]; then
echo "Reusing open PR #${existing}"
pr_number="$existing"
else
pr_url="$(
gh pr create \
--base "$default_branch" \
--head "$branch" \
--title "chore: update star history charts" \
--body "Automated weekly refresh of the static star history SVG charts embedded in the README. Generated by the Star History workflow via mystarhistory."
)"
echo "Created ${pr_url}"
pr_number="${pr_url##*/}"
fi
# required_approving_review_count is 0; merge immediately when possible.
if gh pr merge "$pr_number" --squash --delete-branch; then
echo "Merged PR #${pr_number}"
else
echo "Could not auto-merge PR #${pr_number}; left open for manual merge."
External SDK turns normalize file changes, web searches, plan updates, recoverable warnings, and token usage into the shared event protocol. These activity and usage records are stored on assistant messages so the compact activity view is restored with chat history.
**Stop** always goes through `stopAgentTurn()` (UI, `/stop`, MCP). Do not add parallel abort paths in hooks.
### Codex App Server (experimental)
Codex can opt into a persistent `codex app-server --stdio` runtime under
`electron/bridges/aiBridge/codexAppServer/`; the existing TypeScript SDK remains
the default. The main process owns JSONL RPC correlation, thread/turn routing,
native approvals, `request_user_input`, model discovery, and process cleanup.
- Session identities include the Codex runtime; SDK and App Server threads must
never resume across runtimes.
- Observer maps to `read-only + never`, Confirm to `read-only + on-request`, and
Auto to `danger-full-access + never`.
- App Server native “allow for session” decisions are session-scoped Codex
grants and must not become persistent Netcatty permission grants.
-`turn/completed` is the terminal lifecycle event. Retryable `error`
notifications are warnings; process exit is fatal.
- Regenerate the committed protocol contract with
`npm run generate:codex-app-server-schema` after upgrading Codex, and verify it
with `npm run check:codex-app-server-schema`.
### AI SDK v7 (Catty path)
Catty sidebar turns use **Vercel AI SDK 7** via `streamText` in `turnDrivers/cattyStreamProcessor.ts`. Key conventions:
@@ -72,7 +94,7 @@ Placement rules (`resolveAgentKinds` in `toolSurfaces.cjs`):
|---------|-------------------|--------|
| Catty (sidebar) tools | `npm run generate:capability-tools` → `infrastructure/ai/harness/generated/cattyToolSpecs.json` | Sidebar agent tool set. CI verifies JSON drift. |
| Global agent tools | same script → `globalAgentToolSpecs.json` | Prepared for future global agent runtime; shared RPC tools only today. |
| MCP stdio | `electron/capabilities/codegen/mcpToolRegistry.cjs` → `electron/mcp/netcatty-mcp-server.cjs` | Registry-driven; external agents. Harness tools are **not** on MCP. |
| MCP stdio | `electron/capabilities/codegen/mcpToolRegistry.cjs` → `electron/mcp/netcatty-mcp-server.cjs` | Registry-driven; external agents. Only `harness.terminal.read_context` is also on MCP. |
@@ -82,7 +104,32 @@ Placement rules (`resolveAgentKinds` in `toolSurfaces.cjs`):
**Handles:**`ToolOutputStore` persists across turns per chat session; cleared on chat session delete. Large `sftp.read` results spill to `tool_output_read`.
**Harness domain (`catalog/harness.cjs`):** Catty-only surface (`surfaces.catty.toolName`). Registered in the capability catalog but executed locally in `capabilityTools.executeLocalCattyCapability` (not MCP/CLI). `harness.web.search` is omitted when web search is not configured.
**Harness domain (`catalog/harness.cjs`):** Catty executes these locally in `capabilityTools.executeLocalCattyCapability`. The read-only `harness.terminal.read_context` also exposes `netcatty/readContext` to MCP, with scope validation before and after the existing renderer bridge call. It reuses the sidebar reader through the screen snapshot registry (80 rows by default, maximum 300); no script or command runs. Other harness tools remain Catty-only. `harness.web.search` is omitted when web search is not configured.
## Plugin host runtime (internal preview)
The phase-2 plugin host lives under `electron/plugins/` and is disabled unless
`NETCATTY_PLUGIN_DEV=1` is present at application launch. Public wire and package
types still come only from `packages/plugin-contract/schema/`; do not add a
second private RPC shape when extending the host.
-`PackageStore` validates an immutable `.ncpkg` snapshot, extracts only into
private staging, and atomically publishes an installed version.
-`PluginManager` serializes install, enable/disable, restart and uninstall
mutations. Do not bypass it from renderer IPC.
- Ordinary plugins run in a sandboxed, offline `BrowserWindow` session and can
reach only their runtime-scoped `netcatty-plugin://` authority.
- Node-only plugins run in a dedicated `utilityProcess`; they remain an advanced
development-only path until permission and distribution phases land.
-`PluginRpcRouter` owns correlation, cancellation, deadlines, stream credit and
protocol-failure containment. Runtime identity is assigned by the host and is
never accepted from request parameters.
- App quit goes through `runPluginShutdown()` after the dirty-editor guard; do
not add another independent quit interception path.
Run `npm run test:plugin-runtime` for main-process boundaries and
`npm run test:plugin-runtime:electron` for real BrowserWindow/utilityProcess
smoke coverage. Packaged-resource changes must also pass `npm run pack:dir`.
## Extending the System
1) **New domain logic**: Add pure functions/types under `domain/`; avoid side effects.
@@ -95,6 +142,14 @@ Placement rules (`resolveAgentKinds` in `toolSurfaces.cjs`):
- **Temporary files**: All temporary files (e.g., SFTP downloaded files for external editing) must be written to Netcatty's dedicated temp directory via `tempDirBridge.getTempFilePath(fileName)`. Do not write directly to `os.tmpdir()`. This ensures proper cleanup and user visibility in Settings > System.
## Terminal Side Panel Splits
-`domain/sidePanelLayout.ts` owns the pure pane/split tree operations, including focus, unique tools, close collapse, resize, and the pane limit.
-`application/state/useTerminalSidePanelLayoutState.ts` owns per-terminal layouts and keeps the legacy focused-tool map compatible with external open paths.
-`TerminalLayerSidePanelSection.tsx` renders one shared toolbar plus the nested pane chrome. Each pane content host must remain `overflow-hidden` and layout-contained.
- Mounted tool panels use a stable portal node that moves between their pane host and the hidden parking host. Never fall back to an `absolute inset-0` side-panel root when a pane host is not ready.
- Closing the whole side panel clears that terminal's split tree. Switching terminal tabs must not reuse another tab's layout.
## Testing & Safety
- Favor unit tests for domain helpers (e.g., `workspace.ts`, `host.ts`) and hook-level tests for application state.
- When changing storage keys or schema, provide migration or backward-compat handling.
@@ -106,6 +161,16 @@ Placement rules (`resolveAgentKinds` in `toolSurfaces.cjs`):
- Avoid direct network/fetch in components; add a service/adaptor first.
- Maintain ASCII-only unless required by existing file content.
## Reporting Issues & PRs
Issues opened without the required format are **auto-closed** by the issue-format bot. Agents that file issues via `gh` or the API must still follow these rules:
- **Title:** start with `[Bug]`, `[Feature]`, or `[Other]`, then a short summary (≥ 4 characters after the prefix). Example: `[Bug] SFTP upload fails on Windows`.
- **Body:** use the templates under [`.github/ISSUE_TEMPLATE/`](.github/ISSUE_TEMPLATE/) (Bug Report or Feature Request) and fill every required field. Blank issues are disabled.
Full contributor guidance (setup, commits, PR process): [CONTRIBUTING.md](./CONTRIBUTING.md).
## Review Boundaries
- Treat `electron/cli/*`, `netcatty-tool-cli`, the CLI discovery file, and the local TCP bridge as internal Netcatty integration surfaces unless a task explicitly says otherwise.
- Do not review those surfaces as public APIs by default, and do not assume they must support third-party callers, manual launches, or non-Netcatty agents.
Watch Catty Agent orchestrate a Docker Swarm cluster across two servers in one conversation. It handles the init, token exchange, and node joining — you just tell it what you want.
@@ -141,6 +127,8 @@ If you regularly work with a fleet of servers, Netcatty is built for speed and f
### 🖥️ Terminal Workspaces
- **Split panes** — horizontal and vertical splits for multi-tasking
- **Session management** — run multiple connections side-by-side
- **Save current screen** — right-click a terminal to save the visible final text, without replaying keystrokes or overwritten output; scroll first to save an earlier screen.
- **Inline images** — render Kitty graphics, SIXEL and iTerm inline images from remote programs
### 📁 SFTP + Built-in Editor
- **File workflows** — drag & drop uploads/downloads
@@ -150,76 +138,6 @@ If you regularly work with a fleet of servers, Netcatty is built for speed and f
- **Custom themes** — tune the app appearance to your taste
- **Keyword highlighting** — customize highlight rules for terminal output
---
<a name="demos"></a>
# Demos
Video previews (stored in `screenshots/gifs/`), rendered inline on GitHub:
### Vault views: grid / list / tree
Switch between different Vault views to match your workflow: overview in grid, dense scanning in list, and hierarchical navigation in tree.
@@ -292,8 +208,44 @@ Download the latest release for your platform from [GitHub Releases](https://git
Or browse all releases at [GitHub Releases](https://github.com/binaricat/Netcatty/releases).
### Code signing and privacy
Netcatty is applying to the SignPath Foundation open-source program. Once
approved, covered Windows release artifacts will use **Free code signing provided by SignPath.io, certificate by SignPath Foundation**.
See the [code signing policy](CODE_SIGNING_POLICY.md) and
[privacy policy](PRIVACY.md). Windows releases may remain unsigned until the
application and integration are complete.
> **Windows portable data:** Exit Netcatty, then create a folder named `data` beside `Netcatty.exe` (zip build) or beside the portable launcher. Netcatty will store its profile there on the next launch. Saved passwords and private keys remain protected by the Windows user account that created them, so they must be re-entered after moving the folder to another computer or Windows account.
> **Open folders in Netcatty on Windows:** The installed version adds **Open in Netcatty** to Explorer's folder context menu and folder-background context menu. It opens a local terminal in that folder. On Windows 11, choose **Show more options** first. Turn the menu off or on in **Settings → System → Windows Explorer**. ZIP and portable versions do not add this menu by default.
> **macOS Users:** Current releases are expected to be code-signed and notarized. If Gatekeeper still warns, make sure you downloaded the latest official build from GitHub Releases.
### Scoop (Windows x64, community-maintained)
With [Scoop](https://scoop.sh/) installed, you can install Netcatty from the community-maintained [lemon bucket](https://github.com/hoilc/scoop-lemon/blob/master/bucket/netcatty.json), which downloads the installer from Netcatty's official GitHub Releases:
This is a third-party package, not an official Netcatty bucket, and updates may lag behind GitHub Releases. It currently supports x64 only. Settings remain in `%APPDATA%\netcatty` across updates and normal uninstalls; `scoop uninstall netcatty --purge` also deletes those settings. Use Scoop to manage updates for this installation.
### Nix / NixOS
Netcatty provides a flake that wraps the official Linux AppImage release for Nix and NixOS users:
@@ -322,25 +274,6 @@ npm install
npm run dev
```
### Project Structure
```
├── App.tsx # Main React application
├── components/ # React components
│ ├── Terminal.tsx # Terminal component
│ ├── SftpView.tsx # SFTP browser
│ ├── VaultView.tsx # Host management
│ ├── KeyManager.tsx # SSH key management
│ └── ...
├── application/ # State management & i18n
├── domain/ # Domain models & logic
├── infrastructure/ # Services & adapters
├── electron/ # Electron main process
│ ├── main.cjs # Main entry
│ └── bridges/ # IPC bridges
└── public/ # Static assets & icons
```
---
<a name="build--package"></a>
@@ -388,7 +321,7 @@ Contributions are welcome! Please feel free to submit a Pull Request.
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
See [agents.md](agents.md) for architecture overview and coding conventions.
See [AGENTS.md](AGENTS.md) for architecture overview and coding conventions.
---
@@ -413,11 +346,11 @@ This project is licensed under the **GPL-3.0 License** - see the [LICENSE](LICEN
'ai.providers.style.help':'Selects which API format requests use. Override when a third-party endpoint speaks a different dialect than its provider type suggests.',
'ai.providers.openaiApi':'OpenAI API format',
'ai.providers.openaiApi.chat':'Chat Completions',
'ai.providers.openaiApi.responses':'Responses',
'ai.providers.openaiApi.help':'Chat Completions works with most OpenAI-compatible endpoints. Responses can raise cache hit rates on relays that support /v1/responses.',
'ai.providers.icon.errorType':'Please choose an image file.',
'ai.providers.headers':'Custom HTTP Headers',
'ai.providers.headers.help':'Optional headers for this provider. Values are hidden and encrypted when saved.',
'ai.providers.headers.name':'Header name',
'ai.providers.headers.value':'Header value',
'ai.providers.headers.add':'Add header',
'ai.providers.headers.remove':'Remove header',
'ai.providers.headers.invalid':'Use valid, unique HTTP headers. Content-Length and Transfer-Encoding are managed automatically.',
'ai.providers.headers.loadError':'Unable to unlock saved headers. Cancel and try again after unlocking your system keychain.',
'ai.providers.headers.saveError':'Unable to save securely. Check that your system keychain is available and try again.',
'ai.providers.apiKey':'API Key',
'ai.providers.apiKey.placeholder':'Enter API key',
'ai.providers.apiKey.decrypting':'Decrypting...',
'ai.providers.baseUrl':'Base URL',
'ai.providers.baseUrl.anthropicHelp':'Anthropic-compatible: host with or without /v1 (for example https://gateway.example or https://gateway.example/v1). Detection and chat both use /v1/models and /v1/messages.',
'ai.providers.baseUrl.ollamaHelp':'Local Ollama: http://localhost:11434/v1 (no API key). Ollama Cloud: https://ollama.com/v1 plus your cloud API key.',
'ai.codex.description':'Connect OpenAI Codex. Sign in with ChatGPT here, or enable an OpenAI-compatible provider API key and custom endpoint in Settings.',
'ai.codex.appServer.description':'Use the persistent Codex protocol for native approvals, sandbox controls, live models, and mid-turn questions. SDK remains the default.',
'ai.codex.appServer.checking':'Checking App Server support…',
'ai.codex.appServer.available':'App Server is available for this Codex CLI.',
'ai.codex.appServer.modelCatalogWarning':'The live Codex model catalog is unavailable. Using the built-in model list.',
'ai.codex.appServer.approval.allowSession':'Allow for session',
'ai.codex.appServer.userInput.title':'Codex needs your input',
'ai.codex.appServer.userInput.description':'Answer these questions to continue the current turn.',
'ai.codex.appServer.userInput.other':'Enter another answer',
'ai.codex.appServer.userInput.autoResolve':'Codex will continue automatically if no answer is provided in time.',
'ai.codebuddy.envVars.hint':'One KEY=VALUE per line, passed to the CodeBuddy agent. Set CODEBUDDY_API_KEY or CODEBUDDY_AUTH_TOKEN here for authentication. Stored locally in plaintext.',
'ai.codebuddy.persistSession.hint':"Keep CodeBuddy's own session transcript on disk so CodeBuddy can resume it later. Turn off to disable CodeBuddy session storage; Netcatty may still save chat history and external session metadata. File checkpointing is skipped. Requires CodeBuddy CLI 2.125.1 or newer.",
// AI MiMo Code (Xiaomi MiMo Code CLI — OpenCode fork)
'ai.mimo.title':'MiMo Code',
'ai.mimo.description':"Xiaomi's MiMo Code CLI, an OpenCode fork. Install it and configure providers in its own config, then select it as an external coding agent.",
'ai.mimo.detecting':'Detecting...',
'ai.mimo.detected':'Detected',
'ai.mimo.notFound':'Not found',
'ai.mimo.path':'Path:',
'ai.mimo.notFoundHint':'Could not find mimo in PATH. Install it or specify the executable path below.',
// AI Grok Build (in-app managed agent — distinct from External MCP client install)
'ai.grok.title':'Grok Build',
'ai.grok.description':"xAI's Grok Build coding agent CLI. Install the Grok CLI, sign in with `grok login` or set XAI_API_KEY, then select it as an external agent.",
'ai.grok.detecting':'Detecting...',
'ai.grok.detected':'Detected',
'ai.grok.notFound':'Not found',
'ai.grok.path':'Path:',
'ai.grok.notFoundHint':'Could not find grok in PATH. Install Grok Build CLI or specify the executable path below.',
'Talk to Grok over Agent Client Protocol (grok agent stdio). Injects Netcatty MCP on session/new. Turn off to use the original headless streaming-json CLI path.',
'ai.grok.runtime.streamingJson.hint':
'Using headless streaming-json (grok -p --output-format streaming-json). Project .grok/config.toml is used for MCP injection.',
// AI Default Agent
'ai.defaultAgent':'Default Agent',
'ai.defaultAgent.description':'Agent to use when starting a new AI session',
'ai.toolAccess.description':'Choose how external agents access Netcatty sessions. MCP exposes the built-in server, while Skills + CLI points agents to the local Netcatty skill and CLI commands.',
'ai.toolAccess.mode.mcp':'MCP',
'ai.toolAccess.mode.skills':'Skills + CLI',
'ai.toolAccess.mcpPrompt.title':'Prompt for your AI client',
'ai.toolAccess.mcpPrompt.description':'Paste this prompt into your AI client (Codex, Claude Code, …) and it will register Netcatty MCP for you.',
'ai.toolAccess.mcpPrompt.enableHint':'Turn on External MCP below to include the launcher path in this prompt.',
'ai.toolAccess.skills.file':'Skill file',
'ai.toolAccess.skills.description':'In Skills + CLI mode, agents are pointed to this local skill file automatically. The Netcatty CLI launcher path is provided to the agent in each session.',
// External MCP (productized catalog MCP for Codex / Claude Code / Cursor)
'ai.externalMcp.title':'External MCP',
'ai.externalMcp.allowCommandOnHost':'Always',
'ai.externalMcp.allowCommandOnHostHint':'Always allow this action on this server.',
'ai.externalMcp.allowAll':'Allow all actions',
'ai.externalMcp.allowSession':'This connection',
'ai.externalMcp.allowSessionHint':'Allow all actions from this client until it disconnects.',
'ai.externalMcp.allowHost':'This server',
'ai.externalMcp.allowHostHint':'Always allow actions on this server.',
'ai.externalMcp.description':'Expose Netcatty as an MCP server for external clients such as Codex, Claude Code, Cursor, and Grok. Uses the same catalog tools as in-app agents (terminal, SFTP, Vault, port forwarding). Keep Netcatty running while clients are connected.',
'ai.externalMcp.sessionsExposed':'Sessions in scope: {count}',
'ai.externalMcp.mode':'Availability mode',
'ai.externalMcp.mode.temporary':'Temporary',
'ai.externalMcp.mode.persistent':'Always on',
'ai.externalMcp.mode.description':'Temporary mode auto-disables after idle timeout. Always-on restores External MCP when Netcatty starts.',
'ai.externalMcp.idleTimeout':'Idle timeout',
'ai.externalMcp.idleTimeout.description':'In temporary mode, disable External MCP after this many minutes with no MCP operations.',
'ai.externalMcp.idleTimeout.minutes':'min',
'ai.externalMcp.focusOnHostOpen':'Focus window on host_open',
'ai.externalMcp.focusOnHostOpen.description':'When an MCP client opens a host, bring the main window to the foreground. Turn off to keep working without interruption.',
'ai.externalMcp.silentSessions.description':'Sessions opened by AI stay out of your tab bar and are not restored after restart. View them anytime from the tray panel.',
'ai.externalMcp.sessionIdleTimeout.description':'Automatically close sessions opened by an AI after this many minutes without terminal or file activity.',
'ai.externalMcp.usage.title':'How to use',
'ai.externalMcp.usage.keepRunning':'1. Turn on External MCP and keep Netcatty running.',
'ai.externalMcp.usage.localhost':'2. Clients connect via the local launcher (127.0.0.1 only). Discovery is removed when you disable the switch.',
'ai.externalMcp.usage.permissions':'3. Write operations follow Settings → AI → Safety (observer / confirm / auto) and the command blocklist.',
'ai.externalMcp.usage.capabilities':'4. Full catalog tools are available: terminal, SFTP, Vault, and port forwarding. Secrets (passwords / private keys) are never returned.',
'ai.externalMcp.security.description':'Listens on 127.0.0.1 with a rotating token, reuses AI Permission Mode for writes, and removes discovery when disabled. No OAuth — this is a local desktop bridge.',
'ai.externalMcp.permissionMode.hint':'Same setting as Settings → AI → Safety. Auto runs Netcatty write tools without Netcatty approval prompts; Confirm asks each time. External clients (Codex / Claude / Grok) may still show their own tool approval UI.',
'ai.externalMcp.status.codexNotFound':'Codex not found',
'ai.externalMcp.status.claudeNotFound':'Claude Code not found',
'ai.externalMcp.status.grokNotFound':'Grok not found',
'ai.externalMcp.status.conflict':'Conflict',
'ai.userSkills.title':'User Skills',
'ai.userSkills.description':'Open the Netcatty skills folder to add your own skill directories. Netcatty scans these skills automatically and injects only lightweight indexes unless a skill clearly matches the current request.',
'ai.chat.undoLastTurnNotice':"Original chat kept. Commands and file changes are not undone. Return to the original chat for saved full outputs and existing background tasks.",
'ai.chat.searchSessionsHint':'Searches titles, prioritizing newer messages and entries. For long messages and tool outputs, only a limited portion at the beginning is searched. This is not full-text search.',
'ai.chat.noMatchingSessions':'No matches in titles or recent retained content',
'ai.chat.noSessions':'No previous sessions',
'ai.chat.forkFromHere':'Fork from here',
'ai.chat.forkCreated':'Branched into a new chat — the original stays in history.',
'ai.chat.retryHint':'You can retry by sending your message again.',
'ai.chat.approvalTimeout':'Tool approval timed out after 5 minutes. You can retry by sending your message again.',
'ai.safety.commandTimeout.description':'Maximum seconds a command can run before being terminated through Netcatty execution.',
'ai.safety.commandTimeout.unit':'sec',
'ai.safety.responseIdleTimeout':'Built-in AI Response Wait',
'ai.safety.responseIdleTimeout.description':'Cancel a built-in AI request after this many seconds without a new response. This setting does not control total response time or command execution.',
'ai.safety.responseIdleTimeout.unit':'sec',
'ai.safety.maxIterations':'Max Iterations',
'ai.safety.maxIterations.description':'Maximum number of AI tool-use loops to prevent runaway execution. External agents may have their own internal iteration limits that take precedence.',
Loaded 100 of 2713 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.