feat(desktop): remote agent backend providers in channel Add Agent dialog#150
Merged
tlongwell-block merged 2 commits intomainfrom Mar 21, 2026
Merged
Conversation
…lBotDialog Thread backend provider selection through the channel-context 'Add Agent' dialog so users can deploy agents to remote infrastructure (e.g., Blox workstations) directly from the channel header. Changes: - channelAgents.ts: Add backend field to CreateChannelManagedAgentInput, pass through to createManagedAgent with provider-mode flags (spawnAfterCreate, startOnAppLaunch), check spawnError on deploy failure - ChannelMembersBar.tsx: Wire useBackendProvidersQuery and pass results to AddChannelBotDialog - AddChannelBotDialog.tsx: Add 'Run on' selector, trust warning, provider config fields from probe, single-agent enforcement in provider mode (Teams hidden, persona/Generic mutually exclusive, selectedCount === 1) - ProviderConfigFields.tsx: Extract shared coerceConfigValues and ProviderConfigFields from CreateAgentDialog (deduplication) - CreateAgentDialog.tsx: Import from shared ProviderConfigFields module Local mode behavior is completely preserved — the 'Run on' selector only appears when sprout-backend-* binaries are discovered on PATH.
The backend script now supports multiple simultaneous ACP harnesses on one workstation (per-agent config/log/pid files, no global pkill). Remove the single-agent enforcement from the channel dialog: - Re-enable batch creation (Teams, multi-persona, Generic + personas) - Restore standard toggle/selection behavior in provider mode - Restore original dialog description and hint text Provider mode now works identically to local mode for agent selection — the only additions are the Run on selector, trust warning, and config fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The channel-context Add Agent dialog (
+button in the channel header) can now deploy agents to remote infrastructure via backend providers.Previously this dialog only created local agents. The global Create Agent dialog (Agents view) already had full "Run on" support from #134, but the quick-add channel flow did not. This PR threads backend provider selection through the channel dialog using the same hooks and patterns.
Multi-agent support
Multiple agents can be deployed to the same remote target simultaneously. The desktop calls
deployonce per agent — each invocation is independent. Backend providers are responsible for multi-agent coexistence (e.g., per-agent config isolation, process management). The GUI does not know or care about the implementation details — it just sends N deploy requests with the sameprovider_config, and each returns a uniqueagent_id.Each agent runs as an independent
sprout-acpprocess with its own Nostr identity. Stop/shutdown targets individual agents by pubkey via!shutdown.What it looks like
No backend providers on PATH → dialog is identical to today. Zero behavior change.
Backend providers discovered → a "Run on" selector appears above the Runtime dropdown:
Selecting a provider shows:
config_schemaChanges
channelAgents.tsbackendfield onCreateChannelManagedAgentInput; thread tocreateManagedAgentwith provider-mode flags;spawnErrorcheckChannelMembersBar.tsxuseBackendProvidersQuery, pass to dialogAddChannelBotDialog.tsxProviderConfigFields.tsxcoerceConfigValues+ProviderConfigFieldsfromCreateAgentDialogCreateAgentDialog.tsxcheck-file-sizes.mjsAddChannelBotDialog(600 lines)Total: +267/−88 across 6 files.
Design decisions
spawnErrorcheck is load-bearingTauri's
create_managed_agentreturnsOk()even on deploy failure —spawnErrorcarries the message. Without the explicit check increateChannelManagedAgent, deploy failures would be silently swallowed and the agent would appear to succeed.Batch creation works in provider mode
The GUI calls deploy N times with the same
provider_config. Each call is an independent invocation of the backend provider binary (stdin/stdout JSON, one-shot). Backend providers are responsible for multi-agent coexistence — the desktop makes no assumptions about how the provider manages multiple agents on the same target.ACP runtime always required
Unlike
CreateAgentDialog(which has Advanced Setup fields that fall back to Rust defaults), the channel dialog has no Advanced Setup. The Runtime dropdown is the only way to specifyagentCommand/agentArgs, which flow through the deploy payload to the remote provider.Deploy-before-attach ordering is safe
The
sprout-acpharness subscribes to membership notifications before channel discovery, then callsdiscover_channels()via REST. So: create → deploy (agent starts, discovers channels) → attach to channel (agent picks up via live notification subscription). No restart required.Explicit
backend: { type: "local" }in local modeMatches
CreateAgentDialogpattern. Rust hasDefault for BackendKind = Local, soundefinedwould work, but explicit is safer and consistent.Testing
CreateAgentDialog)