Skip to content

refactor: update goose2 credential management behind provider-scoped ACP/core API#8887

Merged
kalvinnchau merged 9 commits intomainfrom
kalvin/model-reload
Apr 29, 2026
Merged

refactor: update goose2 credential management behind provider-scoped ACP/core API#8887
kalvinnchau merged 9 commits intomainfrom
kalvin/model-reload

Conversation

@kalvinnchau
Copy link
Copy Markdown
Collaborator

@kalvinnchau kalvinnchau commented Apr 28, 2026

Category: improvement
User Impact: Users can update model provider credentials in Goose2 settings and see updated model availability without restarting the app.
Problem: Goose2 provider credential changes were handled in the Tauri shell with duplicated provider metadata, so saved credentials required a restart and could leave model inventory stale. That made provider setup feel disconnected from
the runtime state Goose actually uses.
Solution: Move provider-scoped credential read/status/save/delete into ACP/core, invalidate secret caches when credentials change, and refresh provider inventory as part of the save/delete flow. The UI now talks through the generated SDK,
shows per-provider save/sync state, and keeps the provider list usable while status checks are loading.

File changes

crates/goose-sdk/src/custom_requests.rs
Adds ACP request/response DTOs for provider config read, status, save, and delete.

crates/goose/acp-meta.json
Registers the new provider config ACP methods.

crates/goose/acp-schema.json
Updates the ACP schema for provider config methods and response shapes.

crates/goose/src/acp/server.rs
Implements provider config ACP handlers, masks secret reads, batches secret writes/deletes, invalidates secret caches, and starts identity-safe inventory refresh jobs.

crates/goose/src/config/base.rs
Adds shared secret mutation helpers plus batched secret set/delete operations.

crates/goose/src/providers/inventory/mod.rs
Captures refresh identities at plan time, guards refreshing keys, and stores refresh results against the planned identity.

crates/goose/tests/acp_secret_cache_invalidation_test.rs
Covers ACP secret/cache invalidation, provider config save/delete behavior, masked secret reads, and plan-time inventory identity storage.

documentation/docs/guides/config-files.md
Clarifies that Goose2 settings saves refresh through ACP without requiring an app restart.

ui/goose2/AGENTS.md
Documents that provider config mutations should go through React, SDK, ACP, and goose core instead of Tauri commands.

ui/goose2/src-tauri/Cargo.lock
Removes now-unused dependencies from the Tauri lockfile.

ui/goose2/src-tauri/Cargo.toml
Removes the unused etcetera dependency.

ui/goose2/src-tauri/src/commands/credentials.rs
Deletes the old Tauri provider credential commands.

ui/goose2/src-tauri/src/commands/mod.rs
Stops exporting the removed credential command module.

ui/goose2/src-tauri/src/lib.rs
Stops managing the removed GooseConfig service and unregisters credential commands.

ui/goose2/src-tauri/src/services/goose_config.rs
Deletes duplicated shell-side config and secret storage logic.

ui/goose2/src-tauri/src/services/mod.rs
Removes deleted provider config services from the service module.

ui/goose2/src-tauri/src/services/provider_defs.rs
Deletes duplicated provider config metadata from the Tauri layer.

ui/goose2/src/app/hooks/useAppStartup.ts
Uses the shared provider inventory sync helper during startup.

ui/goose2/src/features/providers/api/credentials.test.ts
Adds SDK wiring coverage for provider config read/status/save/delete.

ui/goose2/src/features/providers/api/credentials.ts
Replaces Tauri invokes with generated ACP SDK provider config calls.

ui/goose2/src/features/providers/api/inventorySync.test.ts
Covers inventory sync polling, initial refresh reuse, already-refreshing providers, and skipped entries.

ui/goose2/src/features/providers/api/inventorySync.ts
Adds shared refresh-and-poll logic for provider inventory updates.

ui/goose2/src/features/providers/hooks/useCredentials.test.tsx
Covers no-restart credential saves, inventory warnings, and native OAuth refresh ordering.

ui/goose2/src/features/providers/hooks/useCredentials.ts
Tracks per-provider saving/syncing/warning state and starts inventory sync after save, delete, or native auth.

ui/goose2/src/features/settings/ui/ModelProviderPanels.tsx
Adds reusable loading and warning messages for inventory sync state.

ui/goose2/src/features/settings/ui/ModelProviderRow.tsx
Saves provider fields in one batch and shows per-provider inventory loading/warning state.

ui/goose2/src/features/settings/ui/ProvidersSettings.tsx
Removes the restart banner, renders providers while status loads, and passes per-provider save/sync state into rows.

ui/goose2/src/features/settings/ui/tests/ModelProviderRow.test.tsx
Covers batched setup saves plus inventory loading and warning rendering.

ui/goose2/src/features/settings/ui/tests/ProvidersSettings.test.tsx
Covers removal of the restart banner, loading-state rendering, and connected-provider ordering.

ui/goose2/src/shared/api/tests/dictation.test.ts
Adds coverage for dictation provider secret save/delete SDK calls.

ui/goose2/src/shared/api/dictation.ts
Moves dictation secret save/delete off Tauri invokes and onto ACP secret methods.

