Files
codex/codex-rs/app-server-protocol
Eric Traut 8fe083b541 Added support for live updates to skills and AGENTS
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.
2026-01-27 00:07:12 -08:00
..