Skip to content

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

Merged
wpfleger96 merged 8 commits into
mainfrom
worktree-wpfleger+fix-model-picker-runtime-ux
Jun 7, 2026
Merged

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

Conversation

@wpfleger96

@wpfleger96 wpfleger96 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Stack: this PR (#783) → #794. Merge this first, then rebase #794 onto main.

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, enriches KnownAcpRuntime with capability metadata, and uses that metadata to replace ad-hoc env var injection with structured, metadata-driven behavior.

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. BackendKind::Provider and related deployment backend types are intentionally NOT renamed.

  • KnownAcpProviderKnownAcpRuntime with 5 new capability fields (supports_acp_model_switching, model_env_var, provider_env_var, provider_locked, default_env)
  • PersonaRecord.providerPersonaRecord.runtime with idempotent startup migration; ResolvedPersona.provider.llm_provider
  • PersonaConfig/Frontmatter gain a runtime field so persona packs can declare preferred harness in frontmatter
  • Pack import conflation fixed: llm_provider no longer leaks into PersonaRecord.runtime
  • persona_card.rs reads "provider" as fallback key from old .persona.json files; template types use #[serde(alias = "provider")] for backward compat
  • useLastRuntime localStorage key migrated with legacy fallback so existing users keep their saved preference
  • Hardcoded GOOSE_MODE injection replaced with default_env loop from KnownAcpRuntime metadata — only goose agents receive GOOSE_MODE now
  • GOOSE_MODEL injected at spawn time via model_env_var metadata for runtimes that don't support ACP model switching
  • Runtime dropdown defaults to "Use persona defaults" instead of auto-selecting first runtime; explicit selection overrides all persona preferences; per-persona runtime badges on chips with warning color for overrides

@wpfleger96 wpfleger96 force-pushed the worktree-wpfleger+fix-model-picker-runtime-ux branch from 430fc47 to 32b58f7 Compare May 29, 2026 14:48
@wpfleger96 wpfleger96 force-pushed the worktree-wpfleger+fix-model-picker-runtime-ux branch 2 times, most recently from 6c90bad to d54f3c0 Compare June 3, 2026 19:38
@wpfleger96 wpfleger96 force-pushed the worktree-wpfleger+fix-model-picker-runtime-ux branch from d54f3c0 to 9842fec Compare June 4, 2026 22:42
@wpfleger96 wpfleger96 marked this pull request as ready for review June 4, 2026 22:45
@wpfleger96 wpfleger96 requested a review from a team as a code owner June 4, 2026 22:45
@wpfleger96 wpfleger96 force-pushed the worktree-wpfleger+fix-model-picker-runtime-ux branch 2 times, most recently from 70f9c0b to 643f3ec Compare June 5, 2026 20:17
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.
… 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.
@wpfleger96 wpfleger96 force-pushed the worktree-wpfleger+fix-model-picker-runtime-ux branch from 643f3ec to c9b0d56 Compare June 6, 2026 00:48
The idempotent `migrate_persona_provider_to_runtime` function added in
this branch pushes migration.rs past main's 1005-line override.
@wpfleger96 wpfleger96 force-pushed the worktree-wpfleger+fix-model-picker-runtime-ux branch from c9b0d56 to dffa75e Compare June 6, 2026 01:02
@wpfleger96 wpfleger96 merged commit 0a6067c into main Jun 7, 2026
16 checks passed
@wpfleger96 wpfleger96 deleted the worktree-wpfleger+fix-model-picker-runtime-ux branch June 7, 2026 18:41
tlongwell-block added a commit that referenced this pull request Jun 8, 2026
The provider→runtime rename in #783 missed this callsite in
mesh_llm/preset.rs, causing a compilation error.
tlongwell-block added a commit that referenced this pull request Jun 8, 2026
The provider→runtime rename in #783 missed a callsite in
mesh_llm/preset.rs and a stale doc comment in mesh_llm/mod.rs.
tellaho pushed a commit that referenced this pull request Jun 8, 2026
tlongwell-block pushed a commit that referenced this pull request Jun 9, 2026
* origin/main: (32 commits)
  docs: add NIP-ER event reminders (#875)
  feat(acp): pass slash commands through to ACP connectors (#919)
  fix(sdk): resolve multi-word display names and add NIP-27 nostr:npub mention extraction (#905)
  fix(desktop): re-enable mcp_command reconciliation and harden spawn site (#909)
  Fix desktop DM and sidebar UI polish (#908)
  Animate reaction counts (#904)
  Mobile custom emoji + settings redesign (#906)
  Renew TTL when unarchiving ephemeral channels (#902)
  chore(release): release version 0.3.13 (#903)
  Collapse channel header actions (#901)
  sprout-agent: make Databricks defaults env-only (#868)
  Restyle settings sections (#894)
  Add emoji reaction particles (#890)
  Move settings into the app shell (#893)
  Tune chat text sizing (#891)
  Style channel header navigation (#889)
  fix: rename missed known_acp_provider_exact → known_acp_runtime_exact (#900)
  chore(deps): update radix-ui-primitives monorepo (#898)
  chore(deps): update actions/checkout digest to df4cb1c (#897)
  refactor: rename ACP "provider" to "runtime" across the codebase (#783)
  ...

# Conflicts:
#	desktop/src/features/agents/ui/CreateAgentDialog.tsx
tlongwell-block pushed a commit that referenced this pull request Jun 9, 2026
* origin/main: (32 commits)
  docs: add NIP-ER event reminders (#875)
  feat(acp): pass slash commands through to ACP connectors (#919)
  fix(sdk): resolve multi-word display names and add NIP-27 nostr:npub mention extraction (#905)
  fix(desktop): re-enable mcp_command reconciliation and harden spawn site (#909)
  Fix desktop DM and sidebar UI polish (#908)
  Animate reaction counts (#904)
  Mobile custom emoji + settings redesign (#906)
  Renew TTL when unarchiving ephemeral channels (#902)
  chore(release): release version 0.3.13 (#903)
  Collapse channel header actions (#901)
  sprout-agent: make Databricks defaults env-only (#868)
  Restyle settings sections (#894)
  Add emoji reaction particles (#890)
  Move settings into the app shell (#893)
  Tune chat text sizing (#891)
  Style channel header navigation (#889)
  fix: rename missed known_acp_provider_exact → known_acp_runtime_exact (#900)
  chore(deps): update radix-ui-primitives monorepo (#898)
  chore(deps): update actions/checkout digest to df4cb1c (#897)
  refactor: rename ACP "provider" to "runtime" across the codebase (#783)
  ...

Signed-off-by: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co>

# Conflicts:
#	desktop/src/features/agents/ui/CreateAgentDialog.tsx
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.

2 participants