fix(provision): resolve template-asset fetch by TEMPLATE not runtime (fixes seo-agent skills, #32) #2991

Merged
core-devops merged 1 commits from fix/template-asset-fetch-by-template-not-runtime into main 2026-06-16 15:27:44 +00:00
Member

ROOT CAUSE of SEO agents having no skills. The RFC#2843 fetch identity used payload.Runtime, but templateRepoByName is keyed by TEMPLATE NAME. A variant (seo-agent runs runtime=claude-code, template=seo-agent) resolved templateRepoByName[claude-code] = claude-code-default (no agent-skills/seo-all) → seo-agent skills NEVER fetched; config+prompts came via legacy SM path, masking it. Fix: resolve from payload.Template first, fall back to runtime. Verified: fetch yields 504KB incl 77 agent-skills files (under 16MiB cap). Adds TestTemplateIdentityForTemplateOrRuntime regression gate. Found via code-reading after box-log access was blocked.

ROOT CAUSE of SEO agents having no skills. The RFC#2843 fetch identity used payload.Runtime, but templateRepoByName is keyed by TEMPLATE NAME. A variant (seo-agent runs runtime=claude-code, template=seo-agent) resolved templateRepoByName[claude-code] = claude-code-default (no agent-skills/seo-all) → seo-agent skills NEVER fetched; config+prompts came via legacy SM path, masking it. Fix: resolve from payload.Template first, fall back to runtime. Verified: fetch yields 504KB incl 77 agent-skills files (under 16MiB cap). Adds TestTemplateIdentityForTemplateOrRuntime regression gate. Found via code-reading after box-log access was blocked.
core-devops added 1 commit 2026-06-16 15:23:50 +00:00
fix(provision): resolve template-asset fetch by TEMPLATE, not runtime (fixes seo-agent skills never delivered, #32)
CI / Python Lint & Test (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 8s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request_target) Has been skipped
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 7s
Harness Replays / detect-changes (pull_request) Successful in 8s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 7s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
E2E API Smoke Test / detect-changes (pull_request) Successful in 15s
security-review / approved (pull_request_target) Failing after 7s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 5s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 9s
qa-review / approved (pull_request_target) Failing after 10s
PR Diff Guard / PR diff guard (pull_request) Successful in 14s
CI / Detect changes (pull_request) Successful in 21s
gate-check-v3 / gate-check (pull_request_target) Failing after 14s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 20s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 17s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
CI / Canvas (Next.js) (pull_request) Successful in 2s
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
sop-checklist / all-items-acked (pull_request_target) Successful in 18s
CI / Canvas Deploy Status (pull_request) Successful in 1s
E2E Chat / detect-changes (pull_request) Successful in 28s
E2E Chat / E2E Chat (pull_request) Successful in 4s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 33s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 46s
Harness Replays / Harness Replays (pull_request) Successful in 1m20s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m18s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 2m17s
CI / Platform (Go) (pull_request) Failing after 3m4s
CI / all-required (pull_request) Has been skipped
sop-checklist / all-items-acked (pull_request) Compensated by status-reaper (non-required pull_request/pull_request_review governance shadow overridden by successful pull_request_target status; see .gitea/scripts/status-reaper.py)
audit-force-merge / audit (pull_request_target) Successful in 10s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Platform Boot (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge user_tasks (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Workspace Requests (core#2606) (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Creates Workspace (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge (compile+skip) (pull_request) Waiting to run
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Platform Agent (pull_request) Waiting to run
6175814cfa
THE root cause of SEO agents having no agent-skills. The RFC #2843 fetch identity
was derived from payload.Runtime:
    TemplateIdentity: templateIdentityForRuntimeOrEmpty(payload.Runtime)
but templateRepoByName is keyed by TEMPLATE NAME (claude-code, seo-agent,
platform-agent, …; initTemplateRepoByName strips the -default suffix). A template
VARIANT like seo-agent runs runtime=claude-code with template=seo-agent — so the
fetch resolved templateRepoByName["claude-code"] (the claude-code-default
template), which has NO agent-skills/seo-all. The seo-agent template's skills
were therefore NEVER fetched; config.yaml + prompts arrived via the legacy SM
path, masking the gap. Verified live: a fresh seo-agent gets config+prompts but
agent-skills/seo-all is empty, on EVERY provision path.

Fix: resolve the fetch identity from payload.Template first, falling back to
runtime (templateIdentityForTemplateOrRuntime). For seo-agent this now resolves
the seo-agent repo → the fetch (verified: 504KB incl 77 agent-skills files, under
the 16MiB cap) delivers agent-skills/seo-all. Runtime fallback preserves the
common runtime==template-name case (hermes/codex/openclaw/google-adk); external
runtimes still resolve empty (fetcher skipped).

Adds TestTemplateIdentityForTemplateOrRuntime gating the regression (asserts the
seo-agent variant resolves to its OWN repo, not claude-code's).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
core-devops merged commit f57a32871e into main 2026-06-16 15:27:44 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2991