Repository navigation
feat(agents): resolve bare agent names through the agents catalog - #1333
Merged
Merged
Conversation
infer agents add <name> now falls back to the published agents catalog (inference-gateway/agents catalog.json) when a name has no built-in defaults, deriving the URL from spec.server and the OCI image from spec.deployment with a ghcr.io/inference-gateway/<name>:<version> fallback for agents sourced from the org - the same derivation the registry site renders. Built-in defaults still win and the old URL-required error is unchanged when a name is in neither place.
inference-gateway-maintainer
Bot
marked this pull request as ready for review
September 26, 2026 01:42
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
September 26, 2026 01:42
3 tasks
Contributor
|
🎉 This PR is included in version 0.209.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Resolves #1332
Summary
infer agents add <name>only accepted a bare name for the five agents hardcoded inconfig/agent_defaults.go; every other catalog entry (e.g.grafana-agent) failed withURL is required for unknown agent. This adds a catalog fallback: when a name has no built-in defaults and no URL was passed, the CLI fetches the published agents catalog (inference-gateway/agentscatalog.json) and derives the entry from it, mirroring exactly what the registry site'sderiveInstallCommand/deriveImagehelpers render today.Changes
cmd/agents/catalog.go: fetcheshttps://raw.githubusercontent.com/inference-gateway/agents/main/catalog.json(best-effort, nil on any failure) and resolves an entry intoconfig.AgentDefaults:spec.server(<scheme>://localhost:<port>, defaults http/8080, free port picked like the built-in defaults),spec.deployment.cloudrun/kubernetes.imagewhen declared, elseghcr.io/inference-gateway/<name>:<version>whenspec.scm.urlpoints at the inference-gateway GitHub org (the registry's fallback; this is what fires for all six current entries),run: trueonly when an image could be derived.cmd/agents/agents.go: consulted after built-in defaults (which still win), before the existingURL is required for unknown agenterror (unchanged, still names the URL argument); help text updated.cmd/agents/catalog_test.go: table-driven tests via httptest covering the scm-derived image, deployment-declared image winning, third-party URL-only entries, unknown names, and an unreachable catalog.Behavior
infer agents add grafana-agentnow writes a working entry: URLhttp://localhost:<free port>, OCIghcr.io/inference-gateway/grafana-agent:0.3.9,run: true.URL is required for unknown agent ....Downstream
<name> <url> --oci <image> --runform for non-built-in agents) can now be dropped; follow-up issue filed.no docs ticket: docs update filed separately (agents add catalog resolution documented in the [DOCS] issue).