Skip to content

fix: turn-timeout gaps — no interrupt on deadline, stalled turn/start uncovered, background ignores --turn-timeout-ms #27

Description

@axisrow

From Codex cycle-review of PR #26 (turn-level timeout port from openai#376). Three gaps in the current timeout implementation:

1. Timed-out turn not interrupted

When the deadline wins Promise.race, the await rejects but turn/interrupt is NOT sent. The broker keeps executing the write-capable turn after it's reported failed. Fix: send turn/interrupt on deadline, await bounded ack.

2. Deadline armed after turn/start response

captureTurn awaits startRequest before arming the deadline. A stalled turn/start (app-server alive but not responding) remains unbounded. Fix: arm the deadline before startRequest, race the entire lifecycle.

3. --turn-timeout-ms ignored for background

The flag is parsed but consumed only by the foreground-only applyForegroundTurnBudget. Background runs fall back to the 600s default, ignoring explicit user override. Fix: persist the explicit value in detached task requests, forward through to captureTurn.

Refs #26, openai#376.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions