Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: 19PINE-AI/pine-assistant-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: 19PINE-AI/pine-assistant-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feat/turn-timeout
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 6 files changed
  • 2 contributors

Commits on Aug 12, 2026

  1. fix(chat): end a turn when the agent stops speaking, not once it has …

    …spoken
    
    A turn ended two seconds after silence, measured from the first reply of any
    kind and never re-measured. One flag was set on the first substantive event and
    never cleared, so everything after it ran on the two-second timeout — including
    a tool call, where silence is what a running call looks like. An agent that
    said "placing the call now" and then placed it was cut off from its own result.
    
    The flag is replaced by a question asked of every event: was the last thing to
    arrive the agent speaking? Text, a document, a form, a result, a restriction —
    those start the two-second clock. Anything else clears it and the wait stays
    long. `session:tool_status` moves out of that set for the same reason it caused
    the bug: it reports what the agent is doing, not what it says.
    
    ## Where the rule stops
    
    Nothing else ends a turn, so a turn whose last event is neither speech nor a
    settled state waits indefinitely. Three plain turns recorded against a live
    server each ended on `session:text`, and a turn that ran a task ended on a
    settled state, but nothing guarantees either. `turn_timeout` bounds a turn in
    wall-clock seconds and keeps whatever arrived before the deadline; it defaults
    to none, so no existing caller changes behaviour. A test states the boundary
    rather than leaving it to be discovered.
    
    ## Session states
    
    `credits_exhausted` and `task_paused` now end a turn. Both stop on the account
    rather than on the agent, so nothing further arrives from the session itself.
    
    `task_stale` is dropped: the server has no such state. Staleness is `is_stale`
    on the session object, read over REST — the two were conflated.
    
    ## Tests
    
    The flow tests closed a turn by sending `session:input_state`, which left the
    supported scope in the previous change and no longer ends anything. They now
    close on a settled `session:state`, which is explicit rather than timing-based.
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
    a7vinx and claude committed Aug 12, 2026
    Configuration menu
    Copy the full SHA
    632b768 View commit details
    Browse the repository at this point in the history
Loading