openai / openai/codex

app-server fs/watch misses append updates to active rollout JSONL on macOS

Open
#39,624 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app-server bug CLI
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What issue are you seeing?

On macOS, app-server fs/watch does not emit fs/changed while an active Codex rollout JSONL is being appended to.

The rollout file size and modification time continue changing as reasoning, tool-call, and output items are written, but the app-server connection receives no corresponding fs/changed notification. A notification may appear around a user-message or turn boundary, but incremental turn items do not reliably trigger one.

This prevents clients that use the file notification as a signal to call thread/read from updating the active turn in real time.

What steps can reproduce the bug?
  1. Start codex app-server over stdio and send initialize.
  2. Start or resume a thread and locate its active rollout JSONL under the Codex sessions directory.
  3. Subscribe to the exact absolute file path:
{ "method": "fs/watch", "id": 44, "params": {
  "watchId": "0195ec6b-1d6f-7c2e-8c7a-56f2c4a8b9d1",
  "path": "/absolute/path/to/rollout.jsonl"
} }
  1. Continue the turn so Codex appends reasoning, tool-call, command-output, and assistant-output records to the same file.
  2. Observe that the file size and mtime change, but no fs/changed notification is emitted for those appends.

Control checks from the same machine:

  • The same app-server watcher emits fs/changed for a newly created file in a watched temporary directory, so the subscription and connection are working.
  • fswatch using its default macOS backend also misses the active rollout appends.
  • fswatch -m kqueue_monitor on the same rollout file reports every append immediately.

The FSEvents/kqueue comparison is diagnostic evidence, not a confirmed root cause.

What is the expected behavior?

After the watcher debounce interval, each modification or batch of modifications to the watched file should emit:

{ "method": "fs/changed", "params": {
  "watchId": "0195ec6b-1d6f-7c2e-8c7a-56f2c4a8b9d1",
  "changedPaths": ["/absolute/path/to/rollout.jsonl"]
} }

This should work for append-only writes while the writer keeps the file open, not only for create, replace, rename, or turn-boundary activity.

Additional information
  • Codex CLI: 0.148.0 (current latest release at time of report)
  • Platform: Darwin 25.5.0 arm64 arm
  • macOS: 26.5.2 (25F84)
  • Architecture: Apple Silicon
  • Installation: Homebrew
  • codex doctor --json: app-server check is OK; the unrelated overall failure is only because the noninteractive diagnostic shell has TERM=dumb.
  • The app-server documentation says watching a file emits fs/changed for that path. The observed behavior differs specifically for sustained append activity on the active rollout file.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the app-server fs/watch implementation and reproduce the append-only rollout JSONL case on macOS, comparing its watcher behavior with fswatch -m kqueue_monitor. Trace how file modifications become fs/changed notifications and add or update coverage for sustained appends. Done means watched files emit the expected path notification after the debounce interval while they remain open.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.