Automations auto-archive with no output when cwd repo has no HEAD

Open 💬 1 comment Opened Feb 6, 2026 by MichaelRoberts98

What version of the Codex App are you using (From “About Codex” dialog)?

260205.1301 (554)

What subscription do you have?

Enterprise

What issue are you seeing?

Automation threads show “This thread was automatically archived / No message found” (No assistant output is stored) This happens when the current directory of an automation is a not a git repository or is a git repository with no commits.

What steps can reproduce the bug?

Create an automation with the project directory pointing at a git worktree that has no commits (so HEAD is invalid).
Run automation.
Observe: thread auto-archives, “No message found”.

What is the expected behavior?

Automation should either run and produce output, or show a visible error explaining setup failure.

Additional information

Codex log information:

2026-02-06T05:38:15.001Z warning [git] [b851db3b] encountered an error running git command (subcommand=worktree,args=5, code=128, stderr=string(len=30))
2026-02-06T05:38:15.023Z warning [git] Failed to remove worktree parent directory (error(name=Error,code=ENOENT))
2026-02-06T05:38:15.031Z warning [automations] Scheduled run failed {
  automationId: 'update-agents-md',
  error: Error: git worktree add failed: fatal: invalid reference: HEAD
      at aZ (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main-CQwPb0Th.js:373:7985)
      at async iZ (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main-CQwPb0Th.js:373:7288)
      at async dZ (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main-CQwPb0Th.js:377:863)
      at async S5 (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main-CQwPb0Th.js:481:602)
      at async u$ (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main-CQwPb0Th.js:479:2460)
      at async /Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main-CQwPb0Th.js:479:1596
      at async Promise.all (index 0)
      at async o (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main-CQwPb0Th.js:479:1513)
}

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