Skip to content

Add thread_id to middlewares#755

Open
mateusz834 wants to merge 1 commit intodevelopfrom
dev/MP/thread-id-middlewares
Open

Add thread_id to middlewares#755
mateusz834 wants to merge 1 commit intodevelopfrom
dev/MP/thread-id-middlewares

Conversation

@mateusz834
Copy link
Copy Markdown
Member

Additionally make sure that subagents get an unique thread_id when no conversation store is being used.

And enforce that thread_id cannot be an empty string, as that is clearly a bug.

@mateusz834 mateusz834 force-pushed the dev/MP/thread-id-middlewares branch 2 times, most recently from 7259546 to 338f820 Compare April 29, 2026 13:12
@mateusz834 mateusz834 marked this pull request as ready for review April 29, 2026 13:13
@mateusz834 mateusz834 force-pushed the dev/MP/thread-id-middlewares branch from 338f820 to 0fd896e Compare April 29, 2026 13:14
Additionally make sure that subagents get an unique thread_id
when no conversation store is being used.

And enforce that thread_id cannot be an empty string, as that
is clearly a bug.
@mateusz834 mateusz834 force-pushed the dev/MP/thread-id-middlewares branch from 0fd896e to 29bea8d Compare April 29, 2026 13:15
)

@pytest.mark.asyncio
@ai_snapshot_test()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this test need to be snapshot?

def _convert_tool_request_from_lc(
request: LC_ToolCallRequest, model: BaseChatModel
) -> ToolRequest:
assert isinstance(request.runtime.context, InvokeContext)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any particular reason why we assert that request.runtime.context is an InvokeContext when converting the tool request, but we don't when converting the model request (14 lines above this line)

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