Skip to content

Session loop doesn't stop when model returns finish_reason=stop #11153

Closed as not planned

Description

@tremo1

When the model returns a response with finish_reason=stop (no tool calls, just text), the session loop continues making API calls with identical messages instead of stopping.

Expected: Loop stops when model indicates it's done
Actual: Loop continues, sending the same request repeatedly

Root cause: In processor.ts, the process() function returns "continue" even when finish_reason=stop. It only returns "stop" for errors or blocked states.

Impact: Causes infinite loops until timeout or error, wastes API calls

Activity

  1. github-actions commented on Jan 29, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. rekram1-node commented on Jan 29, 2026

    @rekram1-node
    Contributor

    what provider did u use that encountered this?

  3. blake-hamm commented on Mar 4, 2026

    @blake-hamm

    This happens to me when raw-dogging api calls. I have some logic to handle and send an abort, but it's not ideal - https://github.com/blake-hamm/beyond-vibes/blob/main/src/beyond_vibes/simulations/orchestration.py#L79

  4. rekram1-node commented on Apr 8, 2026

    @rekram1-node
    Contributor

    Havent seen reports of this sense, cant repro. Closing for now

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