Repository navigation
π scheduler: fetch AGENTS.md from GitHub when a hosted spoke has no local checkout - #17093
Merged
Merged
Conversation
β¦ocal checkout Hosted spokes keep no clone of their primary repo, so both roots agentsRepoRoot knows (project.checkouts_dir, policies.local_dir) are empty and primeAgentsMd was a silent no-op: hive's own hive showed zero agentsmd: log lines. Add a third source: when no local root exists and a GitHub client is wired, fetch AGENTS.md from the repo's default branch, cache it for 15 minutes (the conditional-GET transport makes refreshes free), keep the last-known-good copy across API failures, and materialise it under /data/agentsmd-cache/<owner>/<repo>/ so Parse/Render/primeSkills and the injection cap run unchanged. Fixes #17090 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
This was referenced Nov 7, 2026
Merged
Contributor
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
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.
Fixes #17090
Problem
A hosted spoke keeps no clone of its primary repo, so both roots
agentsRepoRoot()knows βproject.checkouts_dirand apolicies.local_dirthat matches the repo β are empty andprimeAgentsMd("")is a silent no-op. Hive's own hive (hive-hosted-β¦-r05x, branch v5) shows zeroagentsmd:log lines over hours of kicks. Pointingpolicies.repoat the primary repo is not a safe workaround:loadPromptTemplatewould then read<local_dir>/examples/kubestellar/agents/<agent>.mdas kick templates.Fix
Third source in
agentsRepoRoot, used only when neither local root is configured and a GitHub client is wired (Scheduler.SetAgentsMdFetcher, set at boot fromb.ghClient):AGENTS.mdfrom the repo's default branch viaGetFileContentRefon the sharedpkg/githubclient (the ETag transport makes refreshes of an unchanged file free);owner/repofor 15 min, negative-cache a 404, and keep serving the last-known-good copy when a refresh fails;/data/agentsmd-cache/<owner>/<repo>/AGENTS.mdsoagentsmd.Parse,Render(existingproject.agents_md_max_bytescap),primeSkillsand the house-style path all run unchanged, and the existingagentsmd: injecting repo instructions into kick root=β¦line now says where the text came from.No behaviour change for hives that do have a local root, or that run without a GitHub client.
Tests
src/pkg/scheduler/kick_priming_test.go: no fetcher β unchanged; fetch + inject + single call inside TTL; 404 negative cache + last-known-good on later failure; local root still wins (no fetch).Checklist
changelog.d/fixed-agentsmd-hosted-fallback.md