fix(codex): a resting chat's skills probe no longer pins its worktree on Windows (#33569)

On Windows, the Codex at-rest skills probe no longer starts its 70s-lived `codex app-server` inside the worktree (which locked the folder and made worker release / worktree removal fail with EBUSY); it starts from Orca's stable probe folder and still lists the worktree's skills via the per-request cwd.

Fixes #33174
This commit is contained in:
Neil
2026-10-25 09:27:34 -07:00
committed by GitHub
parent 7bbdc47ec0
commit dd797fc65e
2 changed files with 5 additions and 2 deletions
@@ -62,7 +62,8 @@ describe('a resting Codex chat lists the skills Codex would load', () => {
['--disable', 'plugins', '-c', 'features.test=true', 'app-server'],
['--disable', 'plugins', '-c', 'features.test=true', 'app-server']
])
expect(invocations.map(({ cwd }) => cwd)).toEqual(['/work/one', '/work/two'])
// A settling probe must not hold the folder open, or Windows cannot remove the worktree.
expect(invocations.map(({ cwd }) => cwd?.startsWith('/work'))).toEqual([false, false])
expect(invocations.every((invocation) => invocation.treeKillOnFinish)).toBe(true)
expect(invocations[0]?.env).toMatchObject({
CODEX_HOME: '/home/me/.codex',
+3 -1
View File
@@ -16,6 +16,7 @@ import {
import { runCodexAppServerSession } from './codex-app-server-session'
import { isCodexSkillsListUnsupported, requestCodexSkillReport } from './codex-skill-list'
import { supportsCodexStructuredLocation } from './codex-structured-location-support'
import { resolveHiddenRateLimitPtyCwd } from '../rate-limits/hidden-rate-limit-pty-cwd'
import {
resolveCodexStructuredInvocation,
type CodexStructuredInvocationDeps
@@ -106,7 +107,8 @@ async function probeCodexSkills(
{
command,
args: [...args, 'app-server'],
cwd,
// skills/list takes the folder per request; a settling probe in it blocks Windows worktree removal (#33174).
cwd: resolveHiddenRateLimitPtyCwd(),
cliPath: command,
env: { ...definedEnv(environment), CODEX_HOME: accountHomePath },
envToDelete: [NATIVE_CHAT_SCRATCH_DIR_ENV, LEGACY_NATIVE_CHAT_VISUALS_DIR_ENV],