Skip to content

Headless run exits before an in-flight session-title request finishes, so short answers leave the placeholder title #1690

Open

Description

@sahrizvi

What happens

In headless run, the session title request is fire-and-forget: it is started when the first model call begins, and the process exits as soon as the answer has been written. When the answer is short, the process exits before the title answer arrives and the session keeps New session - <timestamp>.

Seen end to end on the free tier with a build of #1688 "fix(session): retry a failed session title on later turns and report why it failed": a run --session <id> whose answer was 6 exited within a second of the retry request being sent, and the placeholder stayed; the next message, with a 200-word answer, let the request finish and the session was titled. The same race exists on main for the first title request; the retry in #1688 means a later run --session can now recover, but only if its own answer takes longer than the title request.

Expected

run waits briefly (a few seconds) for a title request that is already in flight before exiting, so sessions created or continued headlessly get their title. A hung request must not delay exit beyond that cap.

Where

packages/opencode/src/cli/cmd/run.ts exit path and ensureTitle in packages/opencode/src/session/prompt.ts (the in-flight set added in #1688 can be awaited).

Activity

  1. self-assigned this
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions