Use Nanobot's new config format + model provider dialects#6246
Use Nanobot's new config format + model provider dialects#6246calvinmclean wants to merge 11 commits intoobot-platform:mainfrom
Conversation
| webhookDefinitions := make(map[string][]string, len(webhooks)) | ||
| mcpServers := make(map[string]nanobotConfigMCPServer, len(webhooks)+1) | ||
| hookTargets := make(map[string][]string, len(webhooks)) | ||
| mcpServers := make(map[string]mcp.Server, len(webhooks)+1) |
There was a problem hiding this comment.
I changed these to be compatible with the Nanobot types, but not really sure what it does or how to test it at the moment
There was a problem hiding this comment.
It looks like the is functionally the same because of custom Marshal/Unmarshal logic for the Hooks type
There was a problem hiding this comment.
Pull request overview
This PR updates Obot to integrate Nanobot's new provider dialect system and per-agent provider configuration format. The changes enable Obot to read LLM provider dialects from tool metadata rather than relying on heuristics, and to dynamically configure only the providers actually needed by each agent.
Changes:
- Replaces locally-defined nanobot config structs with imported types from
github.com/nanobot-ai/nanobot/pkg/types - Adds
Dialectfield toCommonProviderMetadatain API types for declaring provider API formats - Introduces per-agent provider configuration via
NANOBOT_PROVIDER_CONFIGdynamic file credential - Adds init containers to inject provider configs into agent workspaces (Docker and Kubernetes)
- Refactors model resolution to capture provider info and dialect for each LLM model
- Updates function names from generic "constructNanobotYAML" to specific "constructMCPServerNanobotYAML" for clarity
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/mcp/backend.go | Replaces local types with nanobot pkg types; consolidates nanobot config construction logic |
| pkg/mcp/docker.go | Adds init container support for provider config injection; refactors repetitive init container code |
| pkg/mcp/kubernetes.go | Adds init container for provider config injection into agent workspaces |
| pkg/controller/handlers/nanobotagent/nanobotagent.go | Refactors model resolution to include provider and dialect info; builds provider-specific config YAML |
| pkg/controller/handlers/nanobotagent/nanobotagent_test.go | Updates tests to work with new resolvedLLMModel return type |
| apiclient/types/modelprovider.go | Adds Dialect field to CommonProviderMetadata |
| go.mod | Updates dependencies and adds local replace directive for nanobot (temporary) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| github.com/obot-platform/obot/logger => ./logger | ||
| ) | ||
|
|
||
| replace github.com/nanobot-ai/nanobot => github.com/calvinmclean/nanobot v0.0.0-20260408174919-d7f157a83d0c |
This PR updates Obot to consume Nanobot's new provider dialect and
llmProvidersconfig format introduced in nanobot-ai/nanobot#263.Addresses #6195
What Changed
Provider dialect support
dialectfield from model provider tool metadata (vialookupProviderDialect) rather than inferring the LLM client type from model name heuristicsDialectfield toCommonProviderMetadatain the API typesPer-agent provider config
NANOBOT_PROVIDER_CONFIGas a dynamic file credential injected into nanobot agent containersnanobot.yaml-format provider config containing only the LLM providers actually used by the agent (no more unconditionally injecting bothOPENAI_API_KEYandANTHROPIC_API_KEY).nanobot/nanobot.yamlinside the agent workspace volume via an init container (Docker and Kubernetes)Type consolidation in MCP backend
github.com/nanobot-ai/nanobot/pkg/typesandpkg/mcpDependencies
replacedirective pointing at a local path; will be updated to the released version once that PR is mergeddialectfield in model provider tool definitions (optional)