fix: allow failed code agent sessions to resume

This commit is contained in:
lyon
2026-06-16 03:24:33 +08:00
parent 18da045e87
commit 43b79b6c7e
9 changed files with 43 additions and 54 deletions
+1 -1
View File
@@ -1928,7 +1928,7 @@ async function resolveAgentReplayContext(context: any) {
const threadId = text(body.query?.threadId) || text(body.session?.threadId) || text(body.conversationFacts?.threadId);
const sessionStatus = text(body.session?.status ?? body.conversationFacts?.sessionStatus ?? body.runnerTrace?.sessionStatus ?? body.status);
if (isCodeAgentSessionUnusableStatus(sessionStatus)) {
throw cliError("session_not_usable", "client agent send --from-trace refuses to reuse a failed/stale Code Agent session; create/select a new session first", {
throw cliError("session_not_usable", "client agent send --from-trace refuses to reuse a blocked/stale Code Agent session; create/select a new session first", {
fromTrace: traceId,
conversationId: conversationId || null,
sessionId: sessionId || null,