Skip to content

Codex goal remains active after a turn ends but no next turn starts #6226

Open

Description

@beautyfree

Summary

When using a native Codex goal in BB, a turn can finish while the goal remains marked active, but no follow-up turn starts. The goal then stays active and idle.

Expected

If the goal is still active, within budget, and the thread is idle with no queued user work or other blocker, Codex should continue working toward the goal after the turn completes.

Actual

The current turn completes, the goal remains active, and no subsequent turn starts. The objective has not been reported as complete.

Steps to reproduce

  1. Start a Codex goal in a BB thread that requires more than one turn.
  2. Let a turn finish before the objective is satisfied.
  3. Observe that the goal remains active but no new turn begins.

This has been observed intermittently. The BB version, Codex version, affected thread ID, and logs were not available when this report was filed, so the exact trigger and reproducibility remain to be established.

Scope

This is about automatic continuation of an active Codex goal after a completed turn. It is separate from #1960, which tracks a provider-independent /goal command. The cause may be in Codex continuation behavior or BB's Codex integration; an event trace is needed to distinguish them.

Activity

  1. added theissue type on Oct 24, 2026
  2. added
    providers
    threads
    provider-codex
    no-repro
    on Oct 24, 2026
  3. bb-slop-cop commented on Oct 24, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority Medium · Effort Medium. Added providers, threads, and provider-codex; no existing classifications were replaced.
    • Report: https://get-bb.github.io/reports/issues/6226.html
    • Verdict: NOT REPRODUCED · root-cause confidence low · reproduction label no-repro.
    • Root cause: Unconfirmed. BB preserves active goal state and forwards a supplied native continuation; the actual native scheduler stall still needs a failure trace.
    • Evidence: The same investigator ran the bounded bridge diagnostic in two clean trusted-main checkouts: both cases passed in each; 96 relevant tests also passed. These scripted probes do not reproduce the real native scheduler failure.
    • No PR: A safe fix needs a failing regression for the reported native stall; none was established on trusted main.

    AGENT GENERATED

  4. gabrielhamu commented on Dec 2, 2026

    @gabrielhamu

    A failure trace that may explain this: 6 occurrences in one thread on macOS, with a Codex goal active and native Codex subagents in use. They were recorded on 2026-11-10. The bb version at the time was not captured. The code path below is unchanged in 0.50.1.

    Pattern (the same in all 6)

    1. The goal is active, per the last provider-codex/goal state before each event.
    2. The main turn completes: turn/completed with no parent_tool_call_id.
    3. Native subagent turns keep running. A turn/started with parent_tool_call_id lands after the main turn completes, and no turn/completed (main or sub) follows within 5 minutes.
    4. bb appends system/error provider_turn_start_deadline and system/thread/interrupted with reason provider-turn-idle. This happens 303–307 s after the main turn/completed in 5 cases, and 661 s after it in one.
    5. No prompt goal continuation follows. A human message restarted the thread in 4 cases, after 110 s to 26,801 s. A system-initiated request restarted it in 1. In the last case, a main turn started 2,912 s later without a new request. Idle time until the next main turn totals 44,263 s (12h18m) across the 6.

    One trace, with times relative to the first event:

    +0s     turn/started               (subagent)
    +19s    client/turn/requested      target new-turn, source tell
    +37s    turn/completed             (main)
    +93s    turn/started               (subagent)
    +132s   turn/completed             (main)
    +161s   turn/started               (subagent)
    +437s   system/error               provider_turn_start_deadline
    +437s   system/thread/interrupted  provider-turn-idle
    +1351s  client/turn/requested      (next human message)
    

    Why the watchdog fires (reading start-server.js in 0.50.1)

    • awaitingTurnStartPastDeadline selects threads that meet three conditions:
      • status = 'active';
      • statusChangedAt <= deadline;
      • no turn/completed event after the deadline.
    • The turn-start.overdue handler then stops the thread when activeTurnId === null.

    A thread whose main turn has ended while native subagents are still working matches all of these conditions. bb therefore reports that "the provider did not start the turn", even though work is in progress. Neither check looks at subagent activity or at an active Codex goal.

    A second correlation, not proven causal: in all 6 cases, the last message before the interruption had target: {kind: "new-turn"}. It was accepted into a turn that was already running.

    Expected: one of the following:

    • a thread with live subagent turns, or with an active goal about to continue, is not treated as a missed turn start;
    • if the thread is stopped, the goal continuation is re-armed;
    • or the goal's status changes so the stop is visible, instead of staying active with no turn.

    Workaround in use: long goals with parallel work run as bb child threads (--parent-self, --parent-notifications auto) instead of native subagents. That way an interruption wakes the parent.

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

    no-reproprovider-codexprovidersthreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions