-
Notifications
You must be signed in to change notification settings - Fork 102
feat(team): route orchestrator-owned tasks to LangGraph — P1b-ii (5/5) - #1121
Draft
najmuzzaman-mohammad wants to merge 1 commit into
Draft
feat(team): route orchestrator-owned tasks to LangGraph — P1b-ii (5/5) #1121najmuzzaman-mohammad wants to merge 1 commit into
najmuzzaman-mohammad wants to merge 1 commit into
Conversation
...client (P1b-ii) The broker side of the orchestrator-of-record path. When a task carries Orchestrator=="langgraph" and a dispatch client is wired, sendTaskUpdate hands the whole task to the Python orchestrator (POST /run via the deepagents DispatchClient) instead of building a packet and enqueuing a headless CLI turn — per-task single ownership, never both paths. The returned one-way projection is written back by transitioning the task's lifecycle, so the existing web renders the new state unchanged. Re-hydrate model (the spike's P4 decision): each dispatch is one step; the orchestrator rebuilds run-state from the record every time, so a human-gate interrupt resolves by the broker's existing approval path moving the task forward and the next dispatch re-hydrating — no separate Resume wiring needed here. Strictly additive / strangler-fig: l.orchestrator is nil unless WUPHF_ORCHESTRATOR_URL is set, so default installs are byte-for-byte unchanged, and the Orchestrator wire key is omitempty so existing broker-state.json stays identical. - teamTask.Orchestrator field + wire round-trip (omitempty). - taskOrchestrator seam (provider.DispatchClient satisfies it); SetTaskOrchestrator for cmd wiring + test injection; env-gated newConfiguredTaskOrchestrator. - Fail-loud: unknown projection and non-canonical states never transition. - 8 tests with a fake dispatcher (no live sidecar); full team + provider suites green, golangci-lint clean. E2E gate (real task through LangGraph in the web) needs the Python sidecar up — that productionization (supervisor/bundling) is a later phase. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Important
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f329eca1-96d1-4556-9b3b-363245c8648c
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
deepagents/05-broker-orchestrator-routing
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 @coderabbitai help to get the list of available commands and usage tips.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Broker orchestrator routing — P1b-ii (5/5 in stack)
The broker side of the orchestrator-of-record path. When a task is owned by the
LangGraph orchestrator and a dispatch client is wired, the broker hands the
whole task to the Python orchestrator (POST
/runvia the deepagentsDispatchClientfrom PR #1120) instead of building a packet and enqueuing aheadless CLI turn — per-task single ownership, never both paths. The
returned one-way
Projectionis written back by transitioning the task'slifecycle, so the existing web renders the new state unchanged.
Re-hydrate covers the human gate
Each dispatch is one step; the orchestrator rebuilds run-state from the record
every time (the spike's P4 decision). So a human-gate interrupt resolves by the
broker's existing approval path moving the task forward and the next
dispatch re-hydrating — no separate
Resumewiring on this path.Resumestayson the client for the future streaming path.
Strictly additive (strangler-fig)
l.orchestratoris nil unlessWUPHF_ORCHESTRATOR_URLis set → defaultinstalls are byte-for-byte unchanged.
teamTask.Orchestratorwire key isomitempty→ existingbroker-state.jsonstays byte-identical.
l.orchestrator != nil && taskUsesOrchestrator(task).What's here
teamTask.Orchestratorfield (""=broker default,"langgraph"=orchestrator)taskOrchestratorseam (provider.DispatchClientsatisfies it),SetTaskOrchestratorfor cmd wiring + test injection, env-gatednewConfiguredTaskOrchestrator.sendTaskUpdatebranch →dispatchTaskViaOrchestrator→applyOrchestratorProjection.unknownprojection and non-canonical states never transition.Verify
E2E gate remaining
"A real single-agent task completes through LangGraph and renders in the web"
needs the Python sidecar (
uvicorn) running + one task flipped tolanggraph.That productionization (supervisor / bundling, plan §9 P6) is a later phase;
this PR is the broker wiring, fully unit-tested.
Base:
deepagents/04-provider-deepagents(PR #1120).🤖 Generated with Claude Code