- appendRetainedStoredModelPreset appends the exact suffixed id when a
base-only row exists that does not cover the suffix.
- createSdkRuntimeModelCache carries a degraded refresh's warning onto the
retained cached catalog so the banner and Retry stay visible.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SX3d2XMHxBEpU7VqpvXbdm
- add GROK_CONFIG_DIR to the model catalog cache env keys so two grok login
profiles sharing HOME and the binary do not share a catalog
- replace the em dash added in the current-only refresh comment
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SX3d2XMHxBEpU7VqpvXbdm
- keep an already-qualified {provider, model} default in getOpenCodeDefaultModelIds
instead of prefixing the provider twice
- resolve npm's copilot.ps1 wrapper to the JS entry on Windows like .cmd/.bat
- when serving a last-known-good catalog, remap a persisted current id that has
no row to the first visible row for every backend (null still means default),
so the picker and the send preflight agree
- reconcile the catalog warning banner from the result of every refresh, so a
panel that joined another panel's in-flight load also shows it
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SX3d2XMHxBEpU7VqpvXbdm
- modelCatalogLastKnown: a current-only refresh to an id absent from the
persisted list now synthesizes a minimal row (label = the id) instead of
leaving the persisted current id dangling, so a later live failure serves
a list whose current row the picker and the send preflight agree on
- mimoDriver: sdkStreamHandlers hands an absolute catalog deadline down
(outer budget minus 1s headroom); mimo serve readiness and the providers()
query draw from that one pool instead of re-arming independent 25s caps,
so the pair can no longer outrun the 30s outer model-list budget
- sdkStreamHandlers: add XAI_API_KEY to SDK_MODEL_CACHE_ENV_KEYS so two
grok profiles sharing one binary but not credentials never share a
catalog (MODEL_CACHE_ENV_HINTS does not exist in this tree)
- last-known-good store: a current-only catalog (zero visible models,
valid currentModelId) now refreshes the persisted current id via
refreshLastKnownCatalogCurrentId instead of being skipped, so the
user's selection survives a later live failure without clobbering
the persisted models list
- SDK_MODEL_CACHE_ENV_KEYS: add CODEBUDDY_API_KEY, CODEBUDDY_AUTH_TOKEN
and CODEBUDDY_INTERNET_ENVIRONMENT so two codebuddy profiles sharing a
binary but not credentials no longer share one catalog cache key
- isCopilotAutoOnlyFallback: detect the copilot auto row among the
renderer-appended rows (composer custom ids, retained selections)
instead of requiring exact single-entry shape, keeping saved explicit
selections valid when the picker list mixes extra rows
appendRetainedStoredModelPreset reduced a saved selection to its base id,
so a suffixed saved copilot model (e.g. claude-sonnet-4.5/high) produced
a row that no longer matched the stored id: the picker fell back to auto
while the send preflight passed the saved id. Append the exact stored
spelling when no build-time preset defines the base id.
getOpenCodeDefaultModelIds checked the bare value.model string before the
provider-aware shapes, so {provider: 'xiaomi', model: 'chosen'} returned
the unqualified 'chosen' and mimo's visibility check could never match
its fully qualified model ids. Mirror the singular resolver's branch
order.
A stored selection preserved through the claude-alias or copilot
auto-only degraded fallback had no preset row, so the picker could show
no selected row while the send preflight passed the hidden value; append
a preset row (reusing the build-time preset when it defines the id).
Last-known-good responses were cached without their warning, so another
panel or a remount within the renderer TTL presented degraded models as
live and hid the Retry action. The warning now travels with the cached
catalog and re-syncs the banner on cached hits.
getOpenCodeDefaultModelId returns only the first default entry, so a
catalog declaring the hidden auto channel before the xiaomi provider made
the filtered catalog fall back to the first model instead of the CLI's
configured Xiaomi default. Enumerate every advertised default and select
the first one that survives filtering.
The auto-only COPILOT_MODEL_PRESETS fallback is nonempty, so a live
listModels failure invalidated a saved explicit Copilot model selection:
shouldUseStoredAgentModel only preserved unknown stored ids when the
preset list was empty, and picker plus send path silently switched to
auto. A saved id keeps resolving while the presets are exactly the
auto-only fallback.
writeLastKnownCatalogEntry sliced models to the 200-entry cap without
checking whether the current model survived the slice, so a huge live
catalog could persist a currentModelId with no picker row and the
last-known-good serve would let the picker and the send preflight
disagree again. Retain the current model in the capped set.
Adopts the PR author's commits for the copilot shutdown race, the mimo
filtered-channel default, and the claude alias fallback presets. Keeps the
complementary pieces: last-known-good mimo read-back normalization and
renderer-side preservation of stored claude aliases against live full-id
catalogs.
Preset lists before the 2026-10 claude catalog refresh persisted
sonnet/haiku alias ids. A live catalog of full ids made
shouldAdoptSdkCurrentModel treat such a stored selection as stale and
silently overwrite it, even though the claude CLI still resolves the
alias. Stored aliases now keep resolving (picker and send path) and are
never replaced by the catalog's current model; other backends and
non-alias ids are unchanged.
stopCopilotClient's 3s grace timer stayed alive whenever stop() won the
race, leaking one handle per turn/catalog load. Clear it in a finally. A
stop() rejection also no longer counts as settled, so the forceStop()
fallback still runs when the graceful handshake fails.
A live default on the filtered mimo auto channel surfaced a currentModelId
the picker could not render or check while sends still went through the
channel. Replace it with the vendor's documented default when the remaining
models offer it, else the first remaining model, else null; ids outside the
filtered channel pass through untouched. Apply the same normalization when
serving a persisted last-known-good catalog captured before filtering.
Review feedback on PR #3624:
- resolveLastKnownCatalogPath now reads userData through
electronModule.app.getPath, matching the real bootstrap where
electronModule is the require('electron') namespace (previously the
persistence layer was a silent no-op in production)
- the last-known store now caps entries at LAST_KNOWN_MAX_ENTRIES (32,
mirroring the in-memory TTL cache) and evicts the least recently
updated entries, so churned fingerprinted cache keys cannot grow the
store file without bound
- replace em dashes with ASCII punctuation per repo convention
- test stub now mirrors the real electronModule shape
Revert d2b1d5fa2's default preference of the native copilot.exe: the
1.0.59-era native CLI bootstraps %LOCALAPPDATA%\copilot\pkg\ on first
start, starts slowly, and leaves a conhost child alive after app-side
timeout/abort (console window stays open; CLI server exited unexpectedly
with code 0). Loader-first (npm-loader.js) is the default again; the
native binary is opt-in via NETCATTY_COPILOT_PREFER_NATIVE=1.
Also:
- Add COPILOT_MODEL_PRESETS (auto) so a live listModels failure no
longer leaves the Copilot picker empty.
- Sync MIMO_MODEL_PRESETS to the 6 verified live-catalog models
(v2.6/v2.5 pro-ultraspeed/pro/flash); auto channel stays filtered
driver-side.
- Reap the Copilot CLI child on abort/stop: stopCopilotClient() races
graceful client.stop() with a 3s grace and falls back to the SDK's
forceStop() (SIGKILL) so the spawned process does not linger.
npm-loader.js re-spawns the native binary via spawnSync WITHOUT
windowsHide, flashing a console window when the Copilot SDK runs inside
Electron's GUI main process on Windows. When the platform-native binary
(@github/copilot-<platform>-<arch>/copilot.exe) exists next to the
resolved package, hand it to RuntimeConnection.forStdio directly — the
SDK spawns it itself with windowsHide:true. Fall back to npm-loader.js
when the native package is absent (e.g. optional deps omitted).
The catalog path boots a dedicated `mimo serve` and then queries providers();
the inner awaitMimoSetup race (and the serve readiness timeout) was 10s and
lost on the coldest boots even though the outer mimo budget is now 30s. Give
the catalog path a 25s inner budget (MIMO_CATALOG_SETUP_TIMEOUT_MS, passed as
both the spawn readiness timeout and the providers race). runMimoTurn keeps
the 10s default.
Persist each successful live catalog ({userData}/model-catalog-last-known.json,
keyed by the same backend+binPath+runtime+envHash string as the in-memory TTL
cache) and serve it when a later live fetch fails, before degrading to curated
presets. Copilot has no presets at all, so this is its first real fallback.
Empty catalogs are never persisted; corrupt files and IO errors degrade
gracefully; per-entry models are capped at 200. The response keeps the
warning contract and adds source/fetchedAt markers for the UI.
The curated CLAUDE_MODEL_PRESETS fallback still advertised the 4.6
generation while the live CLI catalog serves Opus/Sonnet/Haiku 5.5 and
Fable 5.1. Alias ids (`default`/`sonnet`/`haiku`) are unchanged so the
CLI still resolves them; only display names move: sonnet/haiku now map
to claude-sonnet-5-5 / claude-haiku-5-5 in the Claude CLI alias table
(verified against CLI 2.1.296), and `default` has no fixed alias target,
so it keeps the CLI's own neutral "Default (recommended)" label.
RuntimeConnection.forStdio({ path }) makes the Copilot SDK spawn the
CLI through node WITHOUT shell:true. Windows npm installs expose
copilot as a .cmd shim, and Node >= 18.20 throws spawn EINVAL for
.cmd/.bat in milliseconds, so listCopilotModels()/runCopilotTurn()
could never start the runtime via the PATH-resolved shim.
Add resolveCopilotExecutableForSdk() to shellUtils (same per-CLI
resolver pattern as claude/codex/codebuddy): resolve the shim to the
package's real npm-loader.js entry via the npm layout shortcut, then
by parsing the shim, and pass .exe/.js entries through unchanged.
Apply it at both RuntimeConnection.forStdio call sites; unresolvable
shims keep the original path so behavior is unchanged.
Harness: PATH-resolved copilot.cmd -> npm-loader.js, catalog [auto]
returned in 3.0-3.6s (was: EINVAL in 1-2ms, empty catalog).
listMimoModels() spawned `mimo debug config` only to seed the server's
skills config, which the provider catalog never reads. That probe alone
costs 6-8s on a cold CLI, pushing the whole chain (probe + serve boot +
config.providers()) past the shared 10s model-list timeout, so the mimo
catalog always degraded to an empty list with a UI warning.
- drop the readMimoSkillPaths() call from listMimoModels(); the turn
path (runMimoTurn) still reads skill paths unchanged
- add a per-backend catalog timeout override map; mimo gets 30s because
it cold-boots a dedicated `mimo serve` process per catalog pull
(unlike OpenCode's pooled server), while every other backend keeps
the existing 10s (opencode: 10s + server start) budget
Harness: no debug-config spawn, catalog 7 models in 7.7-10.5s (was:
timeout error at 10s, empty catalog every time).
Add a detached multi-tab editor window with acknowledged content ownership, focused Monaco shortcuts, and shared close/save confirmation. Preserve source contents until handoff acknowledgement and block edits or incoming transfers during ownership changes.
Continuation of #3439. Original implementation by pplulee.
Co-authored-by: pplulee <hi@pplulee.me>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(terminal): bound asynchronous Windows PATH refresh
Replace blocking per-terminal registry queries with parallel async reads,
a one-second deadline, and a shared five-second snapshot. Preserve machine
before user PATH ordering and place guessed CLI directories last. Retain
per-hive successful values when registry reads fail, and honor explicit
PATH overrides without querying the registry.
* fix(terminal): cancel pending local starts through boot epochs
Register the existing pending boot controller before awaiting PATH refresh.
Honor tab close and reconnect cancellation before spawning, and clear only
the matching controller so stale completion cannot erase a newer boot.
Regression tests reproduce both the closed-tab PTY spawn and stale-close
ownership failures against the prior revision.
* fix(terminal): abort pending starts before worker close queue
Propagate an owned close to the existing pending boot controller before
waiting for its serialized start. Keep transport cleanup ordered and keep
stale boot-epoch closes from cancelling replacements.
Exercise both fire-and-forget and awaited close messages through the real
worker dispatcher and local-session bridge with a controlled PATH wait.
* fix(terminal): cancel superseded worker starts before queuing
Signal the existing boot-abort controller when a replacement arrives,
reject stale boot epochs, and recheck queued epochs before startup.
Only the latest reconnect may spawn after a pending PATH refresh.
Cover repeated reconnect requests and delayed old starts/closes through
the real worker dispatcher and local-session bridge.
Use xterm's native synchronized output state for viewport preservation, remove the redundant mode tracker, and exercise the production callback path in regression tests.
Fixes#3595
Co-authored-by: si1enteee <si1enteee@users.noreply.github.com>
* feat(vault): add host connection test to the host editor
Add a 'Test' button next to Save in the host editor that opens a dialog reusing the terminal's connection progress/auth/host-key UI, and runs a headless connection probe:
- Main process: netcatty:test-connection reuses startSSHSession in a testMode that authenticates then tears down without opening a shell, reports via netcatty:test:result, and supports cancellation (netcatty:test-connection:cancel).
- Renderer: useHostConnectionTest hook + HostConnectionTestDialog component; single-credential auth (no agent/default-key fallback) with short test timeouts (8s TCP / 15s auth).
- Reuses terminal chain progress, host-key verification, and auth prompts; success keeps the same dialog with retry/close.
* fix(ssh): cancel test connections during chain/proxy dial
Register the headless test-connection transport before connectThroughChain / createProxySocket runs, and update its pendingConn / chainConnections as hops and proxy sockets are established. This lets cancelTestConnection abort a slow/unreachable bastion or proxy dial instead of leaving it running until timeout.
* fix(ssh): address host connection test review feedback
- Route jump-host keyboard-interactive prompts through the external scope in test mode
- Always offer keyboard-interactive for requiresMfa hosts in test mode, including key/certificate-only auth
- Derive the renderer test deadline from the probe options and cancel the attempt on timeout
- Run the macOS Local Network preflight before connection tests
- Add regression tests for jump-host MFA, MFA auth order, test deadline, and macOS preflight
Author: yangheng
Model: claude-opus-5
---------
Co-authored-by: yangheng <492238647@qq.com>
* feat(ai): scope external MCP approvals to connection or host
* test(ai): keep MCP fixture in Netcatty temp directory
* fix(ai): refine external MCP approval UI and grant safety
* fix(ai): wrap long approval targets and support Node 22
* fix(ai): keep automatic scripts in observer mode
* fix(sftp): release preflight markers after transfer
* fix(sftp): retain preflight cap through conflict resolution
* Keep SFTP preflight cap across panel remount
* Update worker terminal metadata expectations
* Persist SFTP preflight skip state across restart
* Limit persistent host approvals to saved hosts
* Scope host-open approvals to the selected saved host
* Exclude serial hosts from persistent approval scopes