mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 08:31:49 +00:00
178f56455ed2a93dea4f84ca52ce5d6a1f3f476a
1200
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
178f56455e |
fix(terminal): destructure sshDebugLogEnabled in TerminalPane (#1231)
TerminalPane forwards sshDebugLogEnabled to its child at render (L717) but
never destructured it from props, so rendering threw
"ReferenceError: sshDebugLogEnabled is not defined". The prop already exists
in TerminalPaneProps and the memo comparator; only the destructuring was
missing. tsc flags it (TS2304) but the build does not gate on tsc. Introduced
in
|
||
|
|
8376e35022 |
fix: macOS 自动更新装不上(进程退不掉) (#1224)
* fix(auto-update): commit app to quit before quitAndInstall on macOS (#1215) macOS in-place auto-update downloaded and unpacked the new version but never installed it: the app appeared to close, ShipIt never ran, and no restart happened. A full uninstall + reinstall did not help; only a manual DMG replace worked. Root cause is a code-level coordination bug, not the release pipeline. The published mac zips are correctly Developer-ID signed, notarized, and stapled (Team H7WS5L2ML4, consistent across 1.1.17 and 1.1.20), and latest-mac.yml is well-formed — so Squirrel.Mac signature validation passes. The failure is that quitAndInstall() drives app.quit() while two normal-quit behaviors keep the process alive: 1. the main-window close handler hides to tray when close-to-tray is enabled (it only closes when isQuitting is true), and 2. the before-quit dirty-editor guard preventDefault()s the quit for a 5s renderer round-trip. Either keeps the parent process running, so Squirrel.Mac's ShipIt helper — which waits on the parent PID to die before swapping the bundle — lands in launchd "pending spawn / on-demand-only" limbo and the service is removed without installing. This matches the reporter's diagnosis exactly ("ShipIt 没有真正启动安装器", launchd on-demand-only). Fix: before quitAndInstall fires app.quit(), mark the app as quitting for an update via windowManager.setQuittingForUpdate(true). That sets isQuitting (bypassing close-to-tray) and the before-quit handler now returns early when isQuittingForUpdate() is true (skipping the dirty-editor round-trip), so the process exits cleanly and ShipIt can run. The same fix also covers the latent Windows NSIS case where close-to-tray would block an in-place update. If the install never actually quits the app (quitAndInstall throws, or returns without app.quit() on a Squirrel follow-up error / stale download), the quitting-for-update flags are rolled back — synchronously on throw, and via a short unref'd watchdog otherwise — so the app does not get stuck permanently bypassing close-to-tray and the quit guard. Tests: unit tests for the new windowManager flags and for the install handler — ordering (setQuittingForUpdate before quitAndInstall), tray cleanup still runs, no-op when the updater fails to load, rollback on synchronous throw, and watchdog rollback when the app never quits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(auto-update): keep dirty-editor guard during update install setQuittingForUpdate only bypasses close-to-tray (so the window actually closes and Squirrel.Mac's ShipIt can swap the bundle); it must NOT skip the unsaved-work guard, or clicking "Restart Now" with a dirty SFTP editor would silently lose edits. If the user cancels to save, the quit aborts and autoUpdateBridge's watchdog clears the quitting-for-update flags. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(auto-update): clear update-quit state when the quit is cancelled When the user clicks "Restart Now" with a dirty editor open, the before-quit guard cancels the quit (settle "stay"). The update path had already called setQuittingForUpdate(true) (which flips isQuitting=true to bypass close-to-tray for the install), so without clearing it the app stays in a quitting state — close-to-tray and other !isQuitting-gated behavior bypassed — until the 10s watchdog fires. Clear it immediately on the cancelled-quit path (#1215 review). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(auto-update): check for unsaved editors before quitAndInstall (#1215) The previous fix bypassed close-to-tray so the app process actually exits and Squirrel.Mac's ShipIt can swap the bundle, while keeping the before-quit dirty-editor guard as the unsaved-work safety net. But on macOS that net has a hole: quitAndInstall() closes the window FIRST and only then fires before-quit. Once setQuittingForUpdate(true) lets the main window truly close (instead of hiding to tray), the before-quit guard can run after the window is already gone — isReachableByUser is false, so it commits the quit and silently drops unsaved SFTP edits. Fix: move the dirty-editor check to the moment the user clicks "Restart Now", in the install handler, BEFORE setQuittingForUpdate / quitAndInstall — while the window and renderer are still alive: - dirty -> abort the install (don't set the quitting flags, don't quitAndInstall) and broadcast netcatty:update:needs-save so the renderer prompts the user to save and retry. - clean -> proceed with the existing flow (commit-to-quit, tray cleanup, quitAndInstall, watchdog). - no reachable main window / crashed renderer -> install directly (no user to ask), matching the before-quit fail-open path. The before-quit dirty guard is kept as defense-in-depth: if the window is still reachable it re-checks (clean, since we just verified), and if it's already gone it lets the quit through — which is now safe because the install handler already confirmed there were no unsaved editors. The request/reply/timeout round-trip is extracted into a shared helper, electron/bridges/dirtyEditorGuard.cjs (queryDirtyEditors), so the install handler and main.cjs's before-quit guard use one implementation. main.cjs's before-quit is refactored onto it (behavior preserved: sender-filtered reply, fail-open timeout, and the setQuittingForUpdate(false) rollback when the user cancels to save). The needs-save notice is BROADCAST to every window, not just the queried main window: "Restart to Update" can be clicked from the Settings window, which would otherwise see the click do nothing. preload exposes onUpdateNeedsSave; the subscription lives in useUpdateCheck (state layer), and both consumers — App.tsx (main window) and SettingsPage (settings window) — pass an onNeedsSave callback that shows an actionable toast ("save your editors, then click Restart Now again") in en / zh-CN / ru. Also lengthen the quitting-for-update rollback watchdog from 10s to 60s. On macOS quitAndInstall() can return while Squirrel is still pulling the downloaded ZIP from the local update server before it closes the windows; on a large/slow update that can exceed 10s. Clearing isQuitting that early would let the eventual native quit hit a non-quitting close-to-tray handler and strand the install again — the exact #1215 failure. The longer window only fires when the app is realistically stuck, at the cost of close-to-tray staying bypassed a little longer in the rare genuine-failure case. Tests: queryDirtyEditors (result / no-dirty / timeout / wrong-sender / dead or crashed webContents / send-throws / no-ipcMain paths); install handler pre-check (dirty -> no quitAndInstall + needs-save broadcast to all windows; clean -> quitAndInstall runs; no main window -> installs without asking). Existing install-handler tests updated for the now-async handler. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
c5ac85ae5b |
fix: OneDrive 同步 access token 自动续期与失效重连提示 (#1189) (#1208)
* Auto-refresh OneDrive sync token and prompt reconnect on dead refresh token OneDrive cloud sync (#1189) broke for users on 1.1.20 and only recovered after disconnecting and re-authorizing. Two gaps caused this: 1. Refreshed tokens were never persisted. When OneDriveAdapter silently refreshed the access token mid-session, the rotated tokens lived only in the adapter's in-memory state — CloudSyncManager never read them back or saved them. Microsoft consumer refresh tokens rotate on every refresh and invalidate the previous one, so the next app launch loaded a stale, rotated-out refresh token. Eventually that stored token was dead and sync failed, forcing a manual reconnect. Fix: OneDriveAdapter now exposes setOnTokensRefreshed(); the manager wires it so every silent refresh writes the rotated tokens back into provider state and encrypted storage (attachTokenRefreshPersistence / persistRefreshedProviderTokens), keeping the stored refresh token current. 2. A genuinely dead refresh token surfaced as a raw, generic error with no guidance. The bridge now detects invalid_grant / interaction_required / consent_required / login_required on refresh and tags the error with a stable marker. OneDriveAdapter normalizes these to OneDriveReauthRequiredError; the marker survives IPC and error re-wrapping so the condition stays detectable, and the UI strips it to show a clean "OneDrive session expired, please reconnect." message. Shared marker + detection/clean helpers live in domain/sync.ts so the bridge, adapter, and UI use one source of truth. Scope is limited to OneDrive; other providers (Gist/iCloud/Google/WebDAV/S3) are untouched. Tests: OneDriveAdapter refresh-persistence + reauth detection, manager token-persistence wiring, and bridge invalid_grant tagging. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Drop OneDrive to a reconnect state when its refresh token is dead codex review: detecting a dead refresh token was not enough. A provider in `error` state that still holds tokens stays "ready for sync" (isProviderReadyForSync), and syncAllProviders resets such providers back to `connected` and retries — so auto-sync kept hammering the dead refresh token and the user never got a stable reconnect prompt. Now, when a sync/download error indicates OneDrive reauth is required, the manager clears the stale tokens and tears down the cached adapter (handleProviderReauthRequired), leaving the provider in an error state with no credentials. With no tokens, isProviderReadyForSync returns false so auto-sync stops retrying, and the card shows a clean "please reconnect" message with a Connect button. The account is preserved for display; the error message is stripped of the internal marker. Wired into the syncToProvider / uploadToProvider / downloadFromProvider error paths. Added tests for the clear-on-reauth behavior and provider/error scoping. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Clear OneDrive reauth during inspection paths; include service tests in npm test codex review round 2: P2 — A dead OneDrive refresh token can also surface during startup remote inspection and the syncAllProviders preflight conflict check, both of which run through inspectProviderRemoteState. That path swallowed the error into an {error} tuple without clearing the stale tokens, so the provider stayed retryable. Wired the reauth handler into inspectProviderRemoteState's catch, covering sync preflight, syncAll preflight, and startup inspection in one place. Made the handler idempotent so the operation's own catch can also call it without re-saving. P3 — New tests live under infrastructure/services/, which npm test's globs did not cover (the pre-existing syncAllStorageMethods.test.ts was also uncovered). Added infrastructure/services/*.test.ts and infrastructure/services/*/*.test.ts to the test script. Full suite: 1400 tests, 0 failures. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test: drop unmatched services test glob from npm test The npm test script listed both infrastructure/services/*.test.ts and the nested infrastructure/services/*/*.test.ts. No .test.ts files live directly under infrastructure/services/ (the OneDrive adapter and cloudSync tests are in adapters/ and cloudSync/ subdirs), so the flat glob never matched. Under a default POSIX shell (sh/bash without nullglob), an unmatched glob is passed through literally, so node --test received the raw pattern. On Node versions without test-runner glob support this aborts with "Could not find '.../infrastructure/services/*.test.ts'" before any test runs, breaking npm test. Remove the redundant flat glob; the nested glob already covers the new OneDrive adapter and cloudSync tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
c6552ddc75 |
fix: Mosh 模式显示主机信息(stats companion SSH 连接) (#1198) (#1213)
* Show host info for Mosh sessions via a stats companion SSH connection Mosh sessions run over UDP through a local mosh-client PTY and carry no ssh2 connection (session.conn), so getServerStats could not open an exec channel and the terminal's host-info bar (CPU/memory/disk/network) stayed empty — unlike SSH sessions (issue #1198). Add a best-effort, non-interactive companion SSH connection that is opened lazily on the first stats poll for a Mosh session, reusing the credentials the Mosh handshake already validated, and assign it to session.conn so the existing stats path works unchanged: - electron/bridges/sshBridge/moshStatsConnection.cjs: new helper that builds the companion connection. It never prompts (only stored password, parseable private key, unencrypted/stored-passphrase identity files, or ssh-agent), shares one in-flight attempt across concurrent polls, treats auth rejection as permanent but transient errors as retryable, and skips host-key verification like the existing one-off execCommand path. - sessionOps.getServerStats: establish the companion connection for Mosh sessions that lack session.conn before running the stats command; degrades gracefully to the existing "not connected" error otherwise. - moshSession.swapToMoshClient: stash the handshake credentials and algorithm settings on session.moshStatsAuth once the handshake succeeds. - terminalBridge closeSession / cleanupAllSessions and the mosh-client exit handler: tear down the companion connection (it has no session.stream). - Forward legacyAlgorithms / skipEcdsaHostKey / algorithmOverrides through the renderer's Mosh starter and the bridge type so the companion negotiates the same algorithms the interactive session would. Tests cover the helper (auth selection, agent fallback, dedup, permanent vs transient failure, late-ready discard), the getServerStats integration, and the moshStatsAuth stash + companion teardown on close. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Address codex review: target SSH host and settle on mid-handshake close - moshSession: store options.hostname (the SSH endpoint) on moshStatsAuth instead of parsed.host. A `MOSH IP` line advertises the UDP endpoint for mosh-client, which can differ from the SSH host on NAT / multi-homed setups; the companion is an SSH connection and must target the SSH host. - moshStatsConnection: resolve the pending attempt from the "close" handler when the socket drops mid-handshake without a prior "ready"/"error", so an awaiting getServerStats call (and session.moshStatsConnPromise) cannot hang indefinitely. Treated as transient so the next poll may retry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Address codex review: keyboard-interactive password for stats companion PAM-backed SSH servers often offer password auth only via keyboard-interactive, not the plain "password" method. The Mosh handshake's system ssh handles that through its PTY responder, so without it the companion stats connection would fail auth on those hosts even with a saved password, leaving the stats bar empty. When a saved password is present, enable tryKeyboard and attach a non-interactive keyboard-interactive handler that auto-fills the password for a single password prompt (using the existing isAutoFillablePasswordChallenge predicate) and finishes empty on 2FA/OTP/multi-prompt challenges. It auto-fills at most once so a wrong password can't drive a retry loop, and it never shows a modal — the companion stays fully non-interactive. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Address codex review: verify host key before sending a saved password A background companion connection that auto-submits a saved password to an unverified host could disclose it to a spoofed / MITM server (P1). Gate password auth (plain and keyboard-interactive) behind a silent, trusted-only host-key check against Netcatty's known-hosts store: - moshStatsConnection: when the companion would authenticate with a password, attach an ssh2 hostVerifier that accepts only a key already "trusted" in known-hosts (via hostKeyVerifier.classifyHostKey) and rejects unknown/changed keys outright — no prompt, so the password is never sent to an unvetted host and no host-key dialog pops for a background poll. Public-key / agent auth proves possession via a signature and discloses no reusable secret, so it is not gated (matches the existing execCommand precedent; the handshake already vetted the host via system ssh). - Thread knownHosts through the renderer Mosh starter, the bridge type, and session.moshStatsAuth. Note: a password-auth Mosh host that Netcatty has never seen via its own SSH path (so it is absent from Netcatty's known-hosts) will not get the stats companion until its key is known — the safe default. Key/agent-auth hosts are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Address codex review: transient pre-handshake polls and agent+password auth Two functional gaps in the stats companion: - Missing moshStatsAuth is now transient, not permanent. The renderer can mark a Mosh session "connected" (and start polling) from the SSH bootstrap's visible PTY output before the swap to mosh-client assigns moshStatsAuth. Previously that first poll set moshStatsConnFailed permanently, so the companion was never attempted after the handshake actually completed. Now it just returns null and a later poll retries. - A saved password no longer suppresses ssh-agent auth. A public-key host that authenticates via the agent may still carry a stored password; the companion now offers the agent alongside the password (ssh2 tries agent first) instead of attempting password-only and failing permanently. An explicit private key still suppresses the agent fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Address codex review: gate password at authHandler, not whole connection The previous fix installed a trusted-only hostVerifier whenever a password was present. Because ssh2 verifies the host before any auth method, that rejected the entire connection on a host absent from Netcatty's known-hosts — blocking key/agent auth too, even though those never need to send the password. Move the gate from the transport to the auth layer: - A trust-tracking hostVerifier records whether the live host key is trusted (during the transport handshake) and then accepts the transport so public-key / agent auth can proceed on any host. - A function-form authHandler offers none -> agent -> publickey always, and appends password + keyboard-interactive only when the host key is trusted. Result: key/agent auth works on hosts Netcatty hasn't vetted, while a saved password is still never sent to an untrusted host. Public-key / agent auth remains ungated (no reusable secret is disclosed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Address codex review: isolate Mosh stats connection from session.conn Storing the stats companion on session.conn made it look like the session's primary interactive SSH connection. Other bridges key off session.conn — getSessionPwd assumes its exec channel is a sibling of the interactive shell, and SFTP / MCP exec run over session.conn — but a Mosh session's shell lives on the UDP mosh-client, not this background connection. After a stats poll they could return a bogus cwd or operate over the wrong connection. Keep the companion strictly on session.moshStatsConn: - ensureMoshStatsConnection stores/reuses/clears only session.moshStatsConn. - getServerStats reads session.conn || session.moshStatsConn (real SSH still uses conn; Mosh uses the companion) and only opens one when neither exists. - closeSession / cleanupAllSessions / the mosh-client exit handler tear down session.moshStatsConn. This leaves session.conn untouched for Mosh, so getSessionPwd / SFTP / MCP exec behave exactly as before (no primary SSH connection for Mosh). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Address codex review: don't count pre-handshake Mosh polls as failures useServerStats gives up after 3 consecutive failures. A Mosh session can be marked "connected" (and start polling) from the SSH bootstrap's visible output before swapToMoshClient stores moshStatsAuth, during which ensureMoshStatsConnection returns null. Previously getServerStats reported that as a normal failure, so a handshake taking ~15s (3 polls) would permanently disable stats for the session even after credentials became available. Introduce a `pending` result: - getServerStats returns { success: false, pending: true } for a Mosh session that has no connection yet and no moshStatsAuth and hasn't permanently failed. Once moshStatsAuth is set (or the companion permanently fails), it reports a normal failure again. - useServerStats treats `pending` as neutral: it does not update stats and does not increment the consecutive-failure counter, so polling continues until the handshake completes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Address codex review: verify host key for all Mosh stats companion auth The companion installed a trust-tracking host verifier only when a saved password was present; key/agent-only connections fell back to ssh2's default of accepting any host key. A background, user-invisible connection that authenticated against an unverified host could let a MITM/DNS-spoofed host feed bogus host-info to the user and enumerate the ssh-agent's public keys — breaking the host-key guarantee the interactive session enforces. Attach the host verifier for every auth method and reject an unknown or changed host key outright (never prompting; stats just stay empty). Treat an untrusted host as a permanent failure so polling stops reconnecting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(mosh): trust system known_hosts for the stats companion host-key check The Mosh stats companion opens a background ssh2 connection and only rides on a host whose live key is already trusted, rejecting unknown/changed keys as a permanent failure. Trust was sourced solely from Netcatty's in-app known-hosts snapshot (options.knownHosts). But a Mosh session is bootstrapped by the system `ssh`, which vets and records the host key in the user's OpenSSH known_hosts (~/.ssh/known_hosts, etc). Netcatty's snapshot is never updated by that handshake, so a host trusted purely via system ssh was misread as "unknown" and the companion permanently disabled — Mosh stats never appeared unless the user manually scanned/imported the host into Netcatty (codex P2). Add a system-known_hosts trust source (systemKnownHosts.cjs) and consult it in the companion verifier when the in-app snapshot does not already vouch for the key. Matching is by the LIVE key's SHA-256 fingerprint, so trust is granted only for the exact key the user's own OpenSSH already trusts; an arbitrary or mismatched key is never accepted. Unknown/changed keys stay rejected and remain a permanent failure. The parser handles the OpenSSH known_hosts(5) format that the in-app scan parser does not fully cover for matching: plain hosts, comma lists, [host]:port, hashed |1|salt|HMAC-SHA1(salt,token) entries (with the bracketed token for non-default ports, verified against ssh-keygen -H), multiple key types, @revoked (forces NOT trusted) and @cert-authority (skipped). Wildcard/negation patterns are deliberately not honored. Paths mirror localFsBridge.readKnownHosts and are cross-platform (incl. Windows %PROGRAMDATA%\ssh\known_hosts). All errors fail closed. ssh2 ships no known_hosts parser, so this is implemented in CommonJS using node:crypto and covered by unit tests (real ssh-keygen hashed fixtures, revoked/cert-authority, fingerprint mismatch, fail-closed) plus companion integration tests (system-only trust accepts; neither source trusts -> rejected + permanent; key rotation not rescued; optional-dependency safety). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
c37e087332 | Merge pull request #1209 from binaricat/feat/duplicate-tab-reuse-session-1204 | ||
|
|
85f486e6cd |
feat(ssh): reuse authenticated connection for Copy Tab to skip re-MFA
Duplicating an SSH tab ("Copy Tab") used to open a brand-new SSH
connection, forcing a second MFA prompt on hosts with multi-factor auth.
Like Tabby's session multiplexing, open a new shell *channel* on the
source tab's already-authenticated connection instead, so the duplicate
reuses the existing transport and skips key exchange + authentication.
- copySession records the source session id (reuseConnectionFromSessionId)
for connected, non-mosh SSH sessions; it is threaded down to the SSH
bridge as options.sourceSessionId.
- startSession.cjs gains a reuse path that opens conn.shell() on the
source connection. The shell wiring is extracted into a shared
setupShellSession helper used by both the fresh and reuse paths.
- Connection lifecycle is reference-counted via a new sshConnectionPool
module (mirrors Tabby ref/unref/destroy): the shared transport + jump
host chain are torn down only when the last channel closes, so closing
a copy — or the original while a copy is open — never kills siblings.
terminalBridge.closeSession routes SSH teardown through the same release.
- Reuse falls back to a fresh connection when the source is gone, and is
skipped for X11 hosts (X11 is negotiated per channel).
Tests: sshConnectionPool refcount unit tests, bridge reuse integration
tests (reuse vs fresh, sibling survival, X11 skip, fallback), and
terminalBridge close lifecycle tests.
Refs #1204
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
||
|
|
2c96773679 |
Merge pull request #1207 from binaricat/fix/autocomplete-popup-overflow-1202
fix(autocomplete): 补全弹窗边界翻转 + 配色跟随强调色 (#1202) |
||
|
|
a8f9fd7a56 |
fix(autocomplete): make popup panels border-box for exact width clamp
Codex P2: the panel maxWidth constants used by the horizontal clamp's totalWidth excluded each panel's padding + border (inline styles default to content-box), so a padded detail tooltip at its 280px max could still render wider than reserved and spill off-screen. Set box-sizing: border-box on the shared panel style so every maxWidth is the true outer width and totalWidth is exact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
aae4ad4da8 |
Merge pull request #1206 from binaricat/fix/topbar-ai-toggle-1194
顶部 AI 按钮支持 toggle 收起,移除无用的提醒按钮 |
||
|
|
014d7b4d39 |
fix(autocomplete): reserve popup detail space per-set to avoid hover jump
Codex P2: totalWidth and the vertical height reservation depended on the hovered/selected item's detail panel, so moving the mouse between a no-detail row and a detail row could change the clamped position and shift the popup under the pointer (flicker, unreliable clicks near the edge). Reserve detail-panel width/height from a set-level flag (any non-path row with a description) so placement stays stable while hovering; the tooltip itself still renders only for the active row. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
20bfa0e3bd |
fix(autocomplete): keep completion popup inside the window and follow accent
The terminal completion popup could spill past the window edges and ignored the theme accent color (#1202): - Horizontal: the left-edge clamp only reserved the main list width (400px), so expanding a directory near the right edge pushed the cascading sub-dir panels and the detail tooltip off-screen. Now the clamp accounts for the full assembly width (main list + sub-dir panels + detail tooltip) and pins to the left padding when it is wider than the viewport. - Vertical: extracted the flip/clamp math into a pure, unit-tested computeAutocompletePopupPlacement() so "not enough room below -> flip up and bound the height" is verifiable. The detail tooltip is now height- bounded and scrolls instead of overflowing for long snippet descriptions. - Accent: the selected/hover row background and the active-row accent rail now derive from the active terminal theme's cursor/selection colors (which track the user's accent setting) instead of a hardcoded blue. Adds terminalAutocompleteLayout.test.ts covering downward/upward placement, bottom-of-viewport flip, height clamping, and horizontal clamping. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
41ebe0fa64 |
Make top-bar AI button toggle the side panel and drop reminder button
The top-bar AI button previously dispatched netcatty:toggle-ai-panel,
which was wired to handleOpenAI -> handleSwitchSidePanelTab('ai'). That
switch is a no-op when AI is already the open sub-panel, so the panel
could not be dismissed by clicking the button again.
Add a dedicated handleToggleAiFromTopBar that routes through a new
resolveAiSidePanelToggleIntent helper: a second click on an already-open
AI panel closes the side panel, while a click from a closed panel or a
different sub-panel switches to AI. The top-bar event listener now uses
this toggle handler. handleOpenAI stays a plain switch so the AI icon in
the side-panel rail remains idempotent like the other rail tabs.
Also remove the non-functional reminder (bell) button from the top bar;
it had no click handler and no backing feature.
Refs #1194
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
||
|
|
66cf610cc0 |
feat(distro): add Alibaba Cloud Linux (alinux) icon and detection
Alibaba Cloud Linux hosts (os-release ID="alinux") previously showed the
generic Linux icon because normalizeDistroId fell through to the catch-all
`linux` branch ('alinux'.includes('linux') is true).
- Add a dedicated `alinux` branch in normalizeDistroId, matching the
os-release ID, the legacy `aliyun` ID, and the NAME/PRETTY_NAME text
"Alibaba Cloud Linux"; place it before the generic linux fallback.
- Register `alinux` in LINUX_DISTRO_OPTIONS so it is selectable in the
manual distro override and classified as linux-like.
- Add the brand SVG (public/distro/alinux.svg) plus logo/color mappings
in DistroAvatar (brand color #FF6A00).
- Add the localized label in en / ru / zh-CN.
- Cover normalizeDistroId's alinux cases (ID, legacy aliyun, PRETTY_NAME)
with unit tests, including a regression guard against the generic linux
fallback.
Icon source: simple-icons "Alibaba Cloud" mark (CC0-1.0, public domain),
matching the existing distro icon set already sourced from simple-icons.
Closes #1200
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
||
|
|
2e66bcf254 | fix: hover feedback for window controls | ||
|
|
afe959835d | Add SSH debug log setting | ||
|
|
1e94fe983f | Fix terminal wheel font zoom capture | ||
|
|
0efe80b06d | Balance vault sidebar spacing | ||
|
|
c7e4ac82ca | Fix snippet editor focus outline | ||
|
|
d5e29598d3 | Merge main into PR 1183 and address review | ||
|
|
fca7782634 | Remove vault content left margin (#1187) | ||
|
|
4bf4e65df8 | fix(keychain): enhance key management UI with copy, edit, and delete actions (#1182) | ||
|
|
45e62ed43e | feat(snippets): add SnippetScriptEditor component and update usage in dialogs | ||
|
|
0fa926de26 | Polish vault UI (#1177) | ||
|
|
3c4746aea0 |
[codex] add sync reliability metadata (#1174)
* feat: add sync reliability metadata * fix: preserve tombstones from checked remotes * fix: keep conflict change counts typed |
||
|
|
463dd4464f |
[codex] add cloud sync strategies (#1171)
* feat: add cloud sync strategies * chore: clarify cloud sync strategy options * chore: keep selected sync strategy concise * fix: sync cloud-wins payload to remaining providers * fix: apply cloud sync strategy during startup * fix: retry partial startup cloud syncs |
||
|
|
63b95bb68e | [codex] add terminal font size shortcuts | ||
|
|
ea41389842 | Fix Ruijie network device detection (#1168) | ||
|
|
55faae767a |
feat(vault): show/hide toggle for the host Telnet password (#1164)
* feat(vault): show/hide toggle for the host Telnet password Issue #1099 (part 2): the host-level Telnet password field was a bare type="password" with no way to reveal it. Add an eye toggle matching the SSH password field and the group-level Telnet password. Refs #1099 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(vault): reset Telnet password reveal when the edited host changes HostDetailsPanel is reused across hosts without remounting, so the new showTelnetPassword state has to be cleared in the initialData effect alongside showPassword — otherwise revealing one host's Telnet password leaves the next host's shown unmasked. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
94b8f298ae |
feat(vault): connect with the host's default protocol, prompt only for Telnet (#1163)
Issue #1099: a Telnet host shows the protocol picker on every connect. Connect resolution is now explicit, and the picker only appears when it's genuinely a choice: - Telnet set as default (protocol = telnet) -> connect Telnet (single-click and batch) - Telnet enabled but not the default -> show the picker (unchanged) - Mosh enabled -> connect Mosh - otherwise -> connect SSH A "Connect with Telnet by default" switch in the Telnet card sets the host's primary protocol. SSH+Mosh hosts now connect Mosh directly instead of prompting every time. Addresses part 1 of #1099. Refs #1099 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
1ef3f9f979 |
feat(vault): batch-connect selected hosts (#1162)
The multi-select toolbar already supported batch delete; add a "Connect" button next to it so connecting many hosts no longer has to be done one by one. Connects each selected host in list order with its configured protocol (multi-protocol hosts use their default rather than prompting per host). Closes #870 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
e88313eb84 |
fix(sftp): confirm delete/overwrite dialogs on Enter key (#1160)
The delete and overwrite confirmation dialogs are opened from a context menu, whose focus-return could leave focus outside the dialog, so pressing Enter did nothing. Focus the confirm button when each dialog opens via onOpenAutoFocus so Enter activates it. Esc and Tab+Enter behavior is unchanged. Fixes #1150 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
03cd9bc968 | feat(snippets): implement snippet variable handling and UI prompts (#1159) | ||
|
|
4d7c56e537 | 主机备注功能与脚本编辑体验优化 (#1158) | ||
|
|
1fec5925eb | Refactor large modules and fix runtime errors (#1136) | ||
|
|
23d4b342b9 |
fix(vault): flat Vaults tab selection + fill host grid beside side panel (#1134)
- TopTabs: the Vaults root tab no longer paints an active background fill when selected (text/icon still brighten). Clear the imperatively-set hover fill on click so it can't get stuck when active bg stays transparent. - VaultView: when the host side panel is open, drive the grid column count from the container width as a fixed N columns instead of viewport-based grid-cols-* (which can't see the narrowed area) or auto-fit+1fr (which stretched a lone card across the whole row). Fills the row with no trailing gap and keeps a single card at one column's width. The count rides on a CSS variable set imperatively via ResizeObserver, so reflowing the grid never re-renders this large component. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
456ddcfe68 |
chore(ai): upgrade ACP packages and unwrap Skill+CLI command in tool-call panel (#1128)
* chore(ai): upgrade ACP packages and unwrap Skill+CLI command in tool-call panel
Package bumps:
- @zed-industries/claude-agent-acp 0.22.2 → @agentclientprotocol/claude-agent-acp 0.37.0
(old npm package is deprecated; scope rename)
- @zed-industries/codex-acp 0.10.0 → 0.15.0
- @mcpc-tech/acp-ai-provider 0.2.8 → 0.3.3
- electron-builder asarUnpack glob + bridge require.resolve switched to the new scope
After the upgrade Codex tool-call cards started showing the local
worktree path for every step — "Run /Users/.../netcatty-tool-cli session
--session …" — instead of the remote command. Three things lined up:
1. The new acp-ai-provider maps ACP's `title` to `toolName`, and Codex's
title is the full shell invocation it's about to run.
2. Codex local_shell ships args as ["/bin/zsh","-lc","<full>"], so the
old `typeof args.command === 'string'` branch in ToolCall never fired
and we fell through to printing `name` (i.e. the title).
3. The bridge serializes tool args under `args`, but the ACP adapter
only read `event.input`, so even when args were available the
renderer received {}.
Fixes:
- acpAgentAdapter: read tool input from both `event.input` and
`event.args` so bridge-serialized chunks and direct AI SDK chunks
both work.
- ai-elements/tool-call: new extractDisplayCommand() unwraps the shell
array, then the netcatty-tool-cli wrapper (exec/job-start … -- <cmd>),
and renders the real remote command. session/env/job-poll/etc. fall
back to short labels ("netcatty: inspect session", …) instead of
exposing the binary path.
- shellUtils.cjs: defensive JSON-parse the ACP wrapper input in case
the AI SDK ever stops auto-parsing it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(build): exclude bundled Claude CLI binaries from the installer
@anthropic-ai/claude-agent-sdk@0.3.x bundles the native Claude Code CLI
(~211MB per arch) as optional sibling packages. Including them would
silently regress Netcatty's "bring your own Claude" design — the project
has always required users to install Claude Code locally, and the entire
path-discovery flow exists precisely to honor that contract:
- useAgentDiscovery.ts scans the user's PATH for `claude` and writes
the absolute path into the agent config's CLAUDE_CODE_EXECUTABLE env.
- aiBridge.cjs runs normalizeClaudeCodeExecutableEnvForAcp on every ACP
spawn, forwarding the env var to the child process.
- The @agentclientprotocol/claude-agent-acp wrapper's claudeCliPath()
(acp-agent.js) prefers process.env.CLAUDE_CODE_EXECUTABLE over the
bundled binary and only falls back to sibling-package resolution when
the env var is empty.
So the right place to enforce the design is electron-builder: exclude
node_modules/@anthropic-ai/claude-agent-sdk-* from `files`. Dev mode is
unaffected (optional deps still install for `npm run dev`); only the
packaged installer drops the binaries, saving ~150MB. Users without
Claude Code installed get the same SDK error they got pre-upgrade.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
0f8aa08994 |
(fix) autocomplete popup visible after sending command (#1121)
Co-authored-by: pyroch <cvdysh@gmail.com> |
||
|
|
fb522c5016 |
fix(ai): keep chat input toolbar on one row when sidebar is narrow (#1122)
When the AI sidebar is dragged narrow, the model chip used to wrap to its own line (and the perm chip to a third line), wasting vertical space. Switch the toolbar from flex-wrap to a single-row flex container where the +/perm chips stay shrink-0 and the model chip absorbs all the squeeze via min-w-0, letting the existing truncate kick in and ellipsize the model label instead of wrapping. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
7272f2564d |
fix(ssh): per-host skipEcdsaHostKey toggle + advanced algorithm overrides (#1027) (#1116)
* fix(ssh): per-host skipEcdsaHostKey toggle + advanced algorithm overrides (#1027) #1027 reported an old Huawei S7706 (SSH banner `SSH-2.0--`, empty software-version field) where the legacy-algorithms toggle still couldn't get a connection through. The debug log shows the handshake makes it through every negotiation step, picks `ecdsa-sha2-nistp521` for the host key, then dies at: Handshake failed: signature verification failed i.e. ssh2's strict RFC verifier rejects the ECDSA signature the switch produces. OpenSSH on the same machine connects because its known_hosts is already pinned to an RSA fingerprint, so it never advertises ECDSA in the first place. This adds two layers of escape hatch: A. `host.skipEcdsaHostKey` (one-click) — drops every `ecdsa-sha2-*` from the offered host-key list. Forces the fallback to ssh-rsa / ssh-dss / ssh-ed25519 that those old stacks implement correctly. Wired through ssh / sftp / port-forwarding bridges, inheritable from the group default. B. `host.algorithms` (advanced) — per-category override lists (`kex`, `cipher`, `hmac`, `serverHostKey`, `compress`). When a category's array is non-empty, it fully replaces the negotiated list for that category. Exposed in a collapsible "Advanced algorithm overrides" panel on both host and group settings, inspired by Tabby's per-profile algorithm UI. Empty arrays normalize to "use default" so picking zero algorithms in a category doesn't bench the connection with "no matching algorithm". Overrides apply BEFORE `skipEcdsaHostKey` so the latter stays an unconditional kill switch even if the user explicitly puts `ecdsa-*` back into the host-key list. Behavior with default values (neither toggle set, no override list) is identical to before — zero change for hosts that aren't opted in. Tests cover the new options on both `buildAlgorithms` and `buildSftpAlgorithms`, plus group→host inheritance for both fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ssh): address Codex review on #1116 — proper seed + jump-host carry + missing call sites Four review findings from the Codex pass on #1116, all real: 1. AlgorithmOverridesPanel was seeding the first customization in a category from `SUPPORTED_ALGORITHMS_BY_CATEGORY`, which contains legacy algorithms (CBC, arcfour, MD5, ssh-dss, group1-sha1...). Unchecking a single modern algorithm in a host that had legacy mode *off* would silently start offering those legacy algorithms. Now seeds from `effectiveDefaultAlgorithms(legacyEnabled)`, mirroring what `buildAlgorithms` actually emits at connect time. - New `effectiveDefaultAlgorithms` pure helper in `domain/sshAlgorithmList.ts` with its own test suite (also asserts the modern subset contains no SHA-1 KEX / CBC / arcfour / MD5) - `AlgorithmOverridesPanel` takes a `legacyEnabled` prop - `isChecked` now reflects the effective-default state for an untouched category, so unchecked rows visually represent algorithms the connection wouldn't currently advertise 2. The chain-mode jump-host loop in `sshBridge.cjs` was applying the target host's `skipEcdsaHostKey` / `algorithmOverrides` to every bastion hop, which is wrong when the bastion has its own settings. This was actually a pre-existing issue with `legacyAlgorithms` too — `NetcattyJumpHost` simply didn't carry any of these fields. - `NetcattyJumpHost` gains `legacyAlgorithms`, `skipEcdsaHostKey`, `algorithmOverrides` - `createTerminalSessionStarters` populates them from each jump host's own configuration - The jump-host bridge call now reads `jump.* ?? options.*` so a hop with its own setting wins, but unset hops still fall back to the target's settings (preserves historic chain-wide behavior when nothing is overridden) 3. `infrastructure/services/portForwardingService.ts` only forwarded `legacyAlgorithms` to the port-forwarding bridge, so a host that needed the ECDSA skip or advanced overrides could connect through the terminal but its auto-start tunnels would still hit the original handshake failure. - Forward `skipEcdsaHostKey` and `algorithmOverrides` at the target call site and at the jump-host map. 4. `application/state/sftp/useSftpHostCredentials.ts` built `NetcattySSHOptions` for `openSftp` without any of the algorithm fields — and on inspection it didn't even forward `legacyAlgorithms` to begin with, so SFTP panes for legacy-mode hosts were silently negotiating with the modern default list. Same gap at the jump-host map. - Forward all three fields at both the target and the jump-host map. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * polish(hosts): make the advanced-algorithm collapsible trigger a real button The first cut used a plain underlined caption for the "Advanced algorithm overrides" collapsible trigger. That blends into the surrounding helper text and doesn't read as an interactive control — users couldn't tell that the per-category checkbox editor was reachable at all. Match the project's existing collapsible-trigger pattern (see `SerialConnectModal`): full-width ghost Button, label on the left, ChevronDown / ChevronUp on the right that flips with open state, controlled via `useState`. Applied in both `HostDetailsPanel` and `GroupDetailsPanel`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * polish(hosts): rename Legacy Algorithms card to SSH Algorithms; split Backspace into its own section The card now carries three algorithm controls (Allow Legacy / Skip ECDSA / Advanced overrides) plus a Backspace Behavior dropdown that doesn't belong with the rest. Two cleanups: 1. Rename the card from "Legacy Algorithms" to "SSH Algorithms". The original title only described the first toggle; the section now covers the whole algorithm-negotiation surface, including the ECDSA host-key skip and the per-category override editor. - i18n key renamed `hostDetails.section.legacyAlgorithms` -> `hostDetails.section.sshAlgorithms` in zh-CN / en / ru - `HostDetailsPanel` references the new key 2. Move the Backspace Behavior control out of the algorithm card. - `HostDetailsPanel`: new dedicated "Terminal Behavior" card (TerminalSquare icon) placed between SSH Algorithms and Keepalive. New i18n key `hostDetails.section.terminalBehavior`. - `GroupDetailsPanel`: no separate Card scaffolding for group defaults — moved Backspace to the bottom of the SSH section (after Mosh) so it visually separates from the algorithm block above without introducing a new card heading. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(sftp): per-hop algorithm settings in SFTP chain (Codex review on #1116) `sshBridge.cjs`'s jump loop already reads `jump.* ?? options.*` for the three algorithm fields, but `sftpBridge.cjs#connectThroughChainForSftp` was missed in that change and still applied the target host's `options.legacyAlgorithms` / `skipEcdsaHostKey` / `algorithmOverrides` to every bastion. A bastion that needed the ECDSA skip or a custom algorithm list while the target didn't would still fail the SFTP handshake before reaching the target. Mirror the sshBridge fix: read each setting from the jump host first, falling back to the target options when the hop didn't override. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ssh): keychain SSH exec + advanced editor seed honor inherited algorithm settings Two findings from a local Codex review pass on the branch: 1. The keychain "export public key to host" flow opens its own one-off SSH connection through `sshBridge#execCommand`, but the connectOpts built there didn't include any `algorithms`. ssh2 then negotiated with its built-in modern defaults regardless of what the host had set, so a host that needs the ECDSA skip (or legacy mode) would connect in the terminal but the keychain export would fail with the original signature-verification error. - `sshBridge.cjs#execCommand` now sets `algorithms` from `payload.legacyAlgorithms` / `skipEcdsaHostKey` / `algorithmOverrides`, mirroring `startSSHSession`. - `useKeychainBackend`'s `execCommand` typing gets the three new optional fields. - `KeychainManager` forwards the host's `legacyAlgorithms`, `skipEcdsaHostKey`, and `algorithms` when invoking the export. 2. The Advanced Algorithm Overrides editor seeded its first customization from `form.legacyAlgorithms`, which is the host's own field — it doesn't reflect a value the host *inherits* from its group's default. A user in a group with `legacyAlgorithms=true` editing a host that hadn't explicitly set the flag would see the editor seed in modern-only mode, and saving could silently drop the legacy algorithms the host actually needed. - `HostDetailsPanel` passes `form.legacyAlgorithms ?? groupDefaults?.legacyAlgorithms`. - `GroupDetailsPanel` adds an `inheritedLegacyAlgorithms` memo resolved from the parent group chain via `resolveGroupDefaults`, and the editor uses `form.legacyAlgorithms ?? inheritedLegacyAlgorithms`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(keychain): export-public-key honors group-inherited algorithm settings Second-pass Codex review on PR #1116 flagged that the keychain "export public key to host" flow now carries the three algorithm fields end-to-end, but only reads them from `exportHost.*` directly — which doesn't reflect values the host inherits from its group's defaults. A host that left `legacyAlgorithms` / `skipEcdsaHostKey` / `algorithms` unset but sat inside a group that turned them on would work fine in the terminal (the terminal starter applies group defaults before sending the IPC payload) but its keychain export would silently fall back to ssh2's modern defaults and hit the original signature-verification failure. Resolve the effective host with `applyGroupDefaults` + `resolveGroupDefaults` before the `execCommand` call, then read the algorithm fields off the effective host. Requires plumbing `groupConfigs` into `KeychainManager` (added as an optional prop, forwarded by `VaultView`). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(host-details): algorithm-overrides editor reads currently selected group's defaults Third-pass Codex review caught that the editor seed was reading from the `groupDefaults` prop, which is whatever group the host belonged to when the panel opened. If a user switched the host into a different group inside the panel and then opened the Advanced Algorithm Overrides collapsible before saving, the editor would seed from the old group's `legacyAlgorithms` flag and could save the wrong list. The panel already memoizes `effectiveGroupDefaults` from `form.group`/`defaultGroup`/`groupConfigs` for exactly this kind of re-resolution (used by theme/font effective lookups). Read the inherited flag from there instead of the stale prop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(algorithms): trim UI cipher list to algorithms ssh2 actually supports Fourth-pass Codex review flagged that `SUPPORTED_CIPHER_ALGORITHMS` included `blowfish-cbc`, `cast128-cbc`, and the `arcfour*` family, but OpenSSL 3 disabled those primitives, so ssh2's `canUseCipher` filter drops them from `SUPPORTED_CIPHER` at startup. Selecting any of them in the Advanced Algorithm Overrides editor would make `ssh2.Client.connect()` throw `Unsupported algorithm` synchronously, turning the override into a "host now unreachable" footgun instead of a narrowing knob. Realigned each `SUPPORTED_*_ALGORITHMS` list to ssh2's actual `SUPPORTED_*` constants: - `SUPPORTED_CIPHER_ALGORITHMS`: dropped blowfish / cast128 / arcfour; added the no-suffix `aes128-gcm` / `aes256-gcm` variants ssh2 also accepts. - `SUPPORTED_KEX_ALGORITHMS`: added `diffie-hellman-group15-sha512` and `diffie-hellman-group17-sha512` (present in ssh2 but missing from the UI list); reordered to ssh2's canonical order. - `SUPPORTED_HMAC_ALGORITHMS`: reordered so the ETM/SHA-2 grouping matches ssh2's `DEFAULT_MAC` and lookups are predictable. Locked the invariant in `sshAlgorithmList.test.ts` with a new test that asserts every UI-offered algorithm is a member of ssh2's `SUPPORTED_*` for its category. A future ssh2 bump that drops an algorithm we still expose will fail this test instead of silently becoming a connect-time error for users. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(algorithms): run KEX override through the runtime fixed-DH filter Codex round-N flagged a gap in `applyAlgorithmOverrides`: when the user supplies a custom KEX list via the advanced editor, the previous implementation copied it verbatim into the negotiated `algorithms.kex` field. The default builder already passes its KEX list through `filterSupportedFixedDhKex` to drop fixed-DH groups the runtime doesn't support (notably `diffie-hellman-group1-sha1` on Electron/BoringSSL, which lacks modp2), but the override path bypassed that filter — so an Electron user enabling legacy mode and saving any KEX checkbox state would re-advertise group1-sha1 and the handshake would crash with "Unknown DH group" instead of failing fast. Apply the same `filterSupportedFixedDhKex` to the override list. New test in `sshAlgorithms.test.cjs` exercises a simulated BoringSSL runtime that lacks modp2 and asserts the override-filtered KEX no longer includes group1-sha1, while group14-sha1 / group-exchange-sha1 remain. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(algorithms): run HMAC override through the FIPS MD5 filter Codex flagged the same runtime-bypass pattern Round-N-1 fixed for KEX, now in HMAC: `applyLegacyHmacAlgorithms` gates `hmac-md5` behind `md5Supported()` so FIPS Node builds don't get it, but the UI's `effectiveDefaultAlgorithms(true)` seed adds `hmac-md5` / `hmac-md5-96` unconditionally. A user with legacy mode on who saves any HMAC checkbox change would push those MD5 entries through `applyAlgorithmOverrides`, which previously copied the override verbatim — bypassing the FIPS gate and making ssh2 throw "Unsupported algorithm" before negotiation. New `filterRuntimeUnsupportedHmac` helper applies the same `md5Supported()` gate to a user override. `applyAlgorithmOverrides` routes the HMAC override through it (mirrors how the same function already routes KEX overrides through `filterSupportedFixedDhKex`). New test simulates a FIPS-disabled MD5 runtime and asserts MD5 variants drop from the final HMAC list while SHA-1 / SHA-2 entries remain. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ssh): jump-host overrides no longer inherit the leaf's algorithm overrides Codex flagged that the jump-loop fallback I added for chain convenience applied the target's per-host \`algorithmOverrides\` to every bastion whose own override wasn't set, which is wrong: a target restricted to e.g. \`serverHostKey: [\"ssh-rsa\"]\` would lock the hop to ssh-rsa too and break negotiation against an Ed25519-only bastion. The fallback IS still correct for \`legacyAlgorithms\` and \`skipEcdsaHostKey\` — those are append/safety toggles that widen the offered list, so propagating them to a bastion is safe and matches the historic chain-wide behavior of \`options.legacyAlgorithms\` (single-toggle convenience for a chain with one old leaf). Treat \`algorithmOverrides\` strictly per-host instead. Same change in both \`sshBridge.cjs\` and \`sftpBridge.cjs\` jump loops, with a comment block explaining the asymmetry so a future refactor doesn't "clean up" the distinction. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ui(host-details): surface inherited algorithm overrides in the advanced editor Codex flagged a real gap in the inheritance model: when a parent group has set algorithm overrides (e.g. \`algorithms.kex: [...]\`), a host or child group under it can't simply Reset a category back to NetCatty's defaults — \`applyGroupDefaults\` treats an unset host field as "inherit", so the local Reset falls back to the group's list rather than to ssh2's defaults. Cleanly distinguishing "reset to NetCatty defaults" from "inherit from group" needs a new schema field or sentinel, which is a non-trivial design change well beyond the scope of this PR. For now, surface the situation in the UI so the user understands why Reset doesn't behave the way they might expect and where to go to actually clear the restriction: - \`AlgorithmOverridesPanel\` accepts an optional \`inheritedFromGroup\` prop and, when populated, renders a blue inline notice listing the inherited categories and directing the user to the group's algorithm settings if they need to opt out. - \`HostDetailsPanel\` passes \`effectiveGroupDefaults?.algorithms\`. - \`GroupDetailsPanel\` adds a new \`inheritedAlgorithmOverrides\` memo that resolves the same way the existing \`inheritedLegacyAlgorithms\` does, and forwards it. - i18n strings added in zh-CN / en / ru. Follow-up (out of scope for this PR): if real users do hit this, introduce a \`host.algorithms = null\` (or explicit \`algorithmsOverride: boolean\`) sentinel and a Reset-to-defaults button that uses it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ssh): jump-host skipEcdsaHostKey is per-host; panel seeds from inherited overrides Three findings from the latest Codex pass: 1 & 2. `skipEcdsaHostKey` on the leaf was still falling back onto jump hosts in both `sshBridge.cjs` and `sftpBridge.cjs`. I had classified it with `legacyAlgorithms` as a "safety widening" knob, but Codex is right that it actually *narrows* the offered host-key list by dropping every `ecdsa-sha2-*`. An ECDSA-only bastion (or one where the operator pinned ECDSA via known_hosts) would still negotiate when ECDSA is offered, but fails when the leaf's skip is propagated to it. Same fix as `algorithmOverrides` last round: strictly per-host. Only `legacyAlgorithms` keeps the chain-wide fallback (append-only — it widens the offer, can never break a hop that wasn't already failing). 3. `AlgorithmOverridesPanel` was seeding the first customization of a category from the NetCatty/legacy effective default, ignoring any list the host inherits from its group for OTHER categories. Because `applyGroupDefaults` treats `host.algorithms` as an all-or-nothing inherit boundary, the moment the user saved any host-local override `{ cipher: [...] }`, the group's `{ serverHostKey: ["ssh-rsa"] }` restriction silently dropped from the effective host. Now: - `toggleAlgorithm`'s first-click seed reads `inheritedFromGroup?.[category] ?? effectiveDefault[category]`, so customizing one category preserves the group's narrowing on the others. - `updateCategory` initializes `next` from `{ ...inheritedFromGroup, ...value }` so saved overrides carry the inherited categories alongside the host's own edits. - `isChecked` reflects the inherited list when there's no local value, so the visible checkbox state matches what would actually be advertised. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(host-details): Reset preserves the inherited list instead of silently widening Codex caught a follow-on bug from the previous "carry inheritance" fix: pressing Reset on a category that's inherited from the group deleted that category from \`host.algorithms\` while other host-local or carried-inherited categories remained. Because \`applyGroupDefaults\` treats \`host.algorithms\` as all-or-nothing, the moment any host-local entry exists the group's \`algorithms\` object stops being inherited as a whole — so the freshly-deleted category fell back to NetCatty defaults rather than the group's narrower list. Effective result: Reset on an inherited category *widened* the offer instead of restoring it. Reset now persists the inherited list verbatim onto the host when the group has an override for that category, so "Reset" means "use what this host would otherwise inherit" in all cases. Also tightened \`isCustomized\` to suppress the "customized" badge (and the per-category Reset button) when the host's stored list is identical to the inherited list — those rows haven't really been customized by the user. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ui(host-details): gate the inherited-notice / checkbox baseline on no host override Codex caught the asymmetry between the read and write sides of the panel. The write side (`updateCategory`, `toggleAlgorithm`, Reset) intentionally carries `inheritedFromGroup` onto the host on the first edit so the runtime's all-or-nothing inherit boundary in `applyGroupDefaults` doesn't silently widen the offer. But the read side (the inherited-notice banner and the `isChecked` baseline for unfilled categories) was applying inherited values *unconditionally* — including when the host already had any local `algorithms` object, which makes `applyGroupDefaults` stop inheriting from the group as a whole. Net effect on a host that only locally overrode `cipher`: the UI claimed the group's `serverHostKey` restriction was still in effect, while the runtime would actually use NetCatty's modern defaults for that category. Introduce `inheritedForDisplay`, defined as `value === undefined ? inheritedFromGroup : undefined`, and route the notice + the `isChecked` baseline through it. The write side keeps consulting the unconditional `inheritedFromGroup` so the carry-over still happens on first edit — that part is what makes the runtime behavior match what the UI used to advertise. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ui(host-details): legacy/skipEcdsa toggles reflect group-inherited value Codex caught that the Skip ECDSA toggle in both the host and group panels read `form.skipEcdsaHostKey` directly, so a host whose group turned the flag on (and `applyGroupDefaults` therefore applied it to the runtime SSH negotiation) still saw the toggle rendered as off. Worse, clicking it computed `!form.skipEcdsaHostKey` — which is `!undefined` = `true` — so the first click could not actually disable the inherited setting on a per-host basis; it would just store `true` explicitly, the same effective state. The Allow Legacy Algorithms toggle had the same pre-existing issue. Fix both at once: each toggle now derives its enabled state from `form.<field> ?? <inherited>` and the onToggle handler flips that same effective value, so the toggle accurately represents what the runtime would do and a single click off correctly stores `false` (which `applyGroupDefaults` then leaves alone, breaking inheritance for this host). - `HostDetailsPanel` reads from `effectiveGroupDefaults`. - `GroupDetailsPanel` adds an `inheritedSkipEcdsaHostKey` memo alongside the existing `inheritedLegacyAlgorithms` and uses both. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
399e6a6f2d |
fix(terminal): use client OS for local-shell autocomplete clear sequence (#1112) (#1115)
* fix(terminal): use client OS for local-shell autocomplete clear sequence (#1112) Synthetic fallback Host in TerminalLayer hardcoded os: 'linux', so the 'host.os || navigator.platform check' expression in Terminal.tsx never ran the client-OS detection branch for local shells. Result: autocomplete emitted Ctrl-U (\x15) for line-clear on Windows local PowerShell/cmd, where it's rendered literally as ^U instead of erasing the input — the popup live-preview, fuzzy-accept, and snippet-accept paths all leak it. Fix both ends: Terminal.tsx prefers client OS detection for local protocol via the existing detectLocalOs helper; TerminalLayer.tsx populates the synthetic host's os field from detectLocalOs too, so other host.os readers (notably the server-stats gate in Terminal.tsx:642) also stop treating local Windows as Linux. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(terminal): keep non-local fallback host on 'linux' The TerminalLayer fallback path also triggers for unsaved serial sessions and orphaned remote sessions (where the saved host was deleted while the session lived on). Terminal.tsx trusts host.os for non-local protocols, so tagging the fallback with the Windows client OS would push POSIX remote/serial shells onto the Windows autocomplete/path-completion branch. Gate the client-OS detection on protocol === 'local'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
46d1cf1696 |
chore(ai): drop unused eslint-disable around suppressed SDK warning (#1111)
PR #1110 added an \`// eslint-disable-next-line no-console\` above \`console.warn\` when suppressing SDK reasoning/text state-machine errors, but this file already permits \`console.*\` calls (there are several pre-existing \`console.error\` lines in the same hook) so the directive is unused and ESLint flags it: \`\`\` 666:13 warning Unused eslint-disable directive (no problems were reported from 'no-console') \`\`\` Removes the directive; the \`console.warn\` stays. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
5be9bb58df |
fix(ai): suppress SDK reasoning/text state-machine error chunks (#1110)
Issue #1101 follow-up. When a third-party Anthropic-compat backend streams thinking deltas without first emitting a `reasoning-start` content-block signal (DeepSeek's \`-v4-flash\` is the canonical offender), the Vercel AI SDK has nothing registered for the incoming \`part.id\` and enqueues an \`error\` chunk on \`fullStream\` with the text \`reasoning part <id> not found\` — once per orphan delta. The analogous error exists for text parts. These are internal SDK bookkeeping noise, not user-facing errors. Our \`case 'error'\` handler was treating each one as a real error: it appended an empty assistant message carrying the SDK string. The visible damage was a wall of red banners in the chat panel — but the worse damage was protocol-level. On the next turn we rebuild \`sdkMessages\` from local history; the placeholder assistants slot in between the assistant that holds the parallel \`tool_use\` blocks and the subsequent \`role: 'tool'\` messages with their results. The Anthropic SDK's \`groupIntoBlocks\` only merges *consecutive* tool messages into a single user block, so the tool_results no longer immediately follow their tool_use parent — and the backend rejects the request as \`400 messages.N: tool_use ids were found without tool_result blocks immediately after\`. \`messages.N\` was literally counting our 12-ish phantom assistants. Adds \`isSdkStreamStateError(error)\` to \`infrastructure/ai/shared/streamStateErrors.ts\` (matches \`/^(reasoning|text)\\s+part\\s+\\S+\\s+not\\s+found$/i\` against string / Error / \`{ message }\` shapes), and skips placeholder emission for matching errors in the streaming hook. Drops a \`console.warn\` so the noise is still visible in devtools when debugging. 5 unit tests cover positive matches, the Error/object wrappings, non-matches that should stay surfaced, and non-string inputs. Refs #1101. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
53d3e05bb4 |
Per-agent provider switcher chip in the Catty Agent chat input (#1107)
* feat(ai): provider switcher chip in the Catty Agent chat input Catty Agent currently has no model chip in the chat input — modelPresets is empty for the catty agentId so `hasModelPicker` is false. The provider/model the chat ends up using comes from the global `activeProviderId` / `activeModelId`, which means switching providers requires opening Settings → AI → Providers. Closes the gap surfaced in the original feedback on #1101 (problem 2) and partially addresses #986 (per-context model switching) by going per-agent. State layer adds an `agentProviderMap` (`Record<agentId, providerId>`) alongside the existing `agentModelMap`. Both are written together when the user picks from the new dropdown; together they form a per-agent override that beats the global active provider/model when set. Cross- window sync mirrors the agentModelMap pattern. ChatInput grows a `providerSwitcher` prop carrying the enabled ProviderConfigs, the selected (providerId, modelId), and an onSelect callback. When supplied, the model chip switches from the Cpu glyph to the provider's ProviderIconBadge + `providerName · modelId`, and the popover renders a two-column layout — providers on the left (icon + name + default model caption), that provider's known model(s) on the right. ACP agents (Claude/Codex) are untouched because they plumb their provider through the CLI, not the Vercel AI SDK. AIChatSidePanel resolves `effectiveActiveProvider` / `effectiveActiveModelId` for the catty agent from the per-agent map, falling back to the global selection. handleSend now passes those through to sendToCattyAgent so a provider picked in one Catty session applies everywhere Catty runs. For v1, each provider's right column shows just its configured `defaultModel`. The two-level structure is in place to absorb richer listings (cached /models, manual additions) later without UI surgery — left a note in the popover code. Refs #1101, #986. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * polish(ai): flatten provider picker to a single list Two-level dropdown was theatre — each ProviderConfig exposes exactly one model (its `defaultModel`), so the right column ended up showing the same string already captioned on the left row. Picking a provider implicitly picks its model; one click is enough. Also drops the `p.enabled !== false` filter on the picker list. The user's expectation, confirmed by feedback on the first cut, is that the chat-input list mirrors what Settings → AI → Providers shows. The per-provider `enabled` toggle is an "active-ish" flag, not a visibility gate; hiding disabled providers in the picker silently made everything but the one currently active disappear, which is what the reviewer hit. Pares the popover down to a vertical list — provider icon + name + default-model caption (mono if set, italic "configure default model" hint if not) + a Check on the bound row. Removes the `hoveredProviderId` state along with the right-column rendering since it's no longer driving anything. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * polish(ai): tune provider icon sizes in the chat input Chip icon was sitting at sm (20px badge) and crowded the h-6 toolbar chip alongside the truncated label; popover rows used the same sm, so nothing differentiated the picker from the chip visually. Adds an xs size to ProviderIconBadge (16px badge, 10px glyph, 9px letter fallback) and uses it on the chip. Popover rows step up to md (32px badge, 16px glyph) and the row padding grows accordingly so the larger brand mark has room to breathe — the picker now reads like a list of choices, the chip reads like a status line. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): keep per-agent override honest in model fallback + chip label Two codex P1/P2 findings on #1107: P1 — When Catty has a per-agent provider override but no per-agent model (agentModelMap['catty'] empty), cattyAgentModelId fell through to the global `activeModelId`. That id belongs to whichever provider was globally active, not the one Catty is now bound to, so e.g. overriding to DeepSeek without a defaultModel happily sent gpt-4o (global) to DeepSeek and produced a wrong-model error. The fallback is now: stored agent model → override provider's defaultModel → empty. Only the no-override path keeps the activeModelId tail; the no-provider send guard catches the empty case for everyone else. P2 — ChatInput's selectedSwitcherProvider used `?? providers[0]` so the chip always displayed *some* provider even when none was actually bound (selectedProviderId missing). The rest of the pipeline (send guard, agentProviderMap) treats that as "no provider", so the chip was lying. Dropped the fallback; when nothing is bound the chip now shows a generic Cpu glyph + "Select provider" label until the user picks one from the popover. Adds `ai.chat.selectProvider` in en / zh-CN / ru. Refs codex review on #1107. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): purge per-agent binding when the bound provider is deleted Codex local review (round 2) flagged that a saved Catty model id could outlive its provider. The chain: - catty bound to provider A (DeepSeek): agentProviderMap['catty']='A', agentModelMap['catty']='deepseek-v4-flash' - user deletes provider A - cattyAgentProvider falls back to the global active provider (B, OpenAI) - cattyAgentModelId still returned the saved 'deepseek-v4-flash' - send dispatched the DeepSeek model id to OpenAI → wrong-model error Two layers of fix: 1. **Defensive resolution** (AIChatSidePanel) — cattyAgentModelId now looks at the override provider before trusting the stored model id. If the override is stale (provider deleted), the stored model id is treated as orphan and the resolution falls back to the global active selection just like cattyAgentProvider already does. 2. **Cleanup on remove** (useAIState.removeProvider) — when a provider is deleted, any agent whose agentProviderMap entry pointed at it gets both maps cleared (provider override + saved model). Same rationale: that model id is now meaningless against every other provider. Mirrors the existing activeProviderId cleanup. Adds a small agentProviderMapRef so removeProvider can snapshot which agents to clean up without relying on the captured-at-callback-create state (which would be stale). Refs codex local review on #1107. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): include agentProviderMap in settings sync + block empty-model send Codex local review (round 3) found two issues: P2 — `agentProviderMap` was missing from the cross-device sync surface. Added it to the sync key list, the build path, the apply path, and the SyncPayload type alongside the existing `agentModelMap`. Sync tests in `syncPayload.test.ts` now cover the new field on both the build and apply sides. P2 — Provider rows with no `defaultModel` were still clickable in the chat-input picker, so selecting one would save a binding with empty model id; the send path then dispatched an empty model name and the SDK would surface a vague backend error. Two changes: 1. ChatInput disables the row (\`disabled\`, \`aria-disabled\`, dimmed styling, tooltip pointing the user to Settings) when the provider has no \`defaultModel\`. Click is suppressed. 2. AIChatSidePanel \`handleSend\` adds a model-required guard mirroring the existing no-provider guard — surfaces \`ai.chat.noProviderModel\` as an assistant message. Catches stale bindings (e.g. user edited the provider's \`defaultModel\` to empty after binding) before they reach the SDK. Refs codex local review on #1107. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): trim whitespace-only model ids + reconcile orphan bindings on sync Codex local review (round 4) found two more leaks: P2 — Whitespace-only `defaultModel` passed the picker's `disabled` gate (which trims) but every other layer (cattyAgentModelId resolution, the send-guard `!sendActiveModelId` check, the SDK call) compared the raw string. A provider whose default model was " " could still reach the SDK and surface a vague backend error. Normalized: trim at the resolution boundary (catty model fallback chain) and trim before the send-guard's existence check. P2 — Sync apply did not reconcile per-agent bindings against the incoming provider set. A payload could change `providers` without shipping a fresh `agentProviderMap`, leaving local overrides pointing to provider ids the synced set no longer includes — the same ghost- binding bug that `removeProvider` already handles for explicit user deletes. Added `pruneOrphanPerAgentBindings()` that runs after every AI settings apply: it walks `agentProviderMap`, drops any entry whose provider id isn't in the current `providers` list, and clears the saved model id for those agents alongside it (mirroring removeProvider cleanup). A new test in `syncPayload.test.ts` exercises the ghost- binding case end-to-end. Refs codex local review on #1107. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): notify open AI state of cross-device sync apply in the same window Codex local review (round 4) flagged that `applySyncPayload` writes straight to localStorage but `useAIState` only re-reads on browser `storage` events. Those events only fire in *other* windows — the window doing the apply (the one with the active chat panel) keeps showing pre-sync providers and per-agent bindings until reload. Concrete leak: cloud sync swaps in a new provider set, pruning runs, localStorage is correct, but the open Catty chip still references the ghost provider binding until the user reloads. Extracts the existing `AI_STATE_CHANGED_EVENT` constant + `emitAIStateChanged` helper out of `useAIState` and into a new `application/state/aiStateEvents.ts` so non-React call sites (sync apply, future IPC handlers) can fire it without pulling in the hook. After AI settings apply, `syncPayload.ts` walks every AI key it touched (including the agentProviderMap / agentModelMap that the reconcile step may have mutated even when the payload didn't ship them) and emits a same-window nudge. `useAIState`'s existing local listener routes unknown keys back through its storage handler, so each affected piece of React state rehydrates from localStorage. Adds a regression test in `syncPayload.test.ts` that asserts the expected `netcatty:ai-state-changed` keys are dispatched for the providers + per-agent map keys. Refs codex local review on #1107. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
0c4de74c84 |
polish(ai): hint that the provider icon is clickable (#1106)
The icon badge next to the Display Name input opens the icon picker but had no visual cue — users had no reason to suspect it was clickable, and reviewer feedback flagged it as too hidden. Adds a primary-tinted ring on hover/focus plus a small pencil glyph overlaid on the bottom-right corner of the badge (also hover/focus gated). The badge itself doesn't change shape, so the layout stays stable; the affordance is purely additive. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
2a4feea40f |
Customizable provider name, icon, and protocol style (#1105)
* feat(ai): customizable provider name, icon, and protocol style
Issue #1101 reported that the only way to wire DeepSeek through the
Catty Agent was to add an "Anthropic" provider with a DeepSeek base URL,
which (a) wasn't relabelable except on the "custom" providerId and
(b) implicitly conflated wire-protocol style with providerId, locking
"custom" to the OpenAI-compatible client.
ProviderConfig now carries three optional fields — `style`
(anthropic/openai/google), `iconId` (built-in brand glyph key), and
`iconDataUrl` (user upload). createModelFromConfig routes on the
resolved style first, falling back to providerId only for per-vendor
quirks (ollama's throwaway apiKey and openrouter's baseURL). Display
name becomes editable for every provider, not just custom.
The icon picker exposes a curated lobe-icons subset (MIT) covering the
common Anthropic/OpenAI-compatible third parties — DeepSeek, Moonshot,
Kimi, Qwen, Zhipu, Doubao, Mistral, Cohere, Grok, Perplexity, Groq,
Hugging Face — plus the existing six built-ins. Uploads are downsampled
to 64×64 WebP on a canvas so localStorage doesn't blow up. See
public/ai/providers/NOTICE.md for attribution.
Closes part of #1101 (problem 2). PR2 will reuse the new name/icon
plumbing in the Catty Agent chat input to surface a provider switcher.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* polish(ai): bigger labelled icon tiles and auto-fill display name
The first pass shipped the icon picker as an 8-column grid of bare
20px badges. Reviewer feedback: the icons are too small to read at a
glance, every preset should announce its brand name, and a second
click on a selected preset should let the user back out.
Switches the grid to auto-fill 120px tiles with a 32px icon plus a
truncated label so the picker reads like a brand list, not a sprite
sheet. Selecting a preset now also writes the brand's canonical
English display name into the Display Name field — the picker labels
keep their "/ 中文" suffix as a bilingual hint, but a new `name` field
on each catalog entry supplies a clean string for autofill (e.g.
"Qwen / 通义" → "Qwen"). Re-clicking the selected tile clears
iconId/iconDataUrl but leaves the typed name alone, so users who
already edited the name don't lose their edit on accidental toggle.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* polish(ai): add explicit close button to icon picker
The picker only opened via the icon badge above the Display Name field,
which left no obvious affordance to collapse it once a preset was
chosen — users either had to scroll past or click back up to the icon.
Drops a ghost Close button in the bottom-right of the picker's action
row (next to Upload/Reset) so dismissing the panel is one click and
visible without hunting.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai): wire model discovery to the resolved provider style
Codex review on #1105 flagged that ModelSelector still derives auth
headers from `providerId` (`x-api-key` only when providerId is the
literal "anthropic"). Now that ProviderConfig lets the user override
`style` independently, the form persists the override but the model
discovery call ignored it — so picking an Anthropic providerId pointed
at an OpenAI-compatible backend (or vice versa) would send the wrong
header and fail to list models even though chat routing already used
the override.
Extracts `buildModelDiscoveryHeaders(style, apiKey)` as a pure helper
in infrastructure/ai/. ModelSelector now resolves the protocol family
via `resolveProviderStyle` with the explicit `style` prop taking
precedence, then asks the helper for headers. ProviderConfigForm
passes the resolved style through. The `needsApiKey = providerId !==
"ollama"` shortcut stays as-is — that's a per-vendor concession, not a
style decision.
Refs codex review on #1105.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai): apply per-vendor URL fallbacks across every style override
Codex review on #1105 caught that the openrouter (and ollama) baseURL
fallback was sitting inside the `style === 'openai'` branch, so a user
who picked OpenRouter providerId + Anthropic/Google style with an
empty baseURL would skip the fallback entirely. The SDK then routed
to its own default endpoint (api.anthropic.com /
generativelanguage.googleapis.com) using the user's OpenRouter key —
silent misrouting plus auth failures.
Pulls the per-vendor quirks out into a new pure helper
`resolveProviderEndpoint(config, style, safeApiKey)`. The URL
fallback now fires for every style — the user picked openrouter for a
reason, even if they overrode the wire format. The ollama-only
`'ollama'` literal apiKey swap stays gated on `style === 'openai'`
because Anthropic/Google clients need a real key, not the throwaway
placeholder.
Refs codex review on #1105.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai): send x-goog-api-key for google-style model discovery
Codex review on #1105 flagged that buildModelDiscoveryHeaders bucketed
google-style providers with the OpenAI-compat default, so a model
refresh against any google-routed endpoint was sending `Authorization:
Bearer …`. That's the wrong auth header — Google Generative AI
rejects Bearer entirely and expects `x-goog-api-key` (or `?key=`).
The runtime chat path already uses `createGoogleGenerativeAI`, which
authenticates with the Google header family, so discovery was the
odd one out.
Adds an explicit `google` branch returning `{ "x-goog-api-key":
<apiKey> }` and updates the unit test. The default google providerId
never hits this path today (PROVIDER_PRESETS["google"] has no
modelsEndpoint), but the style override surface created in this PR
lets users compose providerId + style pairs where discovery does
fire — e.g. an openai/anthropic-style providerId pointed at a Google
endpoint via baseURL override.
Refs codex review on #1105.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai): pick discovery endpoint from resolved provider style
Codex review on #1105 pointed out the lopsided fix in
|
||
|
|
0e80955e96 |
fix(hosts): make group startup-command field multi-line typeable (#1100)
The group details panel rendered Startup Command as a single-line <Input>, so users couldn't type newlines into it — only the first line ever made it into the saved config, which then broke the multi-line sequencing behavior shipped in #1096 for any host inheriting the command from its group. Switch to a 3-row <Textarea> to match the per-host details panel, so a multi-line command typed on the group is preserved end to end. Refs #1083. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
7771592cf2 |
feat(shortcuts): Ctrl+W closes the tab directly + add configurable side-panel toggle (#1098)
* feat(shortcuts): add resolveSidePanelToggleIntent pure resolver * feat(shortcuts): Ctrl+W closes the tab directly (drop side-panel priority) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(shortcuts): register toggle-side-panel binding (default ⌘/Ctrl+\) * feat(shortcuts): add side-panel toggle handler + last-panel memory in TerminalLayer * feat(shortcuts): dispatch toggleSidePanel hotkey to TerminalLayer --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|
|
6e9e8fc40d |
feat(autocomplete): make snippets a first-class terminal completion source (#1097)
* feat(autocomplete): add snippet completion source * feat(autocomplete): merge snippets at the command position Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(autocomplete): place snippet tests where the test runner finds them The npm test glob covers components/terminal/*.test.ts but not the autocomplete/ subdirectory, so the snippet tests added in the previous two commits weren't actually running in the suite. Move them up to components/terminal/ (the existing convention for autocomplete tests) with corrected import paths; the engine snippet cases go in a separate completionEngineSnippets.test.ts to avoid colliding with the existing completionEngine.test.ts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(autocomplete): snippet ghost-exclusion, preview skip, and accept path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(autocomplete): wire snippets into the terminal + preview snippet command * fix(autocomplete): show only label in snippet popup row; keep snippet over colliding history The popup row for a snippet now omits the inline command echo — the full command lives in the detail preview only, matching the "label-only row" design. The completion engine pushes snippet suggestions without the early seen-text skip so that when a snippet's label collides with a history entry's text, the higher-scored snippet survives the final dedup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(autocomplete): broadcast snippet command so popup acceptance mirrors peers In broadcast mode, accepting a snippet from the autocomplete popup cleared peer input (the line-clear keystrokes flow through the broadcast-aware path) but never sent the command, since executeSnippetCommand wrote only to the active session. Broadcast the normalized snippet data (matching the snippet shortkey path) so peers receive both the clear and the command, keeping all sessions in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(autocomplete): broadcast wrapped snippet bytes to preserve noAutoRun Broadcasting the raw normalized command sent un-wrapped newlines to peers, so a multi-line noAutoRun snippet was pasted-but-not-run on the active session yet executed line-by-line on broadcast peers (handleBroadcastInput writes bytes directly without re-wrapping). Broadcast the exact bytes the active session receives instead — bracketed-paste wrapping plus the auto-run \r — so peers mirror the active session and noAutoRun is preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|
|
67448cea65 |
feat(terminal): configurable startup-command delay + multi-line sequencing (#1096)
* feat(terminal): add global startupCommandDelayMs setting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(terminal): add startup-command line-split and delay-clamp helpers Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(terminal): run multi-line startup commands in sequence with configurable delay Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(terminal): expose startup command delay in Terminal settings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(terminal): keep startup-command line content verbatim splitStartupCommandLines now only drops blank/whitespace-only lines and normalizes CRLF, but no longer trims each line's content. This keeps a single-line startup command byte-identical to what the user typed (e.g. a leading space for HISTCONTROL=ignorespace is preserved), while still supporting multi-line sequencing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(sync): include startupCommandDelayMs in synced terminal settings Terminal settings sync via the SYNCABLE_TERMINAL_KEYS allowlist; the new startupCommandDelayMs preference was missing, so it wouldn't propagate across devices. Add it (it's a user preference like keepaliveInterval, not device-specific). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|
|
770b06a9ee |
fix(ai): make Claude Code agent diagnosable + configurable (auth) (#1095)
* feat(ai): add Claude auth-presence detection helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ai): surface actionable Claude auth errors and reap stuck agent processes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(ai): add pure helpers for Claude config dir + env editor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(ai): let users set Claude config dir and env vars in settings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * polish(ai): harden Claude config env, de-dupe error text, label a11y - buildClaudeEnv: drop managed keys (CLAUDE_CONFIG_DIR/CLAUDE_CODE_EXECUTABLE) if a user types them into the free-text env editor, so they can't clobber the config-dir field or the discovered executable path (+ regression test). - bridge: only append error data fields not already shown as message/code, so the actionable error text doesn't echo the same code/message twice. - ClaudeCodeCard: associate the new config-dir/env labels with their inputs via htmlFor/id. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(ai): make the Claude auth & config section collapsible The optional "Authentication & config" section now has a collapsible header (chevron toggle). Collapsed by default to keep the card tidy, but auto-expanded when the user already has a config directory or env vars set so existing config isn't hidden. Local UI state, not persisted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): preserve raw env editor text; don't encourage plaintext secrets P1: the env textarea was bound to the persisted value, which is the parsed env re-serialized — so typing a key before its "=" was erased mid-entry (buildClaudeEnv drops lines without "="). Keep the raw typed text in local draft state and only resync from the persisted value on genuine external changes (not our own parse→serialize round-trip). P2: the env editor persists to localStorage in plaintext (no credential encryption). Stop suggesting ANTHROPIC_API_KEY in the placeholder and warn that values are stored in plaintext, steering credentials to the config directory (a `claude` login) — consistent with keeping Claude auth CLI/config-owned (#705). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): expand ~ in Claude config directory before passing to the agent CLAUDE_CONFIG_DIR is handed to the spawned agent as an env var, which is not shell-expanded — so "~/.claude" was treated as a literal "~" directory. Expand a leading ~ at consume time (normalizeAgentEnv + getClaudeConfigDir) rather than on save, so the stored value stays portable across machines (cloud sync) and each device expands to its own home. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ai): recreate cached Claude provider when its env config changes Claude ACP providers are cached per chat session and reused unless one of the fingerprinted dimensions changes. authFingerprint was null for Claude, so editing the config directory / env vars in Settings didn't take effect on an already-running session. Fingerprint the Claude agent env so a config change invalidates the cached provider and the next turn respawns with it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |