Skip to content

Commit fd745e7

Browse files
committed
test(acp): expect typed missing-session errors
1 parent 045adab commit fd745e7

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

crates/agentos-sidecar/tests/acp_adapter_restart.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn adapter_crash_restarts_or_evicts_and_emits_exit_event() {
186186
let AcpResponse::AcpErrorResponse(AcpErrorResponse { code, message }) = response else {
187187
panic!("expected the post-eviction prompt to fail, got: {response:?}");
188188
};
189-
assert_eq!(code, "invalid_state");
189+
assert_eq!(code, "session_not_found");
190190
assert!(
191191
message.contains("unknown ACP session"),
192192
"expected unknown-session error after eviction, got: {message}"

crates/agentos-sidecar/tests/acp_extension.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ fn acp_session_request_denies_cross_connection_prompt_and_cancel() {
10611061
}
10621062

10631063
/// Assert an ACP response is a deny that is INDISTINGUISHABLE from a missing
1064-
/// session: the shared ACP core's `invalid_state` code and unknown-session
1064+
/// session: the shared ACP core's `session_not_found` code and unknown-session
10651065
/// message. This locks in the no-existence-leak property
10661066
/// — a non-owner must learn nothing (not even that the session exists), so a
10671067
/// regression to a distinguishable error (e.g. an `unauthorized` code) fails here.
@@ -1071,7 +1071,7 @@ fn assert_indistinguishable_deny(response: AcpResponse, what: &str) {
10711071
panic!("{what} must be DENIED with an error response, but it returned: {response:?}");
10721072
};
10731073
assert_eq!(
1074-
error.code, "invalid_state",
1074+
error.code, "session_not_found",
10751075
"{what} must fail closed with the same code as a missing session (no \
10761076
'unauthorized' existence oracle); got code {:?} / message {:?}",
10771077
error.code, error.message

crates/agentos-sidecar/tests/acp_wrapper_conformance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ fn native_and_browser_wrappers_match_full_session_lifecycle() {
437437
);
438438
assert_eq!(
439439
native_step.response["code"],
440-
json!("invalid_state"),
440+
json!("session_not_found"),
441441
"cross-owner {label} must fail closed without revealing the session",
442442
);
443443
assert!(native_step.events.is_empty());

0 commit comments

Comments
 (0)