Docs: hooks.json timeout key is documented but runtime requires timeout_sec
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 58/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- documentation
Research direction
Compare the examples and field descriptions in learn.chatgpt.com/docs/hooks.md with codex-rs/config/src/hook_config.rs, especially the serde definition and hooks_file_deserializes_existing_json_shape test. Reproduce parsing for both timeout spellings if the repository provides a suitable test entry point, then update the documentation or supported configuration shape so the published key matches the verified runtime behavior.
Written by the indexing model from the issue text.
Description
The official Hooks documentation documents timeout as the key for hook command configurations:
{
"type": "command",
"command": "python3 ~/.codex/hooks/session_end.py",
"timeout": 3
}
The docs also state:
timeoutis in seconds.
Iftimeoutis omitted, Codex uses600seconds for most hooks.
However, in practice, the timeout key is not accepted by the runtime. The key that actually works is timeout_sec.
This is a documentation bug -- the runtime field name does not match what is published.
Affected surfaces
~/.codex/hooks.jsonhooks.jsonin any.codex/directory- Inline
[hooks]tables inconfig.toml
Expected fix
Either:
- Update the docs to document
timeout_secas the correct key, or - Add
timeout_secas an accepted alias if the runtime already supports both.
Source Code Evidence
The Codex Rust source confirms timeout is the only accepted JSON key.
File: codex-rs/config/src/hook_config.rs lines 147-150:
#[serde(default, rename = "timeout")]
timeout_sec: Option<u64>,
The rename = "timeout" serde attribute means the JSON field name is timeout. The Rust struct field is named timeout_sec — that's just an internal naming convention, not the JSON key.
This is the complete serde configuration for the timeout field: there is no alias attribute for timeout_sec, so timeout_sec as a JSON key is not accepted by the parser.
Test evidence: The same source includes a test hooks_file_deserializes_existing_json_shape that parses "timeout": 10 and asserts success — confirming this is the tested, supported shape.
Reference: https://learn.chatgpt.com/docs/hooks.md uses "timeout": 3 and "timeout": 30 in all examples, matching the runtime source.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·