From 9c6e4aa299551654ab183bb9bebc0eb313fe7b1d Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 25 Sep 2026 23:19:28 +0200 Subject: [PATCH] Laufzeiten: ein Lauf ohne haltbaren Vorschlag behaelt seinen Verbrauch (#712) Co-Authored-By: Claude Opus 5.5 --- src/ClawdDotNet.Core/Runtimes/ForeignRunner.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ClawdDotNet.Core/Runtimes/ForeignRunner.cs b/src/ClawdDotNet.Core/Runtimes/ForeignRunner.cs index be2b7a4..08766e3 100644 --- a/src/ClawdDotNet.Core/Runtimes/ForeignRunner.cs +++ b/src/ClawdDotNet.Core/Runtimes/ForeignRunner.cs @@ -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) {