Repository navigation
Keep Codex refresh readable on the bound auth inode - #1871
Conversation
Architecture-Review: unchanged; refresh preserves the existing auth inode, credential identity and token exchange. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 83dc6d9db9e27f0db0ea1d3b3472ce4a9823dbef, 21.0s: approve (0 critical, 0 important, 1 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| # the completed write is readable without a second, interruptible truncate. | ||
| payload = (json.dumps(auth, indent=2) + "\n").encode("utf-8") | ||
| with auth_file.open("r+b", buffering=0) as fh: | ||
| payload = payload.ljust(os.fstat(fh.fileno()).st_size, b" ") |
There was a problem hiding this comment.
suggestion: Auth file never shrinks after a refresh, so it keeps its largest size
Because ljust(st_size) pads every refresh to the current file size, auth.json stays at the largest size it has ever had, and trailing spaces build up. This is safe: json.loads in identity() and the other readers, and Codex's serde_json, all accept trailing whitespace, and the padding overwrites the old token bytes, so nothing stale is left behind. The size is also capped by the largest payload written. Still, a future reader that compares raw bytes or checks the length would see unexpected padding. A short note in the comment saying the size is intentionally monotonic would make this clear. Optionally, the test could also cover a refresh whose payload is longer than the existing file, so the extend path is exercised too.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Keep Codex refresh readable on the bound auth inode
Acceptance
Notes
The change touches only the refresh function and extends the existing binding test. No token selection or refresh exchange behavior changes.
Base
main @ 691a906
Validation
Recorded for
83dc6d9db9e2uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review