Add a centralized FileWatcher in codex-core (using notify) that watches: * AGENTS.md / AGENTS.override.md and project AGENTS search dirs * Skill roots from the config layer stack (recursive) Send `AgentsChanged` and `SkillsChanged` events when relevant file system changes are detected On `SkillsChanged`: * Invalidate the skills cache immediately in ThreadManager * Emit EventMsg::SkillsUpdateAvailable to active sessions * Broadcast a new app-server notification: skills/list/updated On `AgentsChanged`: * Set a per-session agents_changed flag scoped to relevant watch dirs * On the next user turn, recompute skills + user instructions and inject an updated UserInstructions item into the event stream Wire the watcher through ThreadManager -> Codex::spawn -> SessionServices, including sub-agent sessions. Refactor project_doc discovery to expose project_doc_search_dirs for shared watch-dir computation. Add SkillsListUpdatedNotification to the app-server protocol and gate broadcast until after initialize. Testing: I did a bunch of manual testing of both AGENTS and skills updates. They work surprisingly well. Skill addition and removal are both handled seamlessly in both the UI and in the behavior of the agent on the next turn. Changes to skill details were picked up and followed on the next turn. Additions and modifications to AGENTS.md were followed well. The only failure that I found was when I deleted a major block of instructions from AGENTS.md. In that case, the model still followed those instructions from the older AGENTS.md because it was still in the context window.
codex-core
This crate implements the business logic for Codex. It is designed to be used by the various Codex UIs written in Rust.
Dependencies
Note that codex-core makes some assumptions about certain helper utilities being available in the environment. Currently, this support matrix is:
macOS
Expects /usr/bin/sandbox-exec to be present.
When using the workspace-write sandbox policy, the Seatbelt profile allows
writes under the configured writable roots while keeping .git (directory or
pointer file), the resolved gitdir: target, and .codex read-only.
Linux
Expects the binary containing codex-core to run the equivalent of codex sandbox linux (legacy alias: codex debug landlock) when arg0 is codex-linux-sandbox. See the codex-arg0 crate for details.
All Platforms
Expects the binary containing codex-core to simulate the virtual apply_patch CLI when arg1 is --codex-run-as-apply-patch. See the codex-arg0 crate for details.