mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 11:25:50 -06:00
fix(gateway): surface codex app-server returned failures (#93665)
* fix(gateway): surface codex app-server returned failures * fix(auto-reply): retain codex app-server failures * fix(agents): mark codex completion timeouts terminal --------- Co-authored-by: Alex Tang <tangli1987118@hotmail.com> Co-authored-by: Vincent Koc <25068+vincentkoc@users.noreply.github.com>
This commit is contained in:
@@ -235,6 +235,11 @@ describe("runEmbeddedAgent Codex app-server recovery", () => {
|
||||
});
|
||||
expect(result.meta.timeoutPhase).toBe("provider");
|
||||
expect(result.meta.providerStarted).toBe(true);
|
||||
expect(result.meta.error).toEqual({
|
||||
kind: "incomplete_turn",
|
||||
message: CODEX_MISSING_TERMINAL_MESSAGE,
|
||||
fallbackSafe: false,
|
||||
});
|
||||
expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(2);
|
||||
expect(mockedMarkAuthProfileFailure).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -264,6 +269,11 @@ describe("runEmbeddedAgent Codex app-server recovery", () => {
|
||||
isError: true,
|
||||
text: CODEX_MISSING_TERMINAL_MESSAGE,
|
||||
});
|
||||
expect(result.meta.error).toEqual({
|
||||
kind: "incomplete_turn",
|
||||
message: CODEX_MISSING_TERMINAL_MESSAGE,
|
||||
fallbackSafe: false,
|
||||
});
|
||||
expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(1);
|
||||
expect(mockedMarkAuthProfileFailure).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -316,6 +326,12 @@ describe("runEmbeddedAgent Codex app-server recovery", () => {
|
||||
});
|
||||
expect(result.meta.replayInvalid).toBe(true);
|
||||
expect(result.meta.livenessState).toBe("abandoned");
|
||||
expect(result.meta.error).toEqual({
|
||||
kind: "incomplete_turn",
|
||||
message:
|
||||
"Codex stopped before confirming the turn was complete. Some work may already have been performed; verify the current state before retrying.",
|
||||
fallbackSafe: false,
|
||||
});
|
||||
expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(1);
|
||||
expect(mockedMarkAuthProfileFailure).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -3377,6 +3377,17 @@ async function runEmbeddedAgentInternal(
|
||||
livenessState,
|
||||
timeoutPhase,
|
||||
providerStarted,
|
||||
// Completion-idle recovery is exhausted here. Keep this terminal so
|
||||
// model fallback cannot replay a potentially still-active Codex turn.
|
||||
...(shouldSurfaceCodexCompletionTimeout
|
||||
? {
|
||||
error: {
|
||||
kind: "incomplete_turn" as const,
|
||||
message: timeoutText,
|
||||
fallbackSafe: false,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
toolSummary: attemptToolSummary,
|
||||
...(failureSignal ? { failureSignal } : {}),
|
||||
agentHarnessResultClassification: attempt.agentHarnessResultClassification,
|
||||
|
||||
Reference in New Issue
Block a user