[CLI] Repeated skill-load warnings fill TUI during concurrent AICM skill refresh
What version of Codex CLI is running?
codex-cli 0.149.1
What subscription do you have?
Enterprise
Which model were you using?
_No response_
What platform is your computer?
Darwin 25.5.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
superset sh
Codex doctor report
What issue are you seeing?
Codex intermittently emits repeated skill-loading warnings that permanently accumulate in the TUI scrollback:
⚠ Skipped loading 1 skill(s)due to invalid SKILL.md files.
⚠ /Users/<user>/.agents/skills/<skill>/SKILL.md: failed to read file: No such file or directory (os error 2)
The affected paths are managed by AICM in the shared ~/.agents/skills directory. The same paths often exist shortly after the warning is emitted, and the skill files are observed being rewritten sequentially during an AICM refresh.
The warning is misleading because the failure is a transient ENOENT/race, not necessarily an invalid SKILL.md. Codex also repeats the warning without deduplication, causing the TUI scrollback to slowly fill.
The separate “Cleaned all 15 stale tracked diffs” message appears to come from the Superset wrapper/session cleanup and is not part of the skill-loading failure.
What steps can reproduce the bug?
Uploaded thread: 01a03478-07ab-7c43-8c63-c9ad4429953d
What is the expected behavior?
Codex should tolerate transient ENOENT errors while the skill directory is being refreshed.
Possible acceptable behavior:
- read skills from a consistent snapshot;
- retry or defer transient missing-file errors;
- emit at most one deduplicated warning per persistent failure;
- distinguish unreadable/missing files from malformed SKILL.md files.
Warnings should not accumulate indefinitely in the TUI scrollback.
Additional information
_No response_
2 Comments
I checked this against current
main, and the two symptoms appear to have separate but interacting causes:codex-rs/ext/skills/src/loader/host.rsmaps anyread_file_textfailure tofailed to read file: ..., whilecodex-rs/tui/src/app/startup_prompts.rssummarizes every loader error as an “invalid SKILL.md” warning. A transientENOENTis therefore mislabeled as invalid content.SkillLoadWarningStatekeys warnings by path + message and removes a warning as soon as a refresh returns a clean snapshot. The existingskill_load_warning_state_reemits_after_error_clearstest explicitly expects the same warning to emit again after one clean refresh. An AICM refresh that produces error → clean → error can therefore append the same warning repeatedly.That suggests a narrow fix boundary: classify read/I/O failures separately from parse/frontmatter failures, and either debounce transient
NotFoundor retain its warning state across a short clean refresh. A regression test using error → clean → identical error would cover the reported scrollback accumulation.I'm not familiar with AICM, but it appears that it's not using an atomic method for skills replacement. Codex has a file watcher that watches for file system changes associated with skills updates. If a tool like AICM uses non-atomic updates, there will be windows where the skills files are unreadable or appear corrupt.