fix(#2805): resolve relative resources for URL-sourced config agents#2807
Conversation
Site previewPreview: https://d2ec7abb-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
/fs-review |
|
🤖 Finished Review · ❌ Failure · Started 11:15 PM UTC · Completed 11:27 PM UTC |
ReviewFindingsMedium
Labels: Bug fix in harness composition code for URL-sourced config agent resource resolution. |
|
/fs-fix rebase, fix the coverage test so it passes, fix the conflicts, fix the review findings, commit and squash, and rebase. |
|
🤖 Finished Fix · ✅ Success · Started 11:45 PM UTC · Completed 11:55 PM UTC |
When a harness is fetched from a URL via config-driven agent registration (ADR-0058) and has no base: field, LoadWithBase returned early without calling resolveBaseScripts or resolveBaseResources. Relative resource paths (agent, policy, skills, scripts) remained as unresolved strings that fail at runtime because the files don't exist on the local filesystem. The fix adds a SourceURL field to ComposeOpts. When set (by run.go from the FetchAgentHarness dependency), LoadWithBase calls resolveBaseScripts and resolveBaseResources on the harness using the source URL, applying the same ADR-0045 resolution infrastructure that already exists for base: composition. Changes: - ComposeOpts.SourceURL: new field carrying the fetch origin URL - LoadWithBase: call resolution functions in the no-base path when SourceURL is set - run.go: forward fetchDeps[0].URL as SourceURL before LoadWithBase - run_test.go: update TestRunAgent_ConfigAgentURL to serve the agent resource (now resolved from URL instead of local disk) - compose_test.go: add three tests covering URL-sourced resolution, no-op for absolute paths, and backward compatibility without SourceURL Note: pre-commit could not run (shellcheck-py failed to install in sandbox due to network restrictions). The post-script runs an authoritative pre-commit check. Closes #2805
🔧 Fix agent — iteration 1 (human-triggered)Rebased on main and resolved merge conflict in compose_test.go (host_files tests from main + SourceURL tests from this branch). All changed-package tests pass. Single clean commit on top of main. Fixed (2):
Tests: passed Updated by fullsend fix agent |
dc31ec1 to
f0fb411
Compare
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
|
/fs-fix the coverage test is still failing - make sure it has >= 80% coverage! |
|
🤖 Finished Fix · ✅ Success · Started 12:07 AM UTC · Completed 12:16 AM UTC |
Add tests covering the error branches when resolveBaseScripts and resolveBaseResources fail during URL-sourced harness loading (e.g., script/resource URL not in org allowlist). This raises LoadWithBase patch coverage from 79.5% to 84.1%, meeting the 80% threshold. Addresses review feedback on #2807
🔧 Fix agent — iteration 1 (human-triggered)Added error-path tests for SourceURL resolution in LoadWithBase, raising coverage from 79.5% to 84.1% (above the 80% threshold). Fixed (1):
Tests: passed Updated by fullsend fix agent |
|
🤖 Finished Retro · ✅ Success · Started 12:46 AM UTC · Completed 12:54 AM UTC |
Retro: PR #2807 — resolve relative resources for URL-sourced config agentsTimeline: Issue #2805 created → triage (5 min) → code agent opens PR (14 min) → human triggers review → review agent finds medium-severity logic error → human triggers two What went well:
What could go better:
Skipped proposals (already covered):
Proposals filed
|
When a harness is fetched from a URL via config-driven agent registration (ADR-0058) and has no base: field, LoadWithBase returned early without calling resolveBaseScripts or resolveBaseResources. Relative resource paths (agent, policy, skills, scripts) remained as unresolved strings that fail at runtime because the files don't exist on the local filesystem.
The fix adds a SourceURL field to ComposeOpts. When set (by run.go from the FetchAgentHarness dependency), LoadWithBase calls resolveBaseScripts and resolveBaseResources on the harness using the source URL, applying the same ADR-0045 resolution infrastructure that already exists for base: composition.
Changes:
SourceURL is set
resource (now resolved from URL instead of local disk)
no-op for absolute paths, and backward compatibility without
SourceURL
Note: pre-commit could not run (shellcheck-py failed to install in sandbox due to network restrictions). The post-script runs an authoritative pre-commit check.
Closes #2805
Post-script verification
agent/2805-url-agent-resource-resolution)e5bbbf48f09f3bc0f7ea2abf24afafd88a8e8d56..HEAD)