Skip to content

fix(results): push same-repo results to project origin, not a synthesized URL - #1502

Merged
christso merged 1 commit into
mainfrom
fix-results-push
Jun 23, 2026
Merged

christso merged 1 commit into
mainfrom
fix-results-push

Conversation

@christso

Copy link
Copy Markdown
Collaborator

Problem

For a project whose results live in the same repo (results.repo_path: ., remote: origin), clicking Push results (or auto-push) fails:

git push --porcelain origin refs/heads/agentv/results/v1:...
remote: Not Found
fatal: repository 'https://github.com/..git/' not found

Even after git remote set-url origin <correct>, the push still targets https://github.com/..git — AgentV re-derives and rewrites the remote itself.

Root cause

resolveResultsRepoUrl() synthesized a GitHub URL from any non-URL string:
return \https://github.com/${repo}.git\`` (packages/core/src/evaluation/results-repo.ts). With repo_path: ., normalizeResultsConfig sets repo = '.', so resolveResultsRepoUrl('.') → https://github.com/ + . + .git = https://github.com/..git. That value is then written via ensureResultsRepoRemote() (git remote set-url), clobbering the correct origin.

Fix (packages/core/src/evaluation/results-repo.ts)

  • resolveResultsRepoUrl() only expands genuine GitHub owner/repo shorthand (/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/); explicit URLs pass through; local paths (incl. .) are returned unchanged.
  • ensureResultsRepoRemote() refuses to rewrite an existing remote to a non-URL value, so same-repo results keep using the project's real origin. Separate-repo (repo_url) behaviour is preserved.

Validation

  • bun run --filter @agentv/core typecheck → ✓
  • bun test packages/core/test/evaluation/results-repo.test.ts → 56 pass, 0 fail (3 new regression tests)

…ized URL

resolveResultsRepoUrl() turned any non-URL value into
`https://github.com/<value>.git`, so a same-repo results config
(`repo_path: .`) collapsed to the malformed remote
`https://github.com/..git`. Only expand genuine GitHub `owner/repo`
shorthand and return local paths (including `.`) unchanged, and never
let ensureResultsRepoRemote() rewrite an existing remote to a non-URL
value, so same-repo results keep pushing to the project's real origin.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f8baf8
Status: ✅  Deploy successful!
Preview URL: https://607d0525.agentv.pages.dev
Branch Preview URL: https://fix-results-push.agentv.pages.dev

View logs

@christso
christso merged commit d6f93d2 into main Jun 23, 2026
8 checks passed
@christso
christso deleted the fix-results-push branch June 23, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant