fix(acp): scope test-only SessionMode imports to the test module

ee802145e moved the mode_state helper's SessionMode/SessionModeId
references into the file-level schema::v1 import, but the helper lives
in the #[cfg(test)] module, so the non-test lib build tripped
-D unused-imports in CI. Import the two names inside mod tests next to
the existing test-only SessionConfigSelectOption import instead.

Verified with RUSTFLAGS="-D warnings" cargo check -p goose --lib and
cargo test -p goose --lib acp::provider (47 passed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
This commit is contained in:
Matt Toohey 2026-07-09 11:15:15 +10:00
parent ee802145e1
commit 25eac0e002

View file

@ -4,9 +4,9 @@ use agent_client_protocol::schema::v1::{
McpServerStdio, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse,
RequestPermissionOutcome, RequestPermissionRequest, RequestPermissionResponse,
SessionConfigKind, SessionConfigOption, SessionConfigOptionCategory,
SessionConfigSelectOptions, SessionId, SessionMode, SessionModeId, SessionModeState,
SessionNotification, SessionUpdate, SetSessionConfigOptionRequest, SetSessionModeRequest,
SetSessionModeResponse, StopReason, TextContent, ToolCallContent, ToolCallStatus, ToolKind,
SessionConfigSelectOptions, SessionId, SessionModeState, SessionNotification, SessionUpdate,
SetSessionConfigOptionRequest, SetSessionModeRequest, SetSessionModeResponse, StopReason,
TextContent, ToolCallContent, ToolCallStatus, ToolKind,
};
use agent_client_protocol::schema::ProtocolVersion;
use agent_client_protocol::{Agent, Client, ConnectionTo};
@ -1616,7 +1616,9 @@ fn permission_decision_from_mode(goose_mode: GooseMode) -> Option<PermissionDeci
mod tests {
use super::*;
use crate::agents::extension::Envs;
use agent_client_protocol::schema::v1::SessionConfigSelectOption;
use agent_client_protocol::schema::v1::{
SessionConfigSelectOption, SessionMode, SessionModeId,
};
use test_case::test_case;
fn prompt_text(block: &ContentBlock) -> &str {