Skip to content

Add codefly agent versions + agent list for pin resolvability (#104) - #105

Merged
AntoineToussaint merged 3 commits into
mainfrom
issue-104-agent-command-to-list-agent-versions-resolvability-latest
Jul 23, 2026
Merged

Add codefly agent versions + agent list for pin resolvability (#104)#105
AntoineToussaint merged 3 commits into
mainfrom
issue-104-agent-command-to-list-agent-versions-resolvability-latest

Conversation

@AntoineToussaint

@AntoineToussaint AntoineToussaint commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

User description

Closes #104.

Summary

  • There was no way to ask codefly "what versions of an agent exist, and which are actually usable?" — diagnosing an unpublishable pin (a git tag with no downloadable release asset / OCI manifest) meant cross-checking tags, releases, and the pin by hand.
  • Adds codefly agent versions <publisher/name>: one table unioning git tags, GitHub release assets (for the CI os/arch), OCI manifests, the workspace pin, and the local cache — plus a latest tag vs latest resolvable line that makes the module-saas-starter#3 gap explicit (a newer tag with no published artifact).
  • Adds codefly agent list: the workspace-wide "are all my pins publishable?" view, one row per distinct pinned agent with its pinned/resolvable/latest columns. The interactive counterpart of the ci: pre-flight validation that pinned agent versions are downloadable #101 pre-flight gate.
  • Both take --json for scripting; GitHub reads use GITHUB_TOKEN/GH_TOKEN when present so the many-request list path doesn't hit the unauthenticated rate limit.

Notes

  • Resolvability follows the same source model as the ci: pre-flight validation that pinned agent versions are downloadable #101 pre-flight validation: a version is resolvable when a CI-downloadable artifact exists (GitHub release asset for linux_amd64, or an OCI manifest when AGENT_REGISTRY is set). A tag alone is not resolvable.
  • GitHub lookup failures (missing repo, rate limit) degrade to a warning; the local-cache and pinned columns still render.

Test plan

  • go build ./...
  • go vet ./cmd/...
  • go test ./cmd/agents/ — new unit tests cover source-union flagging, latest-tag-beats-latest-resolvable, OCI-driven resolvability, non-semver tag skipping, local-cache scanning, workspace summarization (with inventory caching), and the auth transport
  • Manual: codefly agent versions codefly.dev/redis and --help for both commands; verified graceful degradation on GitHub rate-limit

🤖 Generated with Claude Code


CodeAnt-AI Description

Show which agent versions exist and which can actually be used

What Changed

  • Added codefly agent versions <publisher/name> to list all known versions of one agent, with clear marks for tags, downloadable releases, OCI availability, the current workspace pin, and the local cache
  • Shows the newest tag and the newest resolvable version side by side, so a newer tag with no downloadable artifact is easy to spot
  • Added codefly agent list to show every agent pinned in the workspace, whether the pinned version is usable, and which modules use it
  • Both commands support JSON output for scripting
  • GitHub lookups now use GITHUB_TOKEN or GH_TOKEN when available, reducing failures when checking many agents

Impact

✅ Faster pin checks
✅ Clearer version mismatch warnings
✅ Fewer rate-limit failures when listing many agents

🔄 Retrigger CodeAnt AI Review

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Surface, per agent, every known version and whether each is actually
usable — not just tagged. `codefly agent versions <publisher/name>`
unions git tags, GitHub release assets (for the CI os/arch), OCI
manifests, the workspace pin, and the local cache into one table, and
reports latest-tag vs latest-resolvable so the module-saas-starter#3
gap (a tag with no downloadable artifact) is obvious. `codefly agent
list` gives the workspace-wide "are all my pins publishable?" view.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@slopbuster

slopbuster Bot commented Jul 23, 2026

Copy link
Copy Markdown

💳 Subscription Required

codefly-dev has used all free reviews this month.

Subscribe to continue

@codeant-ai

codeant-ai Bot commented Jul 23, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 684f939 Jul 23, 2026 · 15:56 16:00

Updated in place by CodeAnt AI · last 5 reviews

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Jul 23, 2026
Comment thread cmd/agents/versions.go
Comment on lines +74 to +83
func (inv inventory) versionResolvable(version string) bool {
if version == "latest" {
return inv.LatestResolvable != ""
}
for _, entry := range inv.Versions {
if entry.Version == version {
return entry.Sources.resolvable()
}
}
return false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: versionResolvable compares the pinned version string verbatim against normalized inventory versions, so pins written as vX.Y.Z are incorrectly reported as unresolvable even when the same version exists as X.Y.Z. Normalize non-latest input (trim v and semver-normalize) before matching, so resolvability checks are consistent with buildInventory. [logic error]

Severity Level: Major ⚠️
- ⚠️ `agent versions` shows resolvable v-prefixed pins as unresolvable.
- ⚠️ `agent list` misreports pinned resolvability status.
- ⚠️ Workspace publishability diagnostics become misleading for operators.
Steps of Reproduction ✅
1. Configure a workspace service that pins an agent version as `v0.0.74`, so
`service.Agent.Version` is `v0.0.74` when loaded via `workspace.LoadServices` in
`pinnedVersions()` at `cmd/agents/versions.go:335-349`.

2. Run `codefly agent versions <publisher/name>` for that agent; `VersionsCmd.RunE` at
`cmd/agents/versions.go:92-111` calls `collectInventory(ctx, agent, pinnedVersions(ctx,
agent))`, passing the raw pinned version string `v0.0.74`.

3. Inside `buildInventory()` at `cmd/agents/versions.go:170-245`, each source version
(including the pinned `v0.0.74`) is normalized via
`semver.Parse(strings.TrimPrefix(version, "v"))`, and the canonical value (e.g., `0.0.74`)
is stored in `entry.Version` and `inv.Versions`, while `inv.Pinned` retains the original
`v0.0.74` string.

4. `renderInventory()` at `cmd/agents/versions.go:486-516` prints each pin using
`fmt.Printf("pinned -> %s (resolvable: %s)\n", pin, yesNo(inv.versionResolvable(pin)))` at
line 514; `versionResolvable()` at lines 74-83 compares the raw `pin` (`v0.0.74`) to
normalized `entry.Version` (`0.0.74`) and never matches, causing
`entry.Sources.resolvable()` to be ignored and the pin to be reported as `resolvable: no`
even when a GitHub release asset or OCI manifest exists for that version.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** cmd/agents/versions.go
**Line:** 74:83
**Comment:**
	*Logic Error: `versionResolvable` compares the pinned version string verbatim against normalized inventory versions, so pins written as `vX.Y.Z` are incorrectly reported as unresolvable even when the same version exists as `X.Y.Z`. Normalize non-`latest` input (trim `v` and semver-normalize) before matching, so resolvability checks are consistent with `buildInventory`.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

…se marks

- List OCI registry tags via the distribution-spec tags/list endpoint so a
  version published only to OCI still surfaces (was invisible when it wasn't
  also tagged/released/cached).
- `agent versions` pins the spec to :latest before parsing so the core "no
  version specified" warning no longer fires on the bare form.
- `agent list` skips a service that fails to load with a warning instead of
  aborting the whole publishability overview.
- Warn on the latest tag only when that tag is itself unresolvable, not on any
  string difference from latest-resolvable.
- Absent tag/pinned/cache cells render "-" (n/a) instead of ✗ (error); nil
  version list marshals to [] not null.
- Cross-check test pins githubSource to manager.DownloadURL as the single
  source of truth for the owner/repo mapping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@slopbuster

slopbuster Bot commented Jul 23, 2026

Copy link
Copy Markdown

💳 Subscription Required

codefly-dev has used all free reviews this month.

Subscribe to continue

The column previously showed ✗ for a version whose release ships assets only
for the host arch (not linux_amd64), which reads as "no artifact" while
local-cache shows ✓ for the same version. Now the release's actual platform
set is captured and rendered: "✓ <platforms>" when the CI asset is present,
"✗ (<platforms>)" when only non-CI assets exist, plain "✗" when the release
has no downloadable asset. Resolvability is unchanged — still the CI-platform
asset (or OCI).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@slopbuster

slopbuster Bot commented Jul 23, 2026

Copy link
Copy Markdown

💳 Subscription Required

codefly-dev has used all free reviews this month.

Subscribe to continue

@AntoineToussaint
AntoineToussaint merged commit 88ae9e1 into main Jul 23, 2026
2 checks passed
@AntoineToussaint
AntoineToussaint deleted the issue-104-agent-command-to-list-agent-versions-resolvability-latest branch July 23, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent: command to list agent versions + resolvability (latest, all released, pinned, cached)

1 participant