Skip to content

0.2.0: settings fixes, and credentials set while the app is open - #4

Open
jeffreyaven wants to merge 3 commits into
mainfrom
settings-0.2.0
Open

jeffreyaven wants to merge 3 commits into
mainfrom
settings-0.2.0

Conversation

@jeffreyaven

@jeffreyaven jeffreyaven commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Fixes three things in Settings, lets the engine use credentials set while the app is open, and sets the version to 0.2.0.

Save model backend never became available

The button was disabled with its reason only in a hover tooltip. In the case reported, Remove model backend had also deleted the stored Gemini key. After that Gemini needed a key again and an OpenAI-compatible server needed a model name, and neither said so on screen.

  • The reason is now said beside the button: "Enter an API key to save." or "Choose a model to save."
  • Whether a key is stored is reported for each backend, so switching back to a backend whose key is in the keychain does not ask for it again.
  • Remove model backend says on hover that it deletes the key.

The model is chosen from a list

For the API key backends the host asks the provider which models the key can use:

  • Gemini: GET /v1beta/models, narrowed to the models that take generateContent.
  • Anthropic: GET /v1/models, without retired models. Deprecated ones are marked.
  • OpenAI-compatible: GET {address}/models, everything the server lists, sorted.

The list is read when the pane opens on a backend whose key is stored, or a local server with an address, and otherwise on List models. A key typed and not saved yet is sent with that request and kept nowhere. When the list cannot be read, the model stays a text field with the provider's message under it. The address field now comes before the key and the model, since the list depends on both.

Browse on every path

The engine, the data folder, the credentials file and the Copilot CLI each have a Browse button. The host opens the system's file or folder dialog through tauri-plugin-dialog, which was already used for exports. The webview names what the path is for, and the host picks the kind of dialog, its title and the file types it offers first.

Credentials set while the app is open

On Windows a process keeps the environment it was started with, so a credential set with setx or in the system settings reached the engine only after the app was closed and opened again. Now every child the supervisor starts gets the app's own environment with the user's and the machine's variables applied, as the registry holds them at that moment (CreateEnvironmentBlock, the same block a newly started process gets). Missing variables are added, and ones changed or removed in the registry since the app started are changed or removed. A value the app was started with keeps winning until the registry's value changes. Providers > Reload Credentials is then enough.

After an engine restart the agent's next turn opens a new engine session, and a delegated agent a new process, since both keep the environment they started with. macOS has no such store, so there the dotenv file in Settings remains the route.

Checked in a debug build without closing it: a made-up DIGITALOCEAN_TOKEN stored for the user while the app ran reached the engine after Reload Credentials (DigitalOcean answered 401), and deleting it put the engine back to "credentialsenvvar references empty string". A unit test does the same against the real registry with a throwaway variable, and an integration test checks the new engine session after a restart.

What was run

  • npm run lint, npm run typecheck, npm test (474 tests), cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test (292 unit tests, 24 integration tests against stackql v1.1.959) on Windows 11 x64.
  • A debug build was driven on Windows, in both themes. The model list was read from a stand-in OpenAI-compatible server when the pane opened, with no key sent. Gemini with no key showed the reason beside a disabled Save. Browse opened the folder dialog and the file dialog with their own titles, a chosen path went into the field, and Cancel left it alone.
  • The real Gemini, Anthropic and OpenAI model lists have not been read. Each is tested against a local stub that checks what goes on the wire. The dialogs have not been opened on macOS.

No new dependencies. Two windows-sys features are added for the environment block.

🤖 Generated with Claude Code

jeffreyaven and others added 3 commits November 23, 2026 16:01
…aths

Save model backend was disabled with the reason only in a hover tooltip.
In the case reported, Remove model backend had also deleted the stored
Gemini key, so Gemini asked for a key again and an OpenAI-compatible
server asked for a model, and neither said so on screen.

- The reason a backend cannot be saved yet is said beside the button.
- Whether a key is stored is reported for each backend, not only for the
  configured one, so switching back to a backend does not ask for its key
  again. Remove model backend says on hover that it deletes the key.
- The model of an API key backend is chosen from the list its provider
  gives: Gemini's models that take generateContent, Anthropic's models
  without retired ones, and everything an OpenAI-compatible server lists.
  The list is read when the pane opens on a backend whose key is stored,
  or a local server with an address, and otherwise on List models. A key
  typed and not saved yet is sent with that request and kept nowhere.
  When the list cannot be read the model stays a text field.
- Every path in Settings has a Browse button: the engine, the data
  folder, the credentials file and the Copilot CLI. The host opens the
  system's file or folder dialog through tauri-plugin-dialog, which was
  already used for exports. The webview names what the path is for.
- The address field now comes before the key and the model, since the
  list depends on both.

No new dependencies. The model list uses reqwest as the backends do,
with the query string built through its Url type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…edentials

A Windows process keeps the environment it was started with. A provider
credential set with setx, or in the system settings, while the app was
open reached the engine only after the app itself was closed and opened
again. Reload Credentials restarted the engine with the same stale
environment.

Every child the supervisor starts now gets the app's own environment
with the user's and the machine's variables applied, as the registry
holds them when the child starts. They are read with
CreateEnvironmentBlock, which builds what a newly started process of the
user would get, PATHs joined and values expanded. A variable the app's
environment lacks is added. One changed or removed in the registry since
the app started is changed or removed. A value the app was started with,
such as one set in a terminal for that launch, keeps winning until the
registry's value changes.

The agent's engine session and a delegated agent keep the environment
they started with, so they are now opened again on the next turn after
an engine restart. The connection exposes its existing start counter for
that. On the API key path the conversation carries over. The Copilot CLI
starts a new session and says why.

macOS has no such store. There the app's own environment is used as
before, and a dotenv file in Settings remains the route.

No new dependencies. Two windows-sys features are added:
Win32_System_Environment for CreateEnvironmentBlock, and
Win32_System_Threading for the app's own token. userenv.dll, which
CreateEnvironmentBlock is in, is part of Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeffreyaven jeffreyaven changed the title 0.2.0: model lists, why Save is unavailable, and Browse on paths 0.2.0: settings fixes, and credentials set while the app is open Nov 23, 2026
@jeffreyaven
jeffreyaven marked this pull request as ready for review November 23, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant