Skip to content

Navigation Menu

Sign in
Sign up

feat(team): route orchestrator-owned tasks to LangGraph — P1b-ii (5/5) - #1121

Draft
najmuzzaman-mohammad wants to merge 1 commit into
deepagents/04-provider-deepagents from
deepagents/05-broker-orchestrator-routing
Draft

feat(team): route orchestrator-owned tasks to LangGraph — P1b-ii (5/5) #1121
najmuzzaman-mohammad wants to merge 1 commit into
deepagents/04-provider-deepagents from
deepagents/05-broker-orchestrator-routing

Conversation

@najmuzzaman-mohammad

@najmuzzaman-mohammad najmuzzaman-mohammad commented Jun 21, 2026

Copy link
Copy Markdown
Owner

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 /run via the deepagents
DispatchClient from PR #1120) 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 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 Resume wiring on this path. Resume stays
on the client for the future streaming path.

Strictly additive (strangler-fig)

  • l.orchestrator is nil unless WUPHF_ORCHESTRATOR_URL is set → default
    installs are byte-for-byte unchanged.
  • teamTask.Orchestrator wire key is omitempty → existing broker-state.json
    stays byte-identical.
  • Branch sits behind l.orchestrator != nil && taskUsesOrchestrator(task).

What's here

  • teamTask.Orchestrator field (""=broker default, "langgraph"=orchestrator)
    • wire round-trip.
  • taskOrchestrator seam (provider.DispatchClient satisfies it),
    SetTaskOrchestrator for cmd wiring + test injection, env-gated
    newConfiguredTaskOrchestrator.
  • sendTaskUpdate branch → dispatchTaskViaOrchestratorapplyOrchestratorProjection.
  • Fail-loud: unknown projection and non-canonical states never transition.
  • 8 tests with a fake dispatcher (no live sidecar).

Verify

go test ./internal/team/ ./internal/provider/
golangci-lint run ./internal/team/

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 to langgraph.
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

...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>

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /