@@ -39,56 +39,6 @@ fn build_claude_config(
3939 }
4040}
4141
42- #[ cfg( test) ]
43- mod tests {
44- use super :: * ;
45-
46- #[ test]
47- fn build_claude_config_carries_default_model_and_reasoning_effort ( ) {
48- let agent_cfg = AgentProviderConfig {
49- provider_type : ProviderType :: ClaudeCode . as_slug ( ) . to_owned ( ) ,
50- default_model : "claude-opus-4-8" . to_owned ( ) ,
51- model_reasoning_effort : "max" . to_owned ( ) ,
52- ..Default :: default ( )
53- } ;
54-
55- let config = build_claude_config ( & agent_cfg, & None ) ;
56-
57- assert_eq ! ( config. default_model, "claude-opus-4-8" ) ;
58- assert_eq ! ( config. model_reasoning_effort, "max" ) ;
59- }
60-
61- #[ test]
62- fn compute_provider_key_keeps_default_claude_code_key_stable ( ) {
63- let agent_cfg = AgentProviderConfig {
64- provider_type : ProviderType :: ClaudeCode . as_slug ( ) . to_owned ( ) ,
65- ..Default :: default ( )
66- } ;
67-
68- assert_eq ! ( compute_provider_key( & agent_cfg, & None ) , "claude_code" ) ;
69- }
70-
71- #[ test]
72- fn compute_provider_key_changes_for_claude_cli_launcher_config ( ) {
73- let cctty_cfg = AgentProviderConfig {
74- provider_type : ProviderType :: ClaudeCode . as_slug ( ) . to_owned ( ) ,
75- claude_cli_mode : "cctty" . to_owned ( ) ,
76- ..Default :: default ( )
77- } ;
78- let path_cfg = AgentProviderConfig {
79- provider_type : ProviderType :: ClaudeCode . as_slug ( ) . to_owned ( ) ,
80- claude_cli_path : "/opt/garyx/bin/custom-cctty" . to_owned ( ) ,
81- ..Default :: default ( )
82- } ;
83-
84- let cctty_key = compute_provider_key ( & cctty_cfg, & None ) ;
85- let path_key = compute_provider_key ( & path_cfg, & None ) ;
86- assert ! ( cctty_key. starts_with( "claude_code:cli:cctty:" ) ) ;
87- assert ! ( path_key. starts_with( "claude_code:cli:native:" ) ) ;
88- assert_ne ! ( cctty_key, path_key) ;
89- }
90- }
91-
9242/// Build a `CodexAppServerConfig` from an agent runtime config.
9343///
9444/// Shared by the Codex and Traex providers: TRAE CLI (`traex`) is forked from
@@ -215,7 +165,6 @@ fn build_garyx_native_config(
215165 codex_home : agent_cfg. codex_home . clone ( ) ,
216166 max_tool_iterations : agent_cfg. max_tool_iterations ,
217167 request_timeout_seconds : agent_cfg. request_timeout_seconds ,
218- ..Default :: default ( )
219168 }
220169}
221170
@@ -341,3 +290,53 @@ pub(super) async fn create_provider(
341290 ) ) ,
342291 }
343292}
293+
294+ #[ cfg( test) ]
295+ mod tests {
296+ use super :: * ;
297+
298+ #[ test]
299+ fn build_claude_config_carries_default_model_and_reasoning_effort ( ) {
300+ let agent_cfg = AgentProviderConfig {
301+ provider_type : ProviderType :: ClaudeCode . as_slug ( ) . to_owned ( ) ,
302+ default_model : "claude-opus-4-8" . to_owned ( ) ,
303+ model_reasoning_effort : "max" . to_owned ( ) ,
304+ ..Default :: default ( )
305+ } ;
306+
307+ let config = build_claude_config ( & agent_cfg, & None ) ;
308+
309+ assert_eq ! ( config. default_model, "claude-opus-4-8" ) ;
310+ assert_eq ! ( config. model_reasoning_effort, "max" ) ;
311+ }
312+
313+ #[ test]
314+ fn compute_provider_key_keeps_default_claude_code_key_stable ( ) {
315+ let agent_cfg = AgentProviderConfig {
316+ provider_type : ProviderType :: ClaudeCode . as_slug ( ) . to_owned ( ) ,
317+ ..Default :: default ( )
318+ } ;
319+
320+ assert_eq ! ( compute_provider_key( & agent_cfg, & None ) , "claude_code" ) ;
321+ }
322+
323+ #[ test]
324+ fn compute_provider_key_changes_for_claude_cli_launcher_config ( ) {
325+ let cctty_cfg = AgentProviderConfig {
326+ provider_type : ProviderType :: ClaudeCode . as_slug ( ) . to_owned ( ) ,
327+ claude_cli_mode : "cctty" . to_owned ( ) ,
328+ ..Default :: default ( )
329+ } ;
330+ let path_cfg = AgentProviderConfig {
331+ provider_type : ProviderType :: ClaudeCode . as_slug ( ) . to_owned ( ) ,
332+ claude_cli_path : "/opt/garyx/bin/custom-cctty" . to_owned ( ) ,
333+ ..Default :: default ( )
334+ } ;
335+
336+ let cctty_key = compute_provider_key ( & cctty_cfg, & None ) ;
337+ let path_key = compute_provider_key ( & path_cfg, & None ) ;
338+ assert ! ( cctty_key. starts_with( "claude_code:cli:cctty:" ) ) ;
339+ assert ! ( path_key. starts_with( "claude_code:cli:native:" ) ) ;
340+ assert_ne ! ( cctty_key, path_key) ;
341+ }
342+ }
0 commit comments