feat: single worker stream context#3968
feat: single worker stream context#3968fengju0213 wants to merge 6 commits intofeat/chatagent-callbacks-context-clonefrom
Conversation
…ments - Remove `worker_agent.execution_context` assignment (attribute doesn't exist on ChatAgent, only `_execution_context` does) - Remove unused `total_tokens` local variable - Add backward-compat comments for duplicate fields - Fix line-length lint errors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.
Once credits are available, reopen this pull request to trigger a review.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Normalize streaming response handling, add task-scoped execution context, and structure worker attempt records in
SingleAgentWorker.Changes
single_agent_worker.py:_consume_worker_response— unified streaming consumer replacing two inline implementations. Auto-detects delta/cumulative mode, forwards stream_callback, extractsTaskResult._build_execution_context/_attach_execution_context— builds task-scoped context (task_id, parent_task_id, worker_node_id, attempt, agent IDs) and injects into worker agent andtask.additional_info._record_worker_attempt— structured attempt recording with full token_usage, execution_context, content/tool summaries. Backward-compatible fields retained with TODO.AgentPool.return_agent— clears_execution_contexton return to prevent cross-task leakage.consume_response_content_async.Closes #
Description
What is the purpose of this pull request?
Checklist
pyproject.tomland runuv lockIf you are unsure about any of these, don't hesitate to ask. We are here to help!