mirror of
https://github.com/j3ssie/osmedeus.git
synced 2026-09-06 09:47:46 +02:00
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:
+1
-6
@@ -75,17 +75,12 @@ func runAgent(cmd *cobra.Command, args []string) error {
|
||||
StreamWriter: os.Stdout,
|
||||
}
|
||||
|
||||
output, _, err := executor.RunAgentACP(ctx, message, agentName, cfg)
|
||||
_, _, err = executor.RunAgentACP(ctx, message, agentName, cfg)
|
||||
if err != nil {
|
||||
printer.Error("Agent failed: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
// If there was no stream writer, print output at the end
|
||||
if cfg.StreamWriter == nil && output != "" {
|
||||
fmt.Println(output)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user