Repository navigation
fix(update): keep an agent's source when updating it - #778
Merged
Merged
Conversation
After the first `update agents`, an agent's recorded source became `/agents/<name>.md` with type `unknown-subdir` and no repo URL, so `check agents` stopped looking upstream and later changes never arrived (#777). The batch path rebuilt the repository source from the clone URL, subdir and branch only, leaving Raw and Type empty, and the metadata written back was built from that empty Raw. The fallback reinstall and the dashboard update kept the agent's full source as Raw while clearing the subdir, so the written source repeated the agent path. AgentRepoSource now rebuilds the repository source once, by cutting the agent path off the recorded source, and all three paths use it, so the source written back is the one install recorded. Agents whose metadata was already rewritten have no repository left in it and need to be installed again.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
runkids
added a commit
that referenced
this pull request
Nov 4, 2026
The 0.28.4 Release PR (#767) merged, but GitHub's incident kept its search index from listing the merged PR, so no tag or draft was made. 0.28.4 should now also ship #778, which the merged release commit cannot include. Restoring the 0.28.3 manifest and changelog lets Release Please open a fresh 0.28.4 Release PR over the full range. Release-As: 0.28.4
… agents Agent update checks gave wrong answers in several cases next to #777: - Agents from one repository were compared with the first agent's version, so an older agent sharing a repo with a current one never showed its update. - The installed branch was never sent to the remote, so an agent pinned to a non-default branch was compared with the default branch head. - A tracked agent repo records its full commit while the remote hash is abbreviated, so a fresh clone always read as update_available; its checked-out branch was also ignored. - `update agents` printed "All agents are up to date" and exited 0 when agents could not be checked at all: an unreachable remote, unreadable metadata, or a source erased by the #777 bug. Each agent is now compared with its own version at its own branch, and an agent whose source the old bug erased reports an error asking for a reinstall, since its metadata no longer names a repository. Update lists the agents it could not check and exits non-zero, counting them apart from agents that failed to update. The docs describe the error status and the reinstall fix.
…ate flow Review of the previous commits found gaps in recovering agents that earlier updates broke, and in how the two update handlers report them: - A dashboard update before the #777 fix appended the agent path to its source a second time. Those agents keep their repo URL, so check offers an update, but discovery then failed on the doubled path. Every copy of the path is now cut, and the update writes the source back correctly. - On the dashboard, an agent whose source the CLI bug erased failed with "invalid source: source cannot be empty". AgentRepoSource now returns the same reinstall error check shows, and both use one detector. - When every tracked agent was such an erased agent, no remote was asked, so the "Checking agents" spinner was never stopped and drew over the error rows. It is now stopped once the check returns. - The global and project handlers repeated the check-and-update flow, and the project copy had already drifted (no dry-run log entry, spinner in --json). Both now run one shared flow. Tests cover the erased agent next to an updatable one in global, --json, --dry-run and project mode, and the doubled and erased sources in AgentRepoSource.
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.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
Closes #777
What and why
After the first
update agents, an agent's source was rewritten to/agents/<name>.md(typeunknown-subdir, norepo_url). Without a repo URL,check agentsnever looks upstream, so later changes never arrived.All three agent update paths rebuilt the repository source wrongly:
update agents --all)Sourcewith only clone URL, subdir and branch; noRaw, noType/agents/demo.md, typeunknown-subdir, repo URL lostreinstallAgentRawand cleared the subdir…/agents/demo.md/agents/demo.mdinternal/server/handler_update.go)The new
install.AgentRepoSourcerebuilds the repository source once, by cutting the agent path off the recorded source, the inverse ofbuildDiscoverySkillSource. All three paths use it.Tests
TestUpdate_Agents_RepeatedUpdatesKeepSource(integration): install from a git repo, push two changes, update twice; the second change arrives and the recorded source is unchanged. Failed before the fix withsource changed from "file:///…/agents/demo.md" to "/agents/demo.md".TestAgentRepoSource_RoundTripsAgentSource(unit): GitHub, SSH//andfile://sources, each as whole repo and repo subdir, round-trip to the source install recorded.//packsubdir installs, two updates each;source,typeandrepo_urlunchanged, latest content arrives.make checkpasses. After the review fixes,go vetand theinternal/install,internal/server,cmd/skillshareand integration agent tests were rerun and pass.Check fixes next to it (second commit)
Agent update checks were wrong in four related cases:
update_available.update agentsprinted "All agents are up to date" and exited 0 when agents could not be checked: an unreachable remote, unreadable metadata, or a source the update agents loses the agent's source, so later updates never arrive #777 bug erased.Each agent is now compared with its own version at its own branch. Agents whose source the old bug erased report
errorwith a reinstall hint, because their metadata no longer names a repository.update agentslists agents it could not check and exits non-zero (check agentsalready did). Docs inupdate.md,check.mdand troubleshooting, plus their ja, ko, zh-Hans and zh-Hant copies, describe theerrorstatus and the reinstall fix.Tests:
TestEnrichAgentResultsWithRemote_ComparesEachAgentAtItsBranch,TestCheckAgents_SourceErasedByEarlierUpdate,TestCheckAgents_TrackedRepoComparedAtItsBranch,TestUpdate_Agents_ErasedSourceAsksToReinstall,TestUpdate_Agents_InvalidMetadataFails. Each failed before the fix.make checkpasses, the website builds (npm run build, rc=0), andpython3 scripts/ai-context.py checkpasses.Recovery and cleanup (third commit)
…/agents/demo.md/agents/demo.md). Those agents kept their repo URL, so check offered an update and discovery then failed.AgentRepoSourcenow cuts every copy of the path, and the next update writes the source back correctly (verified in the devcontainer: the agent updates and its source becomes…/agents/demo.md).invalid source: source cannot be emptyfor an agent the CLI bug erased; it now shows the same reinstall hint ascheck.update agentshandlers now share one flow. The project copy had drifted: its--dry-runwrote no operation log entry, and it started the spinner under--json.Tests:
TestUpdate_Agents_LostSourceDoesNotBlockOthers(global,--json,--dry-run, project: the updatable agent still updates, the broken one is listed, exit non-zero) andTestAgentRepoSource_BrokenSources.make checkpasses.Not covered
skillshare install <repo> --kind agent --all --force.Checklist
make check) — for code changes