Retain prompt resume resize until route transition

This commit is contained in:
ms2k 2026-07-17 07:27:47 +09:00
commit 29bc02fd7b

View file

@ -539,7 +539,7 @@ fn engine_for(fixture: &Fixture) -> (Arc<MockFactory>, SessionTerminalEngine) {
#[test]
#[allow(clippy::too_many_lines)]
fn production_prompt_adapter_routes_exact_authenticated_denial() {
fn production_prompt_adapter_retains_resume_resize_before_authenticated_denial() {
let generation = GenerationIdentity {
agent_profile: "trusted".into(),
domain_id: DomainId::new(bytes(1)),
@ -607,7 +607,7 @@ fn production_prompt_adapter_routes_exact_authenticated_denial() {
let factory = Arc::new(MockFactory::default());
let mut engine = SessionTerminalEngine::new(
Arc::clone(&fixture.store),
factory,
factory.clone(),
prompt_transport.clone(),
);
engine.acquire(&acquisition(binding.session_id)).unwrap();
@ -640,6 +640,18 @@ fn production_prompt_adapter_routes_exact_authenticated_denial() {
batch.messages,
vec![InteractiveSessionMessage::Prompt(expected_prompt.clone())]
);
let resumed_size = TerminalResize {
session_id: binding.session_id,
rows: NonZeroU16::new(55).unwrap(),
columns: NonZeroU16::new(144).unwrap(),
pixel_width: 1_440,
pixel_height: 900,
};
control
.exchange(InteractiveSessionEvent::Terminal(
SessionTerminalEvent::Resize(resumed_size),
))
.unwrap();
let signed_decision = encode_signed(
&DeveloperDecision {
protocol_version: ProtocolVersion::V1,
@ -664,6 +676,19 @@ fn production_prompt_adapter_routes_exact_authenticated_denial() {
.unwrap();
assert_eq!(routed.signed_decision, signed_decision);
assert_eq!(routed.decision.decision, DeveloperDecisionKind::Deny);
assert_eq!(routed.resumed_size, Some(resumed_size));
assert_eq!(
factory.log.lock().unwrap().as_slice(),
["resize:55x144", "signal:WINCH"]
);
assert!(
!factory
.log
.lock()
.unwrap()
.iter()
.any(|event| event == "signal:TSTP")
);
assert_eq!(
fixture
.store