Laufzeiten: ein Lauf ohne haltbaren Vorschlag behaelt seinen Verbrauch (#712)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-09-25 23:19:28 +02:00
co-authored by Claude Opus 5.5
parent 036d56ff04
commit 9c6e4aa299
@@ -128,9 +128,18 @@ public sealed class ForeignRunner
var result = await _sandbox.RunAsync(sandboxRequest, ct);
var outcome = runtime.Interpret(result, context, note);
// The run happened and was paid for — a proposal that cannot be kept must not
// turn it into "not run" and lose its usage.
try
{
return outcome with { Text = WithProposal(outcome.Text, agent, request, runtime.Kind, work) };
}
catch (ForeignRunException ex)
{
return outcome with { Text = (outcome.Text ?? "").TrimEnd() + $"\n\n[No proposal kept: {ex.Message}]" };
}
}
catch (ForeignRunException ex)
{
return new ForeignRunOutcome { Status = AgentRunStatus.Failed, Text = $"[Not run: {ex.Message}]" };
}