fix(native): name the recorded turn failure when a native run fails (#21235)

Failed native runs now report the runner's recorded turn-failure code instead of the generic unclassified fallback, and the Sentry run-failure fingerprint includes runner:<code>.

Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-11-13 11:22:55 -08:00
1 parent 38821e061f
commit aa4a06653c
9 files changed
+125 -12

No files matched your search

@@ -106,6 +106,7 @@ import { redactNativeFailureError } from "./native-failure-redaction.js";
import { parseCodexCliVersion } from "./codex-runtime-compatibility.js";
import { createNativeToolTrace, type NativeToolTrace } from "./native-tool-trace.js";
import { createNativeProviderFailureObservation } from "./native-provider-failure.js";
import { explainNativeTurnFailure } from "./native-run-failure-explanation.js";
import { nativeStartupRetryExhaustedAction, nativeStartupRetryWait, planNativeStartupRetry } from "./native-startup-retry.js";
import { admitUnclaimedNativeBootstrapRetry } from "./native-bootstrap-retry.js";
import { RUNNERD_CONTROL_PLANE_STATE_SCHEMAS, runnerdStateIsIncompleteBootstrap,
@@ -13826,7 +13827,8 @@ async function executePaperclipNativeSessionAttempt(
errorMessage:
native.terminal.runTerminalState === "succeeded"
? null
: providerFailure?.errorMessage ?? `Native session ${native.terminal.runTerminalState}`,
: providerFailure?.errorMessage ?? explainNativeTurnFailure(unclassifiedTurnFailure)?.error
?? `Native session ${native.terminal.runTerminalState}`,
...(providerFailure ? { errorCode: providerFailure.errorCode } : {}),
resultJson: {
nativeResult: native.result as unknown as Record<string, unknown>,