Desktop: commit-message generation instantly fails when all changes are untracked
What version of the Codex App are you using?
- Installed Windows/MSIX package:
OpenAI.Codex_26.1016.6573.0_x64 - Desktop log release:
26.1016.51333, build21161 - Desktop build commit:
28ffa59d1a9faff009b5e11511b65a65183038f1 - Remote Codex CLI:
0.163.0
The package and release versions above were read from the running installation and desktop logs, rather than the About dialog.
Platform
Windows desktop app, with an existing Git repository on a Linux host connected through the app's SSH remote-project support.
What issue are you seeing?
The built-in Commit flow fails instantly with:
Couldn't generate a commit message
There is no generation wait or timeout. Retrying produces the same immediate failure indefinitely while the repository state stays the same.
The specific trigger identified here is that all pending changes are untracked files, with no staged changes or tracked-file modifications. The commit-message field is blank. With no custom commit instructions supplying context, the generator receives an empty prompt.
This is inconsistent with the actual commit operation: with Include unstaged changes enabled, that operation stages and commits untracked files too, but message generation omits them.
Steps to reproduce
- Open an existing, healthy Git repository with at least one commit in Codex Desktop. The observed setup uses an SSH remote Linux repository from Windows.
- Start with a clean index and working tree.
- Create two small, non-ignored files in a new directory. Do not run
git add. - Verify that
git status --shortshows only??entries, and bothgit diffandgit diff --cachedare empty. - Leave the commit-message field and custom Git commit instructions blank. Keep Include unstaged changes enabled.
- Use the app's built-in Commit action and let it generate the message.
- Observe the immediate error. Retry without changing Git state; the error repeats.
The original occurrence involved two new text files, so a large diff or binary-file parsing was not needed.
Expected behavior
Automatic message generation should see the same changes that the subsequent commit operation will include, including new untracked files when Include unstaged changes is enabled.
If generation has no usable context, the UI should explain the missing context and offer manual message entry instead of displaying an unexplained generation failure.
Observed behavior and why it seems intermittent
- Only untracked additions: immediate message-generation failure.
- Tracked modifications plus untracked additions: the user reports that the flow can generate a message and ultimately commit everything. The inspected implementation supports this: generation gets tracked changes, while the commit step stages both sets. Consequently, the message may omit new files it never saw.
- Asking the chat to do another turn or make more changes sometimes appears to fix the problem. Editing a tracked file or staging the additions would make the generation context nonempty; merely editing still-untracked files would not. This explains the pattern without establishing the cause of every earlier occurrence.
Installed-code investigation
Inspection of the running installation's app.asar found the following path:
-
In
.vite/build/worker.js, thecommit-message-diffhandler calls minified functionFje. WithincludeUnstagedenabled, it callsl1. -
l1copies the Git index to a temporary index, runsgit add -u, and collects a cached diff. Genuinely untracked files are excluded. -
In
webview/assets/git-action-new-branch-field-eab34a12ebed.js,wrpasses this diff toZn/Qn. Empty diff + empty draft + no custom instructions yields an empty prompt. The bundle explicitly contains the context noteUntracked changes are not included. -
In
.vite/build/src-CsH31EEu.js,ZJstarts with the equivalent of:const trimmed = prompt.trim(); if (trimmed.length === 0) return null;This return occurs before model selection or generation telemetry.
-
The frontend maps the null/empty result to the exact reported toast.
-
In contrast, the actual
commithandler callso2, which stages tracked changes and enumerated untracked paths; its fallback isgit add -A.
The key mismatch is therefore tracked-only context collection versus tracked-and-untracked commit staging.
Verification and limits
- Verified the affected repository had exactly two untracked files and no tracked/staged diff.
- Reproduced the app's tracked-only diff procedure on the remote host using an isolated temporary index and temporary object directory: 0 bytes of diff.
- Staged the two new files only in that temporary index: 2,781 bytes of diff.
- Verified the real index bytes and repository status were unchanged afterward; the real object store was used only as an alternate read source.
- Executed the extracted installed
Zn,Qn, andZJfunctions with stubbed model dependencies: empty context returnednull, with zero model-selection calls and zero generation calls. Nonempty tracked context reached the generation stub. - A fresh user retry still failed instantly, and the live desktop logs contained no
commit_messagegeneration event, consistent with the early return.
The isolated function test did not make a live model request or a real commit. No installed app files or repository staging state were changed during diagnosis. The root-cause evidence combines repository-state inspection, installed application code, deterministic isolated execution, and the observed UI failure.
Workarounds
- Stage the intended new files before using automatic generation, for example
git add -- path/to/new-files/. - Enter a commit message manually, which bypasses automatic generation in the inspected commit flow.
Related reports
- #35214 reports repeated Generate message failures; its follow-up also involves untracked files, but diagnoses an invalid
git diff --no-indexinvocation rather than the empty-prompt path described here. - #15403 includes the same toast in a staging-failure report, without this specific cause.
- #30010 concerns a different Windows/SSH temporary-index path bug, reported fixed.
This report was prepared with Codex assistance from an investigation requested by the reporter. Private repository identifiers, source contents, local user paths, credentials, and chat/thread IDs are omitted.
Also encountering the same Couldn't generate a commit message toast repeatedly on 2026-11-19 with Windows desktop package OpenAI.Codex_26.1111.2228.0_x64, using a native local Git repository.
At the time of inspection, git status --short contained exactly one entry:
?? .codex/environments/environment.toml
Both git diff and git diff --cached were empty. The desktop logs for the affected day contained zero feature=commit_message generation events.
Inspection of the installed application bundle with Codex assistance found that this newer build retains the reported path:
.vite/build/worker.js,commit-message-diffwithincludeUnstaged=true, uses a temporary index, runsgit add -u, then readsgit diff --cached.webview/assets/async/540250.3375470e34.jsbuilds an empty prompt when the collected diff, message draft, and custom commit instructions are all empty..vite/build/early-bootstrap-631-cdfc1944212b0139.js, functionsA(), returnsnullfor an empty trimmed prompt before model selection, generation, and usage telemetry. The frontend maps the empty result to this exact toast.
An isolated Git check using a temporary index and temporary object directory reproduced a 0-byte cached diff after git add -u, with the untracked file still absent from the temporary index. The real index hash and working-tree status were preserved.
This supports the same empty-context explanation for a local Windows project. The absence of telemetry alone cannot establish which runtime branch executed. Desktop UI verification of the staging workaround is still pending.
Please include selected untracked files when collecting context for automatic commit-message generation, or show an actionable message when the collected context is empty.