feat: include cwd in notify payload (#5415)

Expose the session cwd in the notify payload and update docs so scripts
and extensions receive the real project path; users get accurate
project-aware notifications in CLI and VS Code.

Fixes #5387
This commit is contained in:
Thibault Sottiaux
2025-10-20 16:53:03 -07:00
committed by GitHub
parent df15a2f6ef
commit 7fc01c6e9b
3 changed files with 7 additions and 1 deletions

View File

@@ -626,6 +626,7 @@ Specify a program that will be executed to get notified about events generated b
"type": "agent-turn-complete",
"thread-id": "b5f6c1c2-1111-2222-3333-444455556666",
"turn-id": "12345",
"cwd": "/Users/alice/projects/example",
"input-messages": ["Rename `foo` to `bar` and update the callsites."],
"last-assistant-message": "Rename complete and verified `cargo build` succeeds."
}
@@ -635,6 +636,8 @@ The `"type"` property will always be set. Currently, `"agent-turn-complete"` is
`"thread-id"` contains a string that identifies the Codex session that produced the notification; you can use it to correlate multiple turns that belong to the same task.
`"cwd"` reports the absolute working directory for the session so scripts can disambiguate which project triggered the notification.
As an example, here is a Python script that parses the JSON and decides whether to show a desktop push notification using [terminal-notifier](https://github.com/julienXX/terminal-notifier) on macOS:
```python