mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-28 09:23:05 +08:00
fix(codeagent-wrapper): keep logs + surface parsed error output
Fixes #150
This commit is contained in:
@@ -198,10 +198,9 @@ func runWithLoggerAndCleanup(fn func() int) (exitCode int) {
|
||||
for _, entry := range entries {
|
||||
fmt.Fprintln(os.Stderr, entry)
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "Log file: %s (deleted)\n", logger.Path())
|
||||
fmt.Fprintf(os.Stderr, "Log file: %s\n", logger.Path())
|
||||
}
|
||||
}
|
||||
_ = logger.RemoveLogFile()
|
||||
}()
|
||||
defer runCleanupHook()
|
||||
|
||||
@@ -689,6 +688,13 @@ func runSingleMode(cfg *Config, name string) int {
|
||||
result := runTaskFn(taskSpec, false, cfg.Timeout)
|
||||
|
||||
if result.ExitCode != 0 {
|
||||
// Surface any parsed backend output even on non-zero exit to avoid "(no output)" in tool runners.
|
||||
if strings.TrimSpace(result.Message) != "" {
|
||||
fmt.Println(result.Message)
|
||||
if result.SessionID != "" {
|
||||
fmt.Printf("\n---\nSESSION_ID: %s\n", result.SessionID)
|
||||
}
|
||||
}
|
||||
return result.ExitCode
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user