Skip to content

Relax client tool call output request thread items lookback from 1 to default page size, bump patch version to 1.6.4#123

Open
jiwon-oai wants to merge 1 commit intomainfrom
relax-client-tool-call-error
Open

Relax client tool call output request thread items lookback from 1 to default page size, bump patch version to 1.6.4#123
jiwon-oai wants to merge 1 commit intomainfrom
relax-client-tool-call-error

Conversation

@jiwon-oai
Copy link
Copy Markdown
Collaborator

@jiwon-oai jiwon-oai commented Apr 23, 2026

When ThreadsAddClientToolOutputReq() is invoked, we raise a value error and abort the stream server-side unless the very last thread item in the current thread is a pending client tool call item.

This is fragile for cases where a previous turn might add hidden context items or items added with the same created at timestamp can have swapped orders etc.

Relaxing this requirement so that:

  • We look back a page size (20) instead of just 1 item
  • We interpret the request as a "resume" signal and continue inference even if a pending tool call wasn't found.

This lets us handle a case that would've always been an error to be resilient and continue the response instead of flopping.

Tested against chatkit studio by manually appending a hidden context item after streaming a client tool call item:

Status quo After relaxing requirements
Stream abruptly stops after error
Screenshot 2026-04-23 at 10 59 57 AM
Screenshot 2026-04-23 at 11 04 19 AM
Stream continues
Screenshot 2026-04-23 at 10 58 04 AM

… page size.

Continue to respond() even when we don't find an existing pending client tool call item.

Bump to 1.6.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants