fix(codex): avoid detached restart size wait

This commit is contained in:
Brennan Benson
2026-08-02 17:25:12 -07:00
parent 836e1b0a6c
commit 19bc70ae15
2 changed files with 6 additions and 5 deletions
@@ -103,8 +103,8 @@ describe('codex detached pane restart executor', () => {
expect(window.api.pty.spawn).toHaveBeenCalledExactlyOnceWith(
expect.objectContaining({
cols: 120,
rows: 30,
cols: 80,
rows: 24,
cwd: '/Users/dev/code/orca',
command: 'codex',
startupCommandDelivery: 'shell-ready',
@@ -115,6 +115,7 @@ describe('codex detached pane restart executor', () => {
initiallyHidden: true
})
)
expect(window.api.pty.getSize).not.toHaveBeenCalled()
expect(vi.mocked(window.api.pty.spawn).mock.calls[0]?.[0]?.env).toEqual(
expect.objectContaining({
ORCA_PANE_KEY: `tab-1:${LEAF_ID}`,
@@ -171,7 +171,6 @@ async function executeDetachedCodexPaneRestart(
}
const { worktreeId, tab, leafId } = located
const size = await window.api.pty.getSize(ptyId).catch(() => null)
const workspacePath = getWorkspacePath(state, worktreeId)
const cwd = tab.startupCwd ?? workspacePath ?? undefined
const capabilities = hasCachedWindowsTerminalCapabilities()
@@ -194,9 +193,10 @@ async function executeDetachedCodexPaneRestart(
return
}
// Hidden replacements converge on mount; provider sizing must not delay ownership transfer.
const spawned = await window.api.pty.spawn({
cols: size?.cols ?? 80,
rows: size?.rows ?? 24,
cols: 80,
rows: 24,
...(cwd ? { cwd } : {}),
cwdFallback: 'worktree',
env: buildPaneIdentityEnv(state, worktreeId, tab.id, leafId),