refactor: optimize ACP agent initialization and remove dead code

- Remove unreachable custom agent command validation from ACPExecutor.Execute()
- Add IsBuiltinAgent() utility function for cleaner agent name resolution
- Replace inline agent list iteration with IsBuiltinAgent() check in agent_chat.go
- Add explicit stdin pipe cleanup in RunAgentACP() defer block
- Simplify CLI output handling by removing redundant stream output fallback
This commit is contained in:
j3ssie
2026-03-07 14:13:19 +08:00
parent 9bdb3260b6
commit ecc77b9a30
3 changed files with 12 additions and 47 deletions
+2 -4
View File
@@ -165,10 +165,8 @@ func resolveAgentName(model string) string {
if model == "" {
return "claude-code"
}
for _, name := range executor.ListAgentNames() {
if name == model {
return model
}
if executor.IsBuiltinAgent(model) {
return model
}
return "claude-code"
}