Skip to content

The endpoint decides where a long answer stops #760

Closed

Description

@WaylandYang

Extraction never sends max_tokens, so where a long answer stops is decided by the endpoint's own
default. Measured while trying a reasoning cap (#759):

  • With reasoning disabled, a dense passage's answer stopped at exactly 4,096 completion tokens with
    finish_reason: length, and the JSON could not be parsed.
  • The four-filing run with reasoning_effort: low recorded 8 truncated_reply drops; the uncapped
    baseline recorded 0. Across all bases in the e2e database the reason has fired 10 times.

truncated_reply already does the right thing: the parser keeps every complete item and records a
drop row, so nothing is silently lost. Two things are still worth doing:

  1. Send an explicit max_tokens on the extraction and alignment calls, large enough that a
    dense chunk's JSON fits, so the ceiling is ours rather than whatever the endpoint defaults to.
    This endpoint ignores the field when reasoning is on, and honours it when reasoning is off, so
    sending it costs nothing and helps wherever it is read.
  2. Say why the answer was cut. chat_at_streaming treats finish_reason: length as a normal
    end, so a truncated answer reaches the parser looking complete. Carrying the reason through would
    let the drop row say the answer hit the token ceiling instead of only that it did not parse.

Neither is urgent: the drop is a row today and the statements before the cut are kept.

Activity

  1. added a commit that references this issue on Sep 19, 2026
    b5c65e8
  2. added a commit that references this issue on Sep 19, 2026
    4960e78
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 labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions