mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-17 20:07:23 +00:00
fix: use fallback while resuming codex and claude sessions for linux and windows
This commit is contained in:
@@ -1730,8 +1730,14 @@ function handleShellConnection(ws) {
|
|||||||
shellCommand = 'cursor-agent';
|
shellCommand = 'cursor-agent';
|
||||||
}
|
}
|
||||||
} else if (provider === 'codex') {
|
} else if (provider === 'codex') {
|
||||||
|
// Use codex command; attempt to resume and fall back to a new session when the resume fails.
|
||||||
if (hasSession && sessionId) {
|
if (hasSession && sessionId) {
|
||||||
shellCommand = `codex resume "${sessionId}"`;
|
if (os.platform() === 'win32') {
|
||||||
|
// PowerShell syntax for fallback
|
||||||
|
shellCommand = `codex resume "${sessionId}"; if ($LASTEXITCODE -ne 0) { codex }`;
|
||||||
|
} else {
|
||||||
|
shellCommand = `codex resume "${sessionId}" || codex`;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
shellCommand = 'codex';
|
shellCommand = 'codex';
|
||||||
}
|
}
|
||||||
@@ -1765,7 +1771,11 @@ function handleShellConnection(ws) {
|
|||||||
// Claude (default provider)
|
// Claude (default provider)
|
||||||
const command = initialCommand || 'claude';
|
const command = initialCommand || 'claude';
|
||||||
if (hasSession && sessionId) {
|
if (hasSession && sessionId) {
|
||||||
shellCommand = `claude --resume "${sessionId}"`;
|
if (os.platform() === 'win32') {
|
||||||
|
shellCommand = `claude --resume "${sessionId}"; if ($LASTEXITCODE -ne 0) { claude }`;
|
||||||
|
} else {
|
||||||
|
shellCommand = `claude --resume "${sessionId}" || claude`;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
shellCommand = command;
|
shellCommand = command;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user