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
docs(harness): refresh harness.md to the merged surface (all five taps, canonical yield_turn example)
Completes the taps table with claude-code/codex/openai, names the per-harness
HarnessTurn wrappers, and replaces the pre-unified sync example (which left
UnifiedEmitter unused) with the canonical emitter.yield_turn(turn) flow.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Taps for claude-code and codex will be added in subsequent PRs (AGX1-420, AGX1-421) and exported from `agentex.lib.adk` in the same way.
52
+
Each harness also provides a `HarnessTurn` wrapper that pairs its tap's event stream with usage extraction: `PydanticAITurn`, `LangGraphTurn`, `ClaudeCodeTurn`, `CodexTurn`, and `OpenAITurn`.
50
53
51
54
---
52
55
@@ -157,11 +160,13 @@ Spans are derived from the canonical stream by `SpanDeriver` (pure, no `adk` dep
157
160
158
161
## Usage examples by channel
159
162
160
-
### Sync ACP (pydantic-ai tap)
163
+
### Sync ACP (`yield_turn`)
164
+
165
+
Build the harness's `HarnessTurn` wrapper and iterate `emitter.yield_turn(turn)` — the emitter forwards each event to the caller and traces spans as a side effect:
161
166
162
167
```python
163
168
import agentex.lib.adk as adk
164
-
from agentex.lib.adk import UnifiedEmitter, convert_pydantic_ai_to_agentex_events
169
+
from agentex.lib.adk import UnifiedEmitter, ClaudeCodeTurn
165
170
166
171
@acp.on_message_send
167
172
asyncdefhandle(params):
@@ -172,13 +177,12 @@ async def handle(params):
172
177
trace_id=task_id,
173
178
parent_span_id=turn_span.id if turn_span elseNone,
174
179
)
175
-
tap = convert_pydantic_ai_to_agentex_events(pydantic_stream)
176
-
# wrap tap in a HarnessTurn then yield_turn, or yield directly:
177
-
asyncfor event in tap:
180
+
turn = ClaudeCodeTurn(claude_code_stream) # any HarnessTurn
181
+
asyncfor event in emitter.yield_turn(turn):
178
182
yield event
179
183
```
180
184
181
-
For the pre-unified sync path the tap is still yielded directly; `UnifiedEmitter.yield_turn` is the forward-looking integration point when a `HarnessTurn` wrapper is available.
185
+
Every harness follows the same shape — swap `ClaudeCodeTurn` for `PydanticAITurn`, `LangGraphTurn`, `CodexTurn`, or `OpenAITurn` and feed it that harness's native stream.
0 commit comments