Skip to content

fix: send agent provider in agent-project import providerResolutions - #229

Open
davhparry wants to merge 1 commit into
itential:mainfrom
davhparry:fix/agent-project-provider-resolutions-228
Open

davhparry wants to merge 1 commit into
itential:mainfrom
davhparry:fix/agent-project-provider-resolutions-228

Conversation

@davhparry

Copy link
Copy Markdown
Collaborator

Previously every agent was sent as null in providerResolutions, so the server chose the provider itself and imported agents ended up with a null provider or the profile's default model. Send each agent's own profileName and modelName from the bundle instead, falling back to null when the provider is missing or incomplete.

Closes #228

Description

import agent-project sent null for every agent in providerResolutions, so the platform chose the LLM provider itself. Imported agents could get the profile's default model or provider: null, even when a profile with the same name existed on the destination.

Each entry is now built from the agent's own provider in the bundle, so the platform resolves it by name and keeps the source model. The destination is expected to have a profile with the same name as the source. Mapping to a differently named profile is not part of this change.

Tool authorization (unauthorizedReferenceId) is a separate problem and stays in #225.

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Chore

Changes Made

  • pkg/services/agent_projects.go: new agentProviderResolution helper builds { "profileName", "modelName" } from an agent's provider. Import uses it instead of sending nil. An agent with no provider, or one missing either value, is still sent as null.
  • pkg/services/agent_projects_test.go: new TestAgentProjectService_Import_ProviderResolutions.

Testing

  • go test ./..., gofmt and go vet pass.
  • The new test captures the real request body sent to POST /agent-project-service/project-bundles/import and checks four agents: a full provider, a model name only, no provider, and an agent identified by uuid instead of _id.
  • Not yet run against a platform with a matching profile.

Checklist

  • Code follows the project's style guidelines
  • Self-review of code has been performed
  • Code has been commented where necessary
  • Tested with make setup or relevant profile
  • Commits follow conventional format (type: subject)
  • No secrets or credentials committed
  • Documentation has been updated accordingly
  • PR has been labeled appropriately (enhancement, bug, documentation, refactor, chore)

Previously every agent was sent as null in providerResolutions, so the
server chose the provider itself and imported agents ended up with a
null provider or the profile's default model. Send each agent's own
profileName and modelName from the bundle instead, falling back to null
when the provider is missing or incomplete.

Closes itential#228

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

bug: import agent-project sends null provider resolutions, so agents lose their LLM profile and model

1 participant