-
Notifications
You must be signed in to change notification settings - Fork 5
fix(streaming): default to official astream output, fix duplicated Send parallel updates, restore tool/replay/interrupt #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 14 commits
c69f8ca
e0959c1
85305c8
53d44d3
a430afb
d1a9a2c
9d05e61
be61bdd
a05dfab
cd0261b
d8c6a78
df80fbf
f1802d5
d42138c
9b53faf
244e3a0
32e744a
552d3ad
d6e7851
18a0998
90d0ed1
e62c8ec
4087fca
0298d79
c08fe10
0cb21d6
d9b0f38
9bd73bc
e8a11e5
4311a86
a389d04
582e7b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| from agentseek_api.core.orm import Run, Thread | ||
| from agentseek_api.models.auth import User | ||
| from agentseek_api.models.protocol import ProtocolCommandRequest, ProtocolEventStreamRequest | ||
| from agentseek_api.services.stream_modes import normalize_stream_modes | ||
| from agentseek_api.services.run_preparation import ( | ||
| ActiveThreadRunConflictError, | ||
| prepare_and_submit_run, | ||
|
|
@@ -134,11 +135,18 @@ async def handle_protocol_command( | |
| ) | ||
|
|
||
| try: | ||
| run_kwargs: dict[str, Any] | None = None | ||
| if payload.params.get("stream_mode") is not None: | ||
| run_kwargs = {"stream_modes": normalize_stream_modes(payload.params.get("stream_mode"))} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Return 400 for invalid stream modes
|
||
| if payload.params.get("stream_subgraphs"): | ||
| run_kwargs = run_kwargs or {} | ||
| run_kwargs["stream_subgraphs"] = True | ||
| run = await prepare_and_submit_run( | ||
| thread_id=thread_id, | ||
| assistant_id=assistant_id, | ||
| payload=_coerce_protocol_input(payload.params.get("input")), | ||
| user=user, | ||
| kwargs=run_kwargs, | ||
| ) | ||
| except ValueError as exc: | ||
| return _protocol_error(request_id=payload.id, code="invalid_argument", message=str(exc), status_code=404) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Tail protocol events after the initial snapshot
This is the only read of values/updates/messages/tools. After it completes, both executor branches tail only run lifecycle records, even though the
astreammigration stopped publishing translated run-scoped protocol frames. Connecting while a run is active therefore returnsstart/endwhile omitting frames that are persisted later; I reproduced those missing values appearing only on a post-terminal request. Please persist or merge protocol and lifecycle frames into one run-scoped ordered log, tail it live for inline and Redis, and commitendonly after earlier frames.