Skip to content

feat(): codex parity with claude code session information#74

Merged
StuBehan merged 1 commit into
mainfrom
feat/codex-compat-parity
Jun 8, 2026
Merged

feat(): codex parity with claude code session information#74
StuBehan merged 1 commit into
mainfrom
feat/codex-compat-parity

Conversation

@StuBehan

@StuBehan StuBehan commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Brings Codex to parity with Claude Code for session info + notifications in StackNudge. Codex sessions now show live context-window usage in the Sessions tab (e.g. 26K · gpt-5.5) and get context-fill alerts, permission prompts surface the tool/command, and Codex is auto-wired by the shell installer to match the macOS first-launch wizard. Also fixes an installer venv crash and a build.sh source-list gap.

Changes

Codex context-window usage (Sessions tab)

  • Add panel/CodexTranscriptStats.swift (CodexTranscriptReader) — parses Codex rollout JSONL (~/.codex/sessions/**/rollout-*.jsonl) token_count events. Context occupancy = last_token_usage.total_tokens − reasoning_output_tokens, matching Codex's own tokens_in_context_window() (cached input is a subset of input, never summed).
  • TranscriptReader.read now dispatches by path: Codex rollouts → CodexTranscriptReader, everything else → the existing Claude reader. The event→stats→UI path is already agent-generic, so Codex sessions populate the same context row + context-fill alerts as Claude.

Installer / hooks

  • install.sh + uninstall.sh: auto-wire/remove Codex (~/.codex/hooks.json, Claude-shaped Stop + PermissionRequest), matching what the macOS first-launch wizard already does.
  • notify.sh: agent_supports_decision() gates the in-panel Allow button + blocking permission FIFO to agents whose hook can consume a decision (claude-code, codex). Gemini/Antigravity (observability-only Notification hooks) no longer create a pointless blocking FIFO or show a non-functional Allow button.
  • notify.sh: permission banner resolves Codex's apply_patch tool to a filename (apply_patch: foo.ts) instead of a bare tool name.

Fixes

  • install.sh: clear a partial/incompatible venv (rm -rf "$VENV") before python -m venv, so re-installs don't abort with [Errno 17] File exists.
  • build.sh: add panel/CodexTranscriptStats.swift to the explicit swiftc source list (SPM globs it; the shipping build doesn't).

Docs / tests

  • README.md: reconcile the support matrix + installer/wizard wording (add Antigravity, correct the Cursor-permission note).
  • Tests/StackNudgePanelCoreTests/CodexTranscriptReaderTests.swift: XCTest covering occupancy math, latest-event selection, the cached/cumulative traps, nil cases, and path dispatch.

Testing

  • swift build — clean (library incl. the new file).
  • ./build.sh — succeeds (full shipping app).
  • bash -n + shellcheck -S error — clean on install.sh, uninstall.sh, notify.sh, build.sh.
  • Validated CodexTranscriptReader against a real Codex 0.136 rollout via a standalone swiftc harness → tokens=25864, model=gpt-5.5; plus XCTest fixtures (CI runs swift test under Xcode; can't run locally — CommandLineTools lacks XCTest).
  • Manually verified on macOS: after make build + install, a live Codex session shows the context row (… · gpt-5.5) in the Sessions tab and fires context-fill alerts, identical to Claude.

Related issues

None.

@StuBehan StuBehan merged commit a9459fa into main Jun 8, 2026
5 checks passed
@StuBehan StuBehan deleted the feat/codex-compat-parity branch June 8, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants