Skip to content

Navigation Menu

Sign in
Sign up

feat(provider): Go dispatch client for the LangGraph orchestrator — P1b-i (4/4) - #1120

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

feat(provider): Go dispatch client for the LangGraph orchestrator — P1b-i (4/4) #1120
najmuzzaman-mohammad wants to merge 1 commit into
deepagents/03-orchestrator from
deepagents/04-provider-deepagents

Conversation

@najmuzzaman-mohammad

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

Copy link
Copy Markdown
Owner

Go dispatch client — P1b-i (4/4 in stack)

The Go side of the Go↔Python orchestration seam. Counterpart to the
orchestrator's FastAPI service (orchestrator/src/orchestrator/service.py):
the broker hands an authoritative task record to the Python LangGraph
orchestrator and gets back a terminal StepResult + a one-way Projection it
persists so the existing web renders unchanged.

Why a standalone client, not a StreamFn Entry

The StreamFn seam (internal/agent/types.go:105) is func(msgs, tools) <-chan chunk
— a per-turn token stream with no task identity. The orchestrator-of-record
owns the whole task lifecycle and needs the full record to re-hydrate run-state,
so a turn stream is the wrong shape. Forcing it through StreamFn would mean
inventing a record out of thin air. This client is the honest seam.

What's here

  • KindDeepagents binding kind — validates today; broker routing + picker
    visibility come with the wiring slice.
  • Wire types mirroring wire.py field-for-field (snake_case, schema_version,
    env-var-name-only MCP — secrets never cross in the body).
  • DispatchClient.Run / Resume / Health against the FastAPI service.
  • Fail-loud: non-2xx surfaces the server's error body; a status outside
    {done, interrupted} returns ErrUnexpectedStatus; interrupted with no
    payload errors; Projection.IsUnknown() flags the orchestrator's unmappable
    record for operator triage.
  • 11 tests against an httptest stand-in for service.py; race-clean.

Verify

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

Deferred (next slice, P1b-ii)

Broker wiring in internal/team: route the per-task orchestrator=langgraph|broker
flag to DispatchClient instead of the in-process turn loop, write the
projection back onto the task record, behind a flag, one task-type. Then P2
wires the real ClaudeAgentHarness on the Python side.

Base: deepagents/03-orchestrator (PR #1119).

🤖 Generated with Claude Code

...b-i)
The Go side of the Go<->Python orchestration seam: a typed client that hands
an authoritative task record to the Python LangGraph orchestrator (POST /run,
/resume) and decodes the one-way projection it writes back. Counterpart to
orchestrator/src/orchestrator/service.py; the wire contract mirrors wire.py
field-for-field (snake_case, schema_version, env-var-name-only MCP).
Built as a standalone DispatchClient, not a registered StreamFn Entry: the
StreamFn seam is func(msgs, tools) <-chan chunk — a per-turn token stream with
no task identity — but the orchestrator owns the whole task lifecycle and needs
the full record to re-hydrate run-state. Broker routing on the per-task
orchestrator flag + projection write-back into task records is the next slice
(internal/team).
- KindDeepagents binding kind (validates; not yet a pickable runtime).
- DispatchRequest/ResumeRequest/StepResult/Projection/McpServer wire types.
- Run/Resume/Health; fail-loud on non-2xx (surfaces server body), on a status
 outside {done, interrupted}, and on interrupted-without-payload.
- Projection.IsUnknown flags the orchestrator's fail-loud unmappable record.
- 11 tests against an httptest stand-in for service.py; race-clean.
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: 74c5df4b-6070-4eaf-a738-7727e0c4267c

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/04-provider-deepagents

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 によって変換されたページ (->オリジナル) /