feat(streaming): add Executor.execute_stream() returning AsyncIterator[str] for token-by-token delivery #16
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#17 feat(public-api): expose all router-facing APIs at cleveractors package level; update README
cleveragents/cleveractors-core
You do not have permission to read 1 dependency
#13 feat(create_executor): implement create_executor() factory and Executor.execute() returning ActorResult
cleveragents/cleveractors-core
#14 feat(ActorResult): implement ActorResult and NodeUsage types; capture per-node token counts from LangChain responses
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
The actor lifecycle requires both non-streaming and streaming execution (step 6). Currently
LLMAgent.process_message()callsainvoke()only, which buffers the full LLM response before returning. There is no token-by-token delivery path anywhere inPureLangGraphorLLMAgent.The CleverThis router needs to stream partial responses to end-users for a better experience on long-running LLM calls.
Spec reference: Actor Lifecycle Step 6 (streaming path)
Depends on: #13 (
Executormust exist); #14 (recommended —last_result: ActorResultpopulated after stream for billing)What Is Currently Missing
execute_stream()method onExecutor.astream()usage inLLMAgentorPureLangGraph.AsyncIteratorpath through the graph execution pipeline.Acceptance Criteria
LLMAgentgainsstream_message(messages) -> AsyncIterator[str]usingself.chat_model.astream(messages), yieldingchunk.contentper chunk.ainvoke().usage_metadatawhere available; fallback to0with a warning log.executor.last_resultexposes theActorResult(for billing by the router).timeout_mswraps the stream;max_model_calls/max_tool_callscounters increment as normal.execute_streamis accessible on theExecutorobject. No new top-level package export is required.Subtasks
stream_message(messages) -> AsyncIterator[str]toLLMAgentusingastream()execute_stream(message) -> AsyncIterator[str]toExecutorainvokeexecutor.last_result(ActorResult) after stream exhaustionastream)executor.last_resultis populated after stream exhaustionDefinition of Done
async for token in executor.execute_stream(msg)yields string tokens.executor.last_resultis anActorResultafter the stream finishes.