Skip to content

[Bug]: Codex compaction can reopen a finished task as Working #31944

Open

Description

@tigerlaibao

Operating system

macOS

Orca version

Observed locally with Orca 1.4.237. The specific hook-sequence regression below is reproduced against current source at ea60ec5d7c.

Details

A Codex SessionStart hook with source: "compact" is treated as new work. After a turn has finished, it changes the sidebar row and terminal tab from Done back to Working. During a live turn, it also clears the prompt, subagent roster, transcript cursor, and tracked turn ID, which can prevent the existing session-log completion fallback from settling that turn.

This report isolates a deterministic hook-sequence regression. A local report of finished Codex tasks remaining Working led to the investigation; the exact triggering event for that original session was not captured, so this issue does not claim that all stuck Codex indicators have this cause.

Reproduction

Using an isolated Orca instance and its normal authenticated /hook/codex endpoint, send these events on the same pane and session:

  1. UserPromptSubmit with turn_id: "turn-1" and a prompt.
  2. Stop with the same turn ID. Confirm the row is Done.
  3. SessionStart with source: "compact", the same session/transcript path, and no turn ID.

Actual: the row becomes Working again and loses its prompt. No new user turn was started.

Expected: compaction preserves the existing turn and status. A finished turn stays Done; a running turn retains its identity and can still settle from its own task_complete; a human question stays waiting.

Before / after evidence

The same synthetic hook sequence was replayed through the real host listener, IPC, renderer store, and sidebar, with Playwright controlling isolated hidden Electron instances. No real Codex model request was needed and no user session was modified.

Current main Narrow fix: ignore compact SessionStart
Before: compact reopens a finished task as Working After: the completed task remains Done

Related work and scope

The proposed scope is only to ignore SessionStart when source is compact, preserving existing startup/resume behavior and avoiding a new timeout or status protocol.

Separate wrong-project observation

A later local inspection found a Codex session whose session/turn directory belongs to one project while its inherited ORCA_PANE_KEY and workspace identity belong to another. Existing open #23411 (shared-daemon hook attribution) and #28267 (inherited host/chat pane identity) cover those attribution paths. This issue and its narrow fix do not claim to resolve that separate problem or establish the cause of the original report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    os:macosIssues affecting macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions