Skip to content

Commit 70729a3

Browse files
fix: reject ambiguous canonical routes
agent-session-id: dev3.dotfiles-cos-misc-issue-1329-upstream agent-tool: Codex agent-tool-version: 0.145.0 agent-model: gpt-5.6-sol agent-runtime-profile: /nix/store/qlk5xbdfmj5nn1q145j0fx73f2pmdjj7-coding-agent-runtime-profile/share/coding-agents/profile.json agent-skills-manifest: /nix/store/2km8dbiyv3wc484l1hd8n2lh65121qvq-agent-skills-corpus/share/agent-skills/manifest.json tooling-profile: dotfiles@unknown-dirty
1 parent 3187b79 commit 70729a3

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

src/eval_run.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,18 @@ fn load_canonical_eval_team(catalog: &Path, host: &str) -> Result<CanonicalEvalT
258258
inbox: crate::message::inbox_dir(agent_dir),
259259
archive: crate::message::archive_dir(agent_dir),
260260
};
261-
routes.insert(bus_id, route.clone());
262-
routes.insert(spec.identity.clone(), route);
261+
for spelling in [bus_id, spec.identity.clone()] {
262+
match routes.entry(spelling.clone()) {
263+
std::collections::btree_map::Entry::Vacant(entry) => {
264+
entry.insert(route.clone());
265+
}
266+
std::collections::btree_map::Entry::Occupied(_) => {
267+
anyhow::bail!(
268+
"canonical-agents found duplicate canonical route spelling `{spelling}`"
269+
);
270+
}
271+
}
272+
}
263273
}
264274
runtime_tasks.sort_by(|left, right| left.runtime_id.cmp(&right.runtime_id));
265275

tests/eval_run_e2e.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,20 @@ fn canonical_agents_fail_closed_matrix_is_pre_spawn_and_non_vacuous() {
810810
r#"agent "worker" { identity "worker"; name "requester"; host "evalhost"; argv "sh" "-c" "touch \"$CATALOG/SPAWNED\"; sleep 60" }"#,
811811
)],
812812
),
813+
(
814+
"duplicate canonical route",
815+
"worker",
816+
vec![
817+
(
818+
"worker",
819+
r#"agent "worker" { identity "worker"; host "evalhost"; argv "sh" "-c" "touch \"$CATALOG/SPAWNED\"; sleep 60" }"#,
820+
),
821+
(
822+
"qualified",
823+
r#"agent "evalhost.worker" { identity "evalhost.worker"; host "evalhost"; argv "sh" "-c" "sleep 60" }"#,
824+
),
825+
],
826+
),
813827
];
814828
for (expected, target, declarations) in cases {
815829
let tmp = tempfile::tempdir().unwrap();

0 commit comments

Comments
 (0)