Skip to content

Make Codex status transcript-driven#16

Merged
khoi merged 5 commits intomainfrom
khoiracle/sup-45-make-codex-status-transcript-driven-and-remove-pretooluse
Apr 9, 2026
Merged

Make Codex status transcript-driven#16
khoi merged 5 commits intomainfrom
khoiracle/sup-45-make-codex-status-transcript-driven-and-remove-pretooluse

Conversation

@khoi
Copy link
Copy Markdown
Contributor

@khoi khoi commented Apr 9, 2026

Summary

  • Problem: Codex tab activity still entered .running from managed tool hooks instead of the transcript lifecycle.
  • Why it matters: startup and resume could miss already-active turns, and status could drift from the real Codex turn state.
  • What changed: Codex running and idle state now come from transcript lifecycle events, startup reads the transcript snapshot before tailing, managed Codex hooks were reduced to SessionStart, UserPromptSubmit, and Stop, and the follow-up simplify pass removed duplicated turn-prep and activity-handling branches.
  • What did NOT change (scope boundary): completion notifications still use Stop, running subtitle priority still comes from transcript content, and other agent integrations were not changed.

Rationale

The transcript is the only source that actually describes turn start, turn progress, and turn completion. Driving status from hook side effects left a blind spot on resume and kept Codex activity coupled to events that are not authoritative. This change moves status to the same source of truth that already drives running detail, while keeping hook handling limited to session setup and structured completion.

User-visible / Behavior Changes

  • Codex tabs enter .running when transcript lifecycle events report a started turn, including startup and resume from an already-active transcript.
  • Codex tabs return to .idle on transcript completion and abort events, with Stop still acting as the structured completion fallback.
  • UserPromptSubmit no longer marks Codex running by itself.
  • Stale Codex tool hook events no longer drive tab status.

Diagram (if applicable)

Before:
[Codex hook fires] -> [tab set running]
[startup/resume after started event] -> [monitor starts at EOF] -> [tab can stay idle]

After:
[SessionStart or UserPromptSubmit] -> [monitor arms from transcript snapshot]
[task_started / turn_started] -> [tab running]
[reasoning / tool / assistant message] -> [running detail updates]
[task_complete / turn_complete / turn_aborted] -> [tab idle]

Human Verification

  • Verified scenarios: focused regression tests for hook settings, installer rewrite behavior, transcript startup snapshots, running-detail priority, ignored stale hook events, and transcript-driven running and idle transitions in the registry and session store.
  • Edge cases checked: startup and resume with an already-active transcript, stale final snapshots before the next turn, UserPromptSubmit without forcing running, transcript abort/completion paths, and the simplification pass preserving the same registry/session-store behavior.
  • What you did not verify: manual app interaction in a launched macOS build.
  • How can a human manually verify this: install the Codex hooks, start a turn and confirm the tab only becomes running after transcript start events, resume into an already-running Codex session and confirm the tab is already running from the transcript snapshot, then complete or abort the turn and confirm the tab returns to idle while Stop still delivers completion notifications.

khoi added 2 commits April 9, 2026 16:12
Summary:
- remove hook-driven Codex running transitions from the canonical
  hook set and app-side registry
- start Codex transcript tracking from SessionStart and
  UserPromptSubmit, including active resume snapshots
- rewrite Codex regression coverage and integration docs around the
  transcript-driven lifecycle

Rationale:
- Codex activity was split across hook side effects for running state
  and transcript parsing for detail/final states
- reading the transcript snapshot before polling removes the startup
  blind spot where an already-running turn was missed on resume

Tests:
- make -C apps/mac lint
- xcodebuild test -workspace apps/mac/supaterm.xcworkspace -scheme
  supaterm -destination "platform=macOS"
  -only-testing:supatermTests/SupatermCodexHookSettingsTests
  -only-testing:supatermTests/CodexSettingsInstallerTests
  -only-testing:supatermTests/CodexTranscriptMonitorTests
  -only-testing:supatermTests/TerminalAgentSessionStoreTests
  -only-testing:supatermTests/TerminalWindowRegistryTests
  CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO
  CODE_SIGN_IDENTITY="" -skipMacroValidation
@khoi khoi force-pushed the khoiracle/sup-45-make-codex-status-transcript-driven-and-remove-pretooluse branch from fe704bc to 1ddba25 Compare April 9, 2026 15:15
khoi added 3 commits April 9, 2026 16:50
Summary:
- track Codex hover-message history separately from the running tab detail
- feed hover history from transcript assistant messages and stop payloads
- show the hover markdown in the sidebar popover while keeping row detail
  compact and truncated

Rationale:
- the popover has room for richer transcript context than the tab row
- final answers should replace transient hover history without reusing the
  running subtitle path
- keeping full hover text avoids cutting off long assistant messages in the
  expanded popover

Tests:
- make -C apps/mac lint
- xcodebuild test -workspace apps/mac/supaterm.xcworkspace -scheme supaterm -destination "platform=macOS" -only-testing:supatermTests/CodexTranscriptMonitorTests -only-testing:supatermTests/TerminalHostStateNotificationTests -only-testing:supatermTests/TerminalSidebarChromeViewTests -only-testing:supatermTests/TerminalWindowRegistryTests CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" -skipMacroValidation
@khoi khoi merged commit 1121343 into main Apr 9, 2026
3 checks passed
@khoi khoi deleted the khoiracle/sup-45-make-codex-status-transcript-driven-and-remove-pretooluse branch April 9, 2026 20:02
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.

1 participant