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:
co-authored by
Claude Opus 5.5
parent
036d56ff04
commit
9c6e4aa299
@@ -128,7 +128,16 @@ public sealed class ForeignRunner
|
||||
var result = await _sandbox.RunAsync(sandboxRequest, ct);
|
||||
var outcome = runtime.Interpret(result, context, note);
|
||||
|
||||
return outcome with { Text = WithProposal(outcome.Text, agent, request, runtime.Kind, work) };
|
||||
// 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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user