Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 19 additions & 58 deletions apps/cli/src/commands/results/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
type NormalizedResultsConfig,
type ResultsConfig,
type ResultsRepoStatus,
type RuntimeResultsConfig,
confirmResultsMergeAndPull,
directPushResultsWithDetails,
directorySizeBytes,
Expand Down Expand Up @@ -154,21 +155,13 @@ function remoteMetadataManifestPath(

export interface ResultsPublishOverrides {
readonly repo?: string;
readonly repo_url?: string;
readonly repo_path?: string;
readonly branch?: string;
readonly remote?: string;
readonly auto_push?: boolean;
readonly require_push?: boolean;
readonly push_conflict_policy?: 'block';
}

type RuntimeResultsConfig = Omit<ResultsConfig, 'sync'> & {
readonly sync?: ResultsConfig['sync'] & {
readonly require_push?: boolean;
};
};

const REMOTE_RUN_PREFIX = 'remote::';
const SIZE_WARNING_BYTES = 10 * 1024 * 1024;

Expand Down Expand Up @@ -227,27 +220,10 @@ export async function loadNormalizedResultsConfig(
const projectResults = project?.results
? ({
mode: 'github' as const,
...(project.results.repoUrl !== undefined && {
repo: project.results.repoUrl,
repo_url: project.results.repoUrl,
}),
...(project.results.repoPath !== undefined && { repo_path: project.results.repoPath }),
...(project.results.branch !== undefined && { branch: project.results.branch }),
...(project.results.repo !== undefined && { repo: project.results.repo }),
...(project.results.path !== undefined && { path: project.results.path }),
...((project.results.sync?.autoPush !== undefined ||
project.results.sync?.pushConflictPolicy !== undefined) && {
sync: {
...(project.results.sync?.autoPush !== undefined && {
auto_push: project.results.sync.autoPush,
}),
...(project.results.sync?.pushConflictPolicy !== undefined && {
push_conflict_policy: project.results.sync.pushConflictPolicy,
}),
},
}),
...(project.results.branchPrefix !== undefined && {
branch_prefix: project.results.branchPrefix,
}),
...(project.results.branch !== undefined && { branch: project.results.branch }),
...(project.results.autoPush !== undefined && { auto_push: project.results.autoPush }),
} satisfies ResultsConfig)
: undefined;
const resultsConfig = projectResults ?? resolveResultsConfigForProject(config, project?.id);
Expand All @@ -257,7 +233,7 @@ export async function loadNormalizedResultsConfig(
const baseConfig = resultsConfig
? normalizeResultsConfig(resultsConfig, { baseDir: project?.path ?? repoRoot })
: undefined;
const repoOverride = overrides?.repo ?? overrides?.repo_url ?? overrides?.repo_path;
const repoOverride = overrides?.repo ?? overrides?.repo_path;
if (!baseConfig && !repoOverride) {
return undefined;
}
Expand All @@ -269,17 +245,15 @@ export async function loadNormalizedResultsConfig(
mode: 'github',
...(overrides.repo !== undefined
? { repo: overrides.repo }
: overrides.repo_url !== undefined
? { repo_url: overrides.repo_url }
: overrides.repo_path !== undefined
? { repo_path: overrides.repo_path }
: baseConfig?.repo_path
? { repo_path: baseConfig.repo_path }
: baseConfig?.repo_url
? { repo_url: baseConfig.repo_url }
: baseConfig?.repo
? { repo: baseConfig.repo }
: {}),
: overrides.repo_path !== undefined
? { repo_path: overrides.repo_path }
: baseConfig?.repo_path
? { repo_path: baseConfig.repo_path }
: baseConfig?.repo_url
? { repo_url: baseConfig.repo_url }
: baseConfig?.repo
? { repo: baseConfig.repo }
: {}),
...(overrides.branch !== undefined
? { branch: overrides.branch }
: baseConfig?.branch
Expand All @@ -293,25 +267,12 @@ export async function loadNormalizedResultsConfig(
...(repoOverride === undefined && baseConfig?.repo_path === undefined && baseConfig?.path
? { path: baseConfig.path }
: {}),
...((overrides.auto_push !== undefined ||
overrides.require_push !== undefined ||
overrides.push_conflict_policy !== undefined ||
baseConfig?.auto_push !== undefined ||
baseConfig?.require_push !== undefined ||
baseConfig?.push_conflict_policy !== undefined) && {
sync: {
...((overrides.auto_push ?? baseConfig?.auto_push) !== undefined && {
auto_push: overrides.auto_push ?? baseConfig?.auto_push,
}),
...((overrides.require_push ?? baseConfig?.require_push) !== undefined && {
require_push: overrides.require_push ?? baseConfig?.require_push,
}),
...((overrides.push_conflict_policy ?? baseConfig?.push_conflict_policy) !== undefined && {
push_conflict_policy: overrides.push_conflict_policy ?? baseConfig?.push_conflict_policy,
}),
},
...((overrides.auto_push ?? baseConfig?.auto_push) !== undefined && {
auto_push: overrides.auto_push ?? baseConfig?.auto_push,
}),
...((overrides.require_push ?? baseConfig?.require_push) !== undefined && {
require_push: overrides.require_push ?? baseConfig?.require_push,
}),
...(baseConfig?.branch_prefix ? { branch_prefix: baseConfig.branch_prefix } : {}),
};

return normalizeResultsConfig(merged, { baseDir: project?.path ?? repoRoot });
Expand Down
8 changes: 3 additions & 5 deletions apps/cli/test/commands/results/remote-auto-export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ function writeProjectConfig(
writeFileSync(
path.join(projectDir, '.agentv', 'config.yaml'),
`results:
repo:
remote: ${JSON.stringify(params.repo)}
${params.branch ? ` branch: ${JSON.stringify(params.branch)}\n` : ''} path: ${JSON.stringify(params.path)}
sync:
auto_push: ${params.autoPush}
repo: ${JSON.stringify(params.repo)}
${params.branch ? ` branch: ${JSON.stringify(params.branch)}\n` : ''} path: ${JSON.stringify(params.path)}
auto_push: ${params.autoPush}
`,
);
}
Expand Down
33 changes: 16 additions & 17 deletions apps/cli/test/commands/results/serve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ function writeResultsConfig(
writeFileSync(
path.join(projectDir, '.agentv', 'config.yaml'),
`results:
repo:
remote: ${JSON.stringify(params.remote)}
${params.branch ? ` branch: ${JSON.stringify(params.branch)}\n` : ''}${params.path ? ` path: ${JSON.stringify(params.path)}\n` : ''}${params.autoPush !== undefined ? ` sync:\n auto_push: ${params.autoPush}\n` : ''}`,
repo: ${JSON.stringify(params.remote)}
${params.branch ? ` branch: ${JSON.stringify(params.branch)}\n` : ''}${params.path ? ` path: ${JSON.stringify(params.path)}\n` : ''}${params.autoPush !== undefined ? ` auto_push: ${params.autoPush}\n` : ''}`,
);
}

Expand Down Expand Up @@ -2156,9 +2155,9 @@ describe('serve app', () => {
name: 'Project No Publish',
path: projectDir,
results: {
repoUrl: `file://${remoteDir}`,
repo: `file://${remoteDir}`,
path: missingCloneDir,
sync: { autoPush: true },
autoPush: true,
},
addedAt: '2026-01-01T00:00:00.000Z',
lastOpenedAt: '2026-01-01T00:00:00.000Z',
Expand Down Expand Up @@ -2280,9 +2279,9 @@ describe('serve app', () => {
name: 'AgentV',
path: projectDir,
results: {
repoUrl: 'EntityProcess/agentv-examples-eval-results',
repo: 'EntityProcess/agentv-examples-eval-results',
path: '/home/entity/projects/EntityProcess/agentv-examples-eval-results',
sync: { autoPush: true },
autoPush: true,
},
addedAt: '2026-01-01T00:00:00.000Z',
lastOpenedAt: '2026-01-01T00:00:00.000Z',
Expand Down Expand Up @@ -2332,9 +2331,9 @@ describe('serve app', () => {
name: 'Project Sync Pull',
path: projectDir,
results: {
repoUrl: `file://${remoteDir}`,
repo: `file://${remoteDir}`,
path: cloneDir,
sync: { autoPush: false },
autoPush: false,
},
addedAt: '2026-01-01T00:00:00.000Z',
lastOpenedAt: '2026-01-01T00:00:00.000Z',
Expand Down Expand Up @@ -2409,9 +2408,9 @@ describe('serve app', () => {
name: 'Project Sync Push',
path: projectDir,
results: {
repoUrl: `file://${remoteDir}`,
repo: `file://${remoteDir}`,
path: cloneDir,
sync: { autoPush: true },
autoPush: true,
},
addedAt: '2026-01-01T00:00:00.000Z',
lastOpenedAt: '2026-01-01T00:00:00.000Z',
Expand Down Expand Up @@ -2477,9 +2476,9 @@ describe('serve app', () => {
name: 'Project Sync Offline',
path: projectDir,
results: {
repoUrl: missingRemoteUrl,
repo: missingRemoteUrl,
path: cloneDir,
sync: { autoPush: true },
autoPush: true,
},
addedAt: '2026-01-01T00:00:00.000Z',
lastOpenedAt: '2026-01-01T00:00:00.000Z',
Expand Down Expand Up @@ -2535,9 +2534,9 @@ describe('serve app', () => {
name: 'Project Sync Conflict',
path: projectDir,
results: {
repoUrl: `file://${remoteDir}`,
repo: `file://${remoteDir}`,
path: cloneDir,
sync: { autoPush: true },
autoPush: true,
},
addedAt: '2026-01-01T00:00:00.000Z',
lastOpenedAt: '2026-01-01T00:00:00.000Z',
Expand Down Expand Up @@ -2661,9 +2660,9 @@ describe('serve app', () => {
name: 'Project Confirm Merge',
path: projectDir,
results: {
repoUrl: `file://${remoteDir}`,
repo: `file://${remoteDir}`,
path: cloneDir,
sync: { autoPush: false },
autoPush: false,
},
addedAt: '2026-01-01T00:00:00.000Z',
lastOpenedAt: '2026-01-01T00:00:00.000Z',
Expand Down
1 change: 0 additions & 1 deletion apps/dashboard/src/lib/project-sync-status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ describe('getProjectSyncView', () => {
configured: true,
available: true,
sync_status: 'push_conflict',
push_conflict_policy: 'block',
block_reason: 'Results branch push conflict on agentv/results/v1',
}),
).toMatchObject({
Expand Down
2 changes: 0 additions & 2 deletions apps/dashboard/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,6 @@ export interface RemoteStatusResponse {
local_dir?: string;
path?: string;
auto_push?: boolean;
push_conflict_policy?: 'block';
branch_prefix?: string;
run_count?: number;
last_synced_at?: string;
last_error?: string;
Expand Down
8 changes: 3 additions & 5 deletions apps/web/src/content/docs/docs/evaluation/running-evals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,10 @@ For local workspaces, put portable registry defaults in `$AGENTV_HOME/config.yam
projects:
- id: agentv
name: AgentV
repo:
path: /home/user/projects/agentv
path: /home/user/projects/agentv
results:
repo:
path: /home/user/agentv-results
branch: agentv/results/v1
path: /home/user/agentv-results
branch: agentv/results/v1
```

When running AgentV from a worktree that needs environment from a primary checkout, load the primary `.env` through the runtime instead of shell-sourcing it:
Expand Down
Loading
Loading