Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions core/src/agent_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,13 +666,11 @@ impl Agent {
} else if source.trim().starts_with('{') {
return Err(CodeError::Config(
"JSON config is not supported; use ACL-compatible .acl/.hcl config".into(),
)
.into());
));
} else if matches!(path.extension().and_then(|ext| ext.to_str()), Some("json")) {
return Err(CodeError::Config(
"JSON config files are not supported; use .acl or legacy .hcl".into(),
)
.into());
));
} else {
CodeConfig::from_acl(&source).context("Failed to parse config as ACL string")?
};
Expand Down
6 changes: 4 additions & 2 deletions core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,9 @@ mod tests {
#[test]
fn test_config_supports_hcl_style_provider_blocks() {
std::env::set_var("A3S_CODE_TEST_API_KEY", "sk-test");
// Test HCL-style: unlabeled provider block with name attribute,
// and labeled models block (ACL parser doesn't support unlabeled nested blocks
// with id attribute, so we use the label form for models)
let config = CodeConfig::from_acl(
r#"
default_model = "openai/gpt-4.1"
Expand All @@ -1188,8 +1191,7 @@ mod tests {
api_key = env("A3S_CODE_TEST_API_KEY")
base_url = "https://api.openai.com/v1"

models {
id = "gpt-4.1"
models "gpt-4.1" {
name = "GPT 4.1"
reasoning = true
tool_call = false
Expand Down
Loading