ui/goose2/src/shared/i18n/locales/en/settings.json
Adds English status/warning strings and removes restart copy.

ui/goose2/src/shared/i18n/locales/es/settings.json
Adds Spanish warning/loading strings and removes restart copy.

ui/sdk/src/generated/client.gen.ts
Regenerates the TypeScript SDK client for provider config ACP methods.

ui/sdk/src/generated/index.ts
Exports new provider config types and method metadata.

ui/sdk/src/generated/types.gen.ts
Regenerates provider config request/response TypeScript types.

ui/sdk/src/generated/zod.gen.ts
Regenerates Zod validators for provider config request/response payloads.

Reproduction Steps

  1. Open Goose2 Settings and go to Providers.
  2. Confirm the model provider list renders while provider status is still checking.
  3. Expand a provider with multiple fields, enter credentials, and save.
  4. Confirm no restart banner appears, the row updates to connected, and model inventory shows a loading state while refresh runs.
  5. Delete or change the provider credentials and confirm the row updates without restarting.
  6. For a native auth provider, complete the auth flow and confirm provider status refreshes after credentials are written.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27c38359f7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/acp/server.rs
@kalvinnchau kalvinnchau force-pushed the kalvin/model-reload branch from 27c3835 to 5595c0e Compare April 28, 2026 22:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-29 16:25 UTC

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5595c0e329

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/goose2/src/features/providers/hooks/useCredentials.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d25926ba4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/goose/src/acp/server.rs
Comment thread crates/goose/src/acp/server.rs
@matt2e
Copy link
Copy Markdown
Collaborator

matt2e commented Apr 29, 2026

crates/goose/src/acp/server.rs (Lines 1047-1130)

The session-init refresh path (lines ~1046-1130) duplicates the same ensure_refresh_identity_currentcatch_unwind(fetch_recommended_models)store_refreshed_models_for_identity / store_refresh_error_for_identity pattern that also appears in spawn_provider_inventory_refresh_jobs and the HandleDispatchFrom config-change handler. This is three copies of ~60 lines of identical logic. Consider extracting a shared helper (e.g., execute_refresh_job(&self, provider: Arc<dyn Provider>, job: &RefreshJob)) to reduce the maintenance surface.


This comment was generated by AI

Comment thread ui/goose2/src/shared/i18n/locales/es/settings.json
Copy link
Copy Markdown
Collaborator

@matt2e matt2e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments that looked worthwhile to fix before merging, but I'm stamping it

added provider-scoped ACP methods for config read/status/save/delete
moved provider credential UI off Tauri commands and onto generated SDK calls
removed the duplicate desktop provider config table and Tauri GooseConfig service
batched secret writes/deletes in base.rs, with docstrings restored
kept dictation separate, but moved its API-key save/delete off the removed Tauri commands and onto generic ACP secret methods
added Rust and frontend coverage for the new flow
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e94e54a1a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/goose2/src/features/providers/hooks/useCredentials.ts Outdated
@kalvinnchau kalvinnchau force-pushed the kalvin/model-reload branch from 0e94e54 to 25c5d4e Compare April 29, 2026 15:21
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25c5d4e3be

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/goose2/src/features/providers/hooks/useCredentials.ts
Comment thread ui/goose2/src/features/providers/hooks/useCredentials.ts Outdated
suppress stale refresh warnings after provider disconnects and refresh
native oauth status when the initial inventory refresh request fails.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57bedefffb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/goose/src/acp/server.rs
@kalvinnchau kalvinnchau added this pull request to the merge queue Apr 29, 2026
Merged via the queue into main with commit 899762a Apr 29, 2026
27 of 28 checks passed
@kalvinnchau kalvinnchau deleted the kalvin/model-reload branch April 29, 2026 16:19
lifeizhou-ap added a commit that referenced this pull request Apr 30, 2026
* main: (24 commits)
  fix: copy and content improvements in goose2 (#8886)
  feat: make ollama host configurable in goose2 (#8912)
  polish sidebar navigation and project icons (#8896)
  fix: model picker stays usable during provider loading (#8900)
  feat: update provider row after saving credentials (#8914)
  feat: support google model inventory refresh (#8913)
  chore: Added goose 2 UI refactor review skill (#8903)
  blog: goose with peekaboo (#8884)
  blog: Built-in Local Inference blogpost. (#8808)
  perf: parallelize provider resolution and eagerly init SQLite pool (#8899)
  refactor: update goose2 credential management behind provider-scoped ACP/core API (#8887)
  fix: handle acp requests concurrently (#8781)
  build: set LLAMA_STATIC_CRT for Windows CUDA (#8901)
  perf: deduplicate _goose/providers/list RPC call at startup (#8873)
  chore: add a bit more instructions in the release pr (#8890)
  chore: disable spellcheck in model search (#8889)
  add skills to the chat composer (#8881)
  mergeable configs + cleanup (#8378)
  refactor: agent provider to use explicit type states (#8879)
  [goose2] MCP Apps: hydrate and replay app payloads in Goose2 (#8632)
  ...
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.

3 participants