fix(worker): surface the real reason a Claude run failed instead of a generic exit-code message

StreamAnalyzer now reads subtype/terminal_reason/errors from the CLI's result
event, and TaskRunner builds a specific ErrorMarkdown from them: max_turns names
the turn budget and points at set_task_config + requeue, api_error passes
through the provider's own message (which carries the reset time), and any
other terminal_reason is appended to the previous generic text instead of
staying invisible. Falls through to the old "exited with code N and no result"
text when there's no terminal_reason at all (a real crash).
This commit is contained in:
mika kuns
2026-08-05 15:55:09 +02:00
parent 83ea429b8a
commit 2ebdadff08
6 changed files with 298 additions and 1 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
namespace ClaudeDo.Worker.Runner;
public sealed class RunResult
public sealed record RunResult
{
public required int ExitCode { get; init; }
public string? ResultMarkdown { get; init; }
@@ -11,6 +11,9 @@ public sealed class RunResult
public int TokensIn { get; init; }
public int TokensOut { get; init; }
public IReadOnlyList<string> Blocks { get; init; } = Array.Empty<string>();
public string? ResultSubtype { get; init; }
public string? TerminalReason { get; init; }
public IReadOnlyList<string> Errors { get; init; } = Array.Empty<string>();
public bool IsSuccess => ExitCode == 0 && ResultMarkdown is not null;
}