Skip to content

Commit fb757b7

Browse files
committed
Align extracted model-switch snapshots with main behavior
1 parent 86b296a commit fb757b7

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

codex-rs/core/tests/suite/compact_remote.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,8 +1518,8 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_strips_incoming_model
15181518
let compact_request = compact_mock.single_request();
15191519
let compact_body = compact_request.body_json().to_string();
15201520
assert!(
1521-
compact_body.contains("AFTER_SWITCH_USER"),
1522-
"pre-turn remote compaction request should include incoming user message"
1521+
!compact_body.contains("AFTER_SWITCH_USER"),
1522+
"current behavior excludes incoming user from the pre-turn remote compaction request"
15231523
);
15241524
assert!(
15251525
!compact_body.contains("<model_switch>"),
@@ -1543,7 +1543,7 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_strips_incoming_model
15431543
insta::assert_snapshot!(
15441544
"remote_pre_turn_compaction_strips_incoming_model_switch_shapes",
15451545
format_labeled_requests_snapshot(
1546-
"Remote pre-turn compaction during model switch strips incoming <model_switch> from the compact request and restores it in the post-compaction follow-up request.",
1546+
"Remote pre-turn compaction during model switch currently excludes incoming user input, strips incoming <model_switch> from the compact request payload, and restores it in the post-compaction follow-up request.",
15471547
&[
15481548
("Initial Request (Previous Model)", &requests[0]),
15491549
("Remote Compaction Request", &compact_request),

codex-rs/core/tests/suite/snapshots/all__suite__compact__pre_turn_compaction_strips_incoming_model_switch_shapes.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
source: core/tests/suite/compact.rs
3+
assertion_line: 3152
34
expression: "format_labeled_requests_snapshot(\"Pre-turn compaction during model switch (without pre-sampling model-switch compaction): current behavior strips incoming <model_switch> from the compact request and restores it in the post-compaction follow-up request.\",\n&[(\"Initial Request (Previous Model)\", &requests[0]),\n(\"Local Compaction Request\", &requests[1]),\n(\"Local Post-Compaction History Layout\", &requests[2]),])"
45
---
56
Scenario: Pre-turn compaction during model switch (without pre-sampling model-switch compaction): current behavior strips incoming <model_switch> from the compact request and restores it in the post-compaction follow-up request.
@@ -18,15 +19,14 @@ Scenario: Pre-turn compaction during model switch (without pre-sampling model-sw
1819
03:message/developer:<PERMISSIONS_INSTRUCTIONS>
1920
04:message/user:BEFORE_SWITCH_USER
2021
05:message/assistant:BEFORE_SWITCH_REPLY
21-
06:message/user:AFTER_SWITCH_USER
22-
07:message/user:<SUMMARIZATION_PROMPT>
22+
06:message/user:<SUMMARIZATION_PROMPT>
2323

2424
## Local Post-Compaction History Layout
25-
00:message/user:BEFORE_SWITCH_USER
26-
01:message/developer:<PERMISSIONS_INSTRUCTIONS>
27-
02:message/developer:<personality_spec> The user has requested a new communication st...
28-
03:message/user:<AGENTS_MD>
29-
04:message/user:<ENVIRONMENT_CONTEXT:cwd=<CWD>>
30-
05:message/user:AFTER_SWITCH_USER
31-
06:message/user:<COMPACTION_SUMMARY>\nPRETURN_SWITCH_SUMMARY
32-
07:message/developer:<model_switch>\nThe user was previously using a different model....
25+
00:message/developer:<PERMISSIONS_INSTRUCTIONS>
26+
01:message/developer:<personality_spec> The user has requested a new communication st...
27+
02:message/user:<AGENTS_MD>
28+
03:message/user:<ENVIRONMENT_CONTEXT:cwd=<CWD>>
29+
04:message/user:BEFORE_SWITCH_USER
30+
05:message/user:<COMPACTION_SUMMARY>\nPRETURN_SWITCH_SUMMARY
31+
06:message/developer:<model_switch>\nThe user was previously using a different model....
32+
07:message/user:AFTER_SWITCH_USER
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
source: core/tests/suite/compact_remote.rs
3-
expression: "format_labeled_requests_snapshot(\"Remote pre-turn compaction during model switch strips incoming <model_switch> from the compact request and restores it in the post-compaction follow-up request.\",\n&[(\"Initial Request (Previous Model)\", &requests[0]),\n(\"Remote Compaction Request\", &compact_request),\n(\"Remote Post-Compaction History Layout\", &requests[1]),])"
3+
assertion_line: 1543
4+
expression: "format_labeled_requests_snapshot(\"Remote pre-turn compaction during model switch currently excludes incoming user input, strips incoming <model_switch> from the compact request payload, and restores it in the post-compaction follow-up request.\",\n&[(\"Initial Request (Previous Model)\", &requests[0]),\n(\"Remote Compaction Request\", &compact_request),\n(\"Remote Post-Compaction History Layout\", &requests[1]),])"
45
---
5-
Scenario: Remote pre-turn compaction during model switch strips incoming <model_switch> from the compact request and restores it in the post-compaction follow-up request.
6+
Scenario: Remote pre-turn compaction during model switch currently excludes incoming user input, strips incoming <model_switch> from the compact request payload, and restores it in the post-compaction follow-up request.
67

78
## Initial Request (Previous Model)
89
00:message/developer:<PERMISSIONS_INSTRUCTIONS>
@@ -16,14 +17,14 @@ Scenario: Remote pre-turn compaction during model switch strips incoming <model_
1617
02:message/user:<ENVIRONMENT_CONTEXT:cwd=<CWD>>
1718
03:message/user:BEFORE_SWITCH_USER
1819
04:message/assistant:BEFORE_SWITCH_REPLY
19-
05:message/user:AFTER_SWITCH_USER
2020

2121
## Remote Post-Compaction History Layout
2222
00:message/user:BEFORE_SWITCH_USER
23-
01:message/developer:<PERMISSIONS_INSTRUCTIONS>
24-
02:message/developer:<personality_spec> The user has requested a new communication st...
25-
03:message/user:<AGENTS_MD>
26-
04:message/user:<ENVIRONMENT_CONTEXT:cwd=<CWD>>
27-
05:message/user:AFTER_SWITCH_USER
23+
01:message/user:AFTER_SWITCH_USER
24+
02:message/developer:<PERMISSIONS_INSTRUCTIONS>
25+
03:message/developer:<personality_spec> The user has requested a new communication st...
26+
04:message/user:<AGENTS_MD>
27+
05:message/user:<ENVIRONMENT_CONTEXT:cwd=<CWD>>
2828
06:message/user:<COMPACTION_SUMMARY>\nREMOTE_SWITCH_SUMMARY
2929
07:message/developer:<model_switch>\nThe user was previously using a different model....
30+
08:message/user:AFTER_SWITCH_USER

0 commit comments

Comments
 (0)