Skip to content
Merged
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
22 changes: 21 additions & 1 deletion specs/config/schema.t27
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,18 @@ pub fn config_add_agent(config: *Config, agent: AgentConfig) void {

/// Remove agent from config
pub fn config_remove_agent(config: *Config, index: usize) void {
// Remove at index (simplified)
// Remove at index
if (index < config.agents.len) {
var before : []AgentConfig = config.agents[0..index];
var after : []AgentConfig = config.agents[index + 1..];

// Create new slice without the element at index
var new_agents : []AgentConfig = before;
for (after) |agent| {
new_agents = append_agents(new_agents, agent);
}
config.agents = new_agents;
}
}

/// Get agent count
Expand Down Expand Up @@ -461,6 +472,15 @@ test "config_add_agent" {
try std.testing.expect(config_agent_count(&config) == 1);
}

test "config_remove_agent" {
var config = config_default();
const agent = agent_default("test-agent");
config_add_agent(&config, agent);
try std.testing.expect(config_agent_count(&config) == 1);
config_remove_agent(&config, 0);
try std.testing.expect(config_agent_count(&config) == 0);
}

test "config_agent_has_capability_true" {
const caps = &[_]AgentCapability{.chat, .code_edit};
const agent = agent_with_capabilities("test", caps);
Expand Down
Loading