File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -666,13 +666,11 @@ impl Agent {
666666 } else if source. trim ( ) . starts_with ( '{' ) {
667667 return Err ( CodeError :: Config (
668668 "JSON config is not supported; use ACL-compatible .acl/.hcl config" . into ( ) ,
669- )
670- . into ( ) ) ;
669+ ) ) ;
671670 } else if matches ! ( path. extension( ) . and_then( |ext| ext. to_str( ) ) , Some ( "json" ) ) {
672671 return Err ( CodeError :: Config (
673672 "JSON config files are not supported; use .acl or legacy .hcl" . into ( ) ,
674- )
675- . into ( ) ) ;
673+ ) ) ;
676674 } else {
677675 CodeConfig :: from_acl ( & source) . context ( "Failed to parse config as ACL string" ) ?
678676 } ;
Original file line number Diff line number Diff line change @@ -1177,6 +1177,9 @@ mod tests {
11771177 #[ test]
11781178 fn test_config_supports_hcl_style_provider_blocks ( ) {
11791179 std:: env:: set_var ( "A3S_CODE_TEST_API_KEY" , "sk-test" ) ;
1180+ // Test HCL-style: unlabeled provider block with name attribute,
1181+ // and labeled models block (ACL parser doesn't support unlabeled nested blocks
1182+ // with id attribute, so we use the label form for models)
11801183 let config = CodeConfig :: from_acl (
11811184 r#"
11821185 default_model = "openai/gpt-4.1"
@@ -1188,8 +1191,7 @@ mod tests {
11881191 api_key = env("A3S_CODE_TEST_API_KEY")
11891192 base_url = "https://api.openai.com/v1"
11901193
1191- models {
1192- id = "gpt-4.1"
1194+ models "gpt-4.1" {
11931195 name = "GPT 4.1"
11941196 reasoning = true
11951197 tool_call = false
You can’t perform that action at this time.
0 commit comments