@@ -3,6 +3,7 @@ use std::time::Duration;
33
44use anyhow:: Context ;
55use anyhow:: Result ;
6+ use app_test_support:: PathBufExt ;
67use app_test_support:: TestAppServer ;
78use app_test_support:: to_response;
89use app_test_support:: write_mock_responses_config_toml;
@@ -28,7 +29,7 @@ struct SelectedEnvironmentFixture {
2829 environment_cwd : PathUri ,
2930 environment_shell : String ,
3031 response_mock : responses:: ResponseMock ,
31- _codex_home : TempDir ,
32+ codex_home : TempDir ,
3233 _server : MockServer ,
3334}
3435
@@ -81,7 +82,7 @@ impl SelectedEnvironmentFixture {
8182 environment_cwd,
8283 environment_shell,
8384 response_mock,
84- _codex_home : codex_home,
85+ codex_home,
8586 _server : server,
8687 } )
8788 }
@@ -112,6 +113,30 @@ fn text_turn_params(thread_id: String, prompt: &str) -> TurnStartParams {
112113 }
113114}
114115
116+ #[ tokio:: test]
117+ async fn thread_start_reports_selected_environment_metadata ( ) -> Result < ( ) > {
118+ let mut fixture = SelectedEnvironmentFixture :: new ( ) . await ?;
119+ let response = fixture. start_thread ( ) . await ?;
120+ let host_cwd = fixture. codex_home . path ( ) . to_path_buf ( ) . abs ( ) ;
121+ assert_eq ! (
122+ (
123+ response. cwd. clone( ) ,
124+ response. runtime_workspace_roots. clone( ) ,
125+ response. active_permission_profile. clone( ) ,
126+ ) ,
127+ (
128+ // TODO(anp): Return the selected environment's native cwd from thread/start.
129+ host_cwd. clone( ) ,
130+ // TODO(anp): Derive runtime workspace roots from the selected remote environment.
131+ vec![ host_cwd] ,
132+ // TODO(anp): Report the implicit built-in permission profile instead of None.
133+ None ,
134+ )
135+ ) ;
136+
137+ Ok ( ( ) )
138+ }
139+
115140#[ tokio:: test]
116141async fn thread_start_reports_selected_environment_instruction_source ( ) -> Result < ( ) > {
117142 let mut fixture = SelectedEnvironmentFixture :: new ( ) . await ?;
@@ -192,6 +217,13 @@ async fn turn_model_context_uses_selected_environment() -> Result<()> {
192217 ) ) ,
193218 )
194219 ) ;
220+ let host_workspace_roots = format ! (
221+ "<workspace_roots><root>{}</root></workspace_roots>" ,
222+ fixture. codex_home. path( ) . display( )
223+ ) ;
224+ // TODO(anp): Derive model-visible workspace roots from the selected remote environment and
225+ // render them using its native path convention.
226+ assert ! ( environment_context. contains( & host_workspace_roots) ) ;
195227
196228 Ok ( ( ) )
197229}
0 commit comments