Skip to content
Open
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
21 changes: 7 additions & 14 deletions crates/coven-cli/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6849,25 +6849,16 @@ mod tests {
#[test]
fn launch_request_with_unknown_harness_returns_400_upfront_no_session_row() -> anyhow::Result<()>
{
// Harness validation reads ambient adapter config: the external
// manifest/dirs env vars plus the COVEN_HOME trust store. Neutralize
// all three under the crate-wide env lock so a host with a real
// hermes adapter installed cannot turn this 400 into a 201.
let _env = crate::test_env::lock_env();
let _manifest =
crate::test_env::EnvVarGuard::remove(crate::harness::EXTERNAL_ADAPTER_MANIFEST_ENV);
let _dirs = crate::test_env::EnvVarGuard::remove(crate::harness::EXTERNAL_ADAPTER_DIRS_ENV);
let temp_dir = tempfile::tempdir()?;
let _home = crate::test_env::EnvVarGuard::set(
"COVEN_HOME",
temp_dir.path().join("empty-coven-home"),
);
let project_root = temp_dir.path().join("repo");
std::fs::create_dir_all(&project_root)?;
let runtime = RecordingRuntime::default();
// A synthetic id no adapter would declare: `hermes` (the previous
// fixture) is a real installable adapter, so it *is* configured on
// machines with local adapter recipes and the test would flake.
let body = json!({
"projectRoot": project_root,
"harness": "hermes",
"harness": "no-such-harness-xyzzy",
"launchMode": "nonInteractive",
"prompt": "hello"
})
Expand All @@ -6884,7 +6875,9 @@ mod tests {

assert_eq!(response.status, 400);
assert!(
response.body.contains("unsupported harness `hermes`"),
response
.body
.contains("unsupported harness `no-such-harness-xyzzy`"),
"expected unsupported-harness validation message, got: {}",
response.body
);
Expand Down
Loading