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) {