Skip to content

refactor: rename ACP "provider" to "runtime" across the codebase#783

Draft
wpfleger96 wants to merge 7 commits into
mainfrom
worktree-wpfleger+fix-model-picker-runtime-ux
Draft

refactor: rename ACP "provider" to "runtime" across the codebase#783
wpfleger96 wants to merge 7 commits into
mainfrom
worktree-wpfleger+fix-model-picker-runtime-ux

Conversation

@wpfleger96
Copy link
Copy Markdown
Collaborator

@wpfleger96 wpfleger96 commented May 29, 2026

Stack: This is Phase 2 of 2. Phase 3 (#791) is stacked on this branch and consumes the capability metadata fields added here.

This branch renames every use of "provider" that means ACP harness/runtime to "runtime", resolves the pack import conflation that caused all 7 Dune personas to show "sprout-agent" as runtime, and enriches KnownAcpRuntime with capability metadata for Phase 3.

The codebase used "provider" for three unrelated concepts: ACP runtime/harness (goose, claude, codex), LLM inference provider (Databricks, Anthropic), and deployment backend — making it impossible to read a field name and know what it contains. The rename establishes a clean vocabulary. BackendKind::Provider and related deployment backend types are intentionally NOT renamed.

Changes

  • KnownAcpProviderKnownAcpRuntime with 5 new capability fields (supports_acp_model_switching, model_env_var, provider_env_var, provider_locked, default_env) that Phase 3 will consume for metadata-driven env var injection
  • PersonaRecord.providerPersonaRecord.runtime with an idempotent startup migration in migration.rs
  • ResolvedPersona.providerResolvedPersona.llm_provider to make explicit it comes from the model string colon prefix
  • PersonaConfig/Frontmatter gain a runtime field so persona packs can specify their preferred harness in frontmatter
  • Pack import conflation fixed: llm_provider no longer leaks into PersonaRecord.runtime (was the root cause of the Dune persona bug)
  • persona_card.rs reads "provider" as a fallback key from old .persona.json files; TemplateAgentEntry/TemplateTeamEntry use #[serde(alias = "provider")] for backward compat
  • install_acp_runtime Tauri IPC param renamed from provider_id to runtime_id (coordinated Rust + TS)
  • useLastRuntime localStorage key migrated from "sprout:last-runtime-provider" to "sprout:last-runtime" with fallback read from the legacy key so existing users don't lose their saved preference
  • Unit tests added for the providerruntime persona migration and template serde alias backward compat

The codebase conflated three unrelated concepts under "provider": ACP
runtime/harness (goose, claude, codex), LLM inference provider
(Databricks, Anthropic), and deployment backend. This rename
disambiguates the first concept as "runtime" throughout.

KnownAcpProvider becomes KnownAcpRuntime with new capability metadata
fields (supports_acp_model_switching, model_env_var, provider_env_var,
provider_locked, default_env) that Phase 3 will consume for
metadata-driven env var injection.

PersonaRecord.provider becomes PersonaRecord.runtime with an idempotent
startup migration. ResolvedPersona.provider becomes
ResolvedPersona.llm_provider to clarify it holds the LLM provider from
the model string colon prefix, not the harness ID.

PersonaConfig/Frontmatter gain a runtime field so persona packs can
declare their preferred harness. The pack import conflation is fixed:
llm_provider no longer leaks into PersonaRecord.runtime.

persona_card.rs reads "provider" as a fallback key from old
.persona.json files. TemplateAgentEntry/TemplateTeamEntry use serde
alias for the same backward compat.

Deployment backend types (BackendKind::Provider, provider_binary_path)
are intentionally NOT renamed.
Remaining provider: field names in PersonaDialog submit, personaDialogState
initial values, useTeamActions update call, and test fixtures that were
missed in the main rename — all feeding into CreatePersonaInput /
UpdatePersonaInput which now only accept runtime:.
localStorage key migration: useLastRuntime now reads the legacy
"sprout:last-runtime-provider" key as a fallback and clears it on
first write, preventing silent loss of saved runtime preference on
upgrade. Remaining stale local variable names (selectedProviderId,
acpProvidersQuery, etc.) renamed for consistency across 12 TS files.
Migration and template serde alias backward-compat tests added.
@wpfleger96 wpfleger96 force-pushed the worktree-wpfleger+fix-model-picker-runtime-ux branch from 430fc47 to 32b58f7 Compare May 29, 2026 14:48
… dropdown UX

Replace hardcoded GOOSE_MODE injection with a metadata-driven
default_env loop on KnownAcpRuntime, and inject GOOSE_MODEL via
model_env_var for runtimes that don't support ACP model switching.
This ensures goose agents respect PersonaRecord.model even without
a persona pack.

Redesign the AddChannelBotDialog runtime dropdown: defaults to "Use
persona defaults" (unset) instead of auto-selecting the first runtime.
Explicit selection overrides all personas. Per-persona runtime badges
on chips show the effective runtime with warning styling when overridden
or when a stored preference is unavailable.
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