You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f06e819
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(tutorials): migrate to the unified harness surface + renumber
Retire the duplicate pre-unified `harness_*` tutorials and migrate every
tutorial onto the canonical unified harness surface (UnifiedEmitter / Turn /
convert_* helpers). Renumber onto the `NNN_<name>` paradigm, fixing the
060/130/140 collision; codex takes fresh 070/140/150 slots.
Non-breaking: example sources only; no shipped SDK API changes. The unified
surface already exists; the deprecated tracing handlers are still present and
are removed in a follow-up.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The sync ACP model uses HTTP request/response for communication. The `@acp.on_message_send` handler receives a message and yields streaming events back to the client.
18
+
### Unified Harness
19
+
20
+
`LangGraphTurn` implements the `HarnessTurn` protocol: it wraps the raw
21
+
LangGraph `astream()` generator and exposes `events` (an async generator of
22
+
`TaskMessageUpdate`) and `usage()` (token counts captured from the final
23
+
`AIMessage`).
24
+
25
+
`UnifiedEmitter.yield_turn(turn)` iterates the turn's events and yields them
26
+
to the sync ACP handler unchanged. The same `LangGraphTurn` object can also be
27
+
passed to `UnifiedEmitter.auto_send_turn` in the async/temporal channels.
17
28
18
-
### LangGraph Integration
19
-
-**StateGraph**: Defines the agent's state machine with `AgentState` (message history)
20
-
-**ToolNode**: Automatically executes tool calls from the LLM
21
-
-**tools_condition**: Routes between tool execution and final response
22
-
-**Checkpointer**: Uses AgentEx's HTTP checkpointer for cross-request memory
29
+
### AGX1-377 Note
23
30
24
-
### Streaming
25
-
The agent streams tokens as they're generated using `convert_langgraph_to_agentex_events()`, which converts LangGraph's stream events into AgentEx `TaskMessageUpdate` events.
31
+
LangGraph emits tool requests as `StreamTaskMessageFull` events (from "updates"
32
+
node outputs). The `SpanDeriver` does not open tool spans from Full events
33
+
today; that gap is tracked in AGX1-373.
26
34
27
35
## Files
28
36
29
37
| File | Description |
30
38
|------|-------------|
31
-
|`project/acp.py`| ACP server and message handler|
32
-
|`project/graph.py`| LangGraph state graph definition|
39
+
|`project/acp.py`| ACP server using unified harness (LangGraphTurn + yield_turn)|
40
+
|`project/graph.py`| LangGraph state graph (weather example)|
0 commit comments