Skip to content

Codex: BB stops a working parent after it accepts a follow-up and a helper has finished #8516

In review

Description

@camilorojasguzman

Summary

A running Codex task accepted a follow-up and kept completing commands after a delegated helper finished. BB then interrupted the task and reported that it had never started. The last command completed 11.7 seconds before the interruption.

Versions and environment

BB 0.50.1 desktop, macOS 27.2 on Apple Silicon, local git worktree, Codex CLI 0.166.0. The interruption occurred in a live session on the stable release. The event sequence below uses synthetic identifiers. I have not reproduced the event ordering on demand from a fresh interactive session.

Steps to reproduce

The smallest regression case I have is a stored-event replay. Add this test beside the existing deadline test in bounded-history-lookups.test.ts at the investigation revision. It uses that file’s existing helpers and advances the cutoff so the test does not need to wait five minutes.

it("keeps a working parent that accepted a follow-up after its helper finished", () => {
  const { db, thread } = setup();
  const cutoff = Date.now() + 60_000;
  const parent = { turnId: "parent", providerThreadId: "provider" };
  const child = { turnId: "child", providerThreadId: "provider" };
  const id = "creq_222222222u";

  insertEvents(db, noopNotifier, [
    event(thread.id, 1, "turn/started", parent),
    event(thread.id, 2, "turn/started", child),
    event(thread.id, 3, "item/completed", { ...child, parentToolCallId: "delegation" }),
    event(thread.id, 4, "turn/completed", { ...child, createdAt: cutoff - 1 }),
    event(thread.id, 5, "client/turn/requested", { data: request(id) }),
    event(thread.id, 6, "turn/input/accepted", { ...parent, data: { clientRequestId: id } }),
    event(thread.id, 7, "item/completed", { ...parent, createdAt: cutoff + 1 }),
  ]);

  expect(isThreadAwaitingTurnStartPastDeadline(db, {
    threadId: thread.id, deadline: cutoff,
  })).toBe(false);
});

The missing parent link on the child's start is significant. Its item events identify the delegation. The parent remains open and accepts the exact follow-up request.

Expected vs actual

Expected: BB keeps the parent running. A request that actually never starts can still time out.

Actual: BB recorded provider_turn_start_timeout, then provider_turn_start_deadline, interrupted the thread and displayed:

The provider did not start the turn within 5 minutes, so bb stopped it. Send a message to try again.

Evidence

The parent accepted the follow-up 102 ms after the request. All 110 completed items on the later, apparently top-level helper turn identified the same delegation. The parent had no completion before the interruption. The 11.7-second interval above is the difference between the last parent item completion and the interruption in the event log. Resuming the failed turn let the task continue.

A local SQLite replay checked a possible final safeguard: when the same still-open parent accepted the exact request and has recent foreground progress, suppress the stop. This prevented the stop on the captured timeline. Removing recent foreground progress restored timeout eligibility in the control. Relevant code: active-turn lookup and deadline eligibility.

What we ruled out

In #5672 the follow-up targeted the wrong turn. Here the correct parent accepted it. #7328 addressed a deadline race involving a turn that had completed. Here the parent was still working, and the stop actually interrupted it. The provider notification ordering that produced the missing parent link is still unconfirmed.

AGENT GENERATED

Activity

  1. added theissue type on Dec 2, 2026
  2. added
    threads
    provider-codex
    confirmed-repro
    on Dec 2, 2026
  3. bb-slop-cop commented on Dec 2, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classification: Bug · Medium priority · Medium effort · threads, provider-codex.

    Reproduced (high confidence): The deadline sweep recorded a false timeout in two clean main checkouts using a stored-event replay. A completed delegate with an unlinked start hid the still-open foreground turn, so the sweep ignored its accepted follow-up and recent output. Live Codex event ordering was not verified. Label: confirmed-repro.

    Reproduction report and regression test · Fix PR #8517

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

    confirmed-reproprovider-codexthreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions