fix(runtime): isolate agent state by project (#101)
This commit is contained in:
@ -1146,7 +1146,8 @@ async fn stop_agent_call_closes_the_live_session() {
|
||||
let (service, sessions) = build_service(contexts);
|
||||
// Pre-bind a live PTY session for the agent so StopAgent has something to close.
|
||||
let session_id = SessionId::from_uuid(Uuid::from_u128(555));
|
||||
sessions.insert(
|
||||
sessions.insert_in_project(
|
||||
project().id,
|
||||
PtyHandle { session_id },
|
||||
TerminalSession::starting(
|
||||
session_id,
|
||||
@ -1156,7 +1157,9 @@ async fn stop_agent_call_closes_the_live_session() {
|
||||
PtySize { rows: 24, cols: 80 },
|
||||
),
|
||||
);
|
||||
assert!(sessions.session_for_agent(&agent_id).is_some());
|
||||
assert!(sessions
|
||||
.session_for_agent_in_project(project().id, &agent_id)
|
||||
.is_some());
|
||||
let server = server(service);
|
||||
|
||||
let raw = tools_call(1, "idea_stop_agent", json!({ "target": "dev" }));
|
||||
@ -1166,7 +1169,9 @@ async fn stop_agent_call_closes_the_live_session() {
|
||||
|
||||
// CloseTerminal ran → the agent no longer has a live session.
|
||||
assert!(
|
||||
sessions.session_for_agent(&agent_id).is_none(),
|
||||
sessions
|
||||
.session_for_agent_in_project(project().id, &agent_id)
|
||||
.is_none(),
|
||||
"stop_agent should have removed the session"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user