Skip to content

Commit 0bb3161

Browse files
declan-scaleclaude
andcommitted
docs: correct timestamp + OpenAI-tap claims in golden-agent plan [greptile]
- Determinism section: stop claiming created_at forwarding "matches the prior dispenser behavior". auto_send_turn stamps every message in the turn with the same created_at, whereas the dispenser stamped only the first agent message (later ones took server time). Note the intra-turn ordering implication and the created_at=None / per-message alternatives. - Phase 4: reference the real SDK openai tap (convert_openai_to_agentex_events wrapped in a HarnessTurn; OpenAITurn lands in the openai migration PR) instead of implying OpenAITurn is already on the public surface, and clarify that run_agent_streamed_auto_send is the existing provider wrapper, not the tap/Turn migration target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent f68334f commit 0bb3161

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/superpowers/plans/2026-06-22-golden-agent-unified-surface-adoption.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ execute_agent_turn (activity, receives created_at via ActivityParams):
5151
Today the provider yields sandbox provisioning steps (reconnect / find / create / configure-git / clone) as `ToolStarted`/`ToolCompleted` `HarnessEvent`s that flow through the adapter so they appear in the UI + trace. Under the unified surface these become agent-produced `ToolRequestContent`/`ToolResponseContent` `StreamTaskMessage*` messages, **chained before** the harness tap's stream into one canonical stream for the turn (`chain(setup_events, convert_claude_code_to_agentex_events(stdout))`). `UnifiedEmitter` then delivers and traces the whole turn uniformly — setup steps keep showing in the UI and span tree.
5252

5353
### Determinism / timestamps
54-
Capture the timestamp in the **workflow** with `workflow.now()` and pass it into `execute_agent_turn` as an activity parameter (`created_at`); the activity forwards `params.created_at` to `auto_send_turn` (AGX1-378) so the turn's messages carry deterministic Temporal timestamps, matching the prior dispenser behavior. Do NOT call `workflow.now()` inside the activity (it is only valid in workflow context and raises otherwise).
54+
Capture the timestamp in the **workflow** with `workflow.now()` and pass it into `execute_agent_turn` as an activity parameter (`created_at`); the activity forwards `params.created_at` to `auto_send_turn` (AGX1-378) for deterministic Temporal timestamps. Note this is NOT identical to the prior dispenser: `auto_send_turn` applies the same `created_at` to every message it opens in the turn (setup, tool, text), whereas the old dispenser stamped only the first agent message and let later messages take server time. A single per-turn timestamp can collapse the relative ordering of streamed UI messages and trace spans within a turn, so if intra-turn ordering matters, leave `created_at=None` (server time) or stamp per message. Do NOT call `workflow.now()` inside the activity (it is only valid in workflow context and raises otherwise).
5555

5656
### Usage / metrics
5757
`auto_send_turn` returns a `TurnResult` with a normalized `TurnUsage`. The golden agent's per-turn DogStatsD metrics (`metrics.py`) read from `TurnUsage` instead of the old `TurnCompleted` event — one shape for traces + metrics.
@@ -73,7 +73,7 @@ Capture the timestamp in the **workflow** with `workflow.now()` and pass it into
7373

7474
**Phase 3 — retire the bespoke harness layer** — delete `harness/events.py`, `harness/adapter.py`, and shrink/delete `harness/protocol.py`; simplify `harness/activity.py` to the tap→Turn→emitter shape. Confirm no remaining imports of the deleted symbols.
7575

76-
**Phase 4 (optional, later) — in-process OpenAI-Agents (litellm) harness** — adopt the SDK openai tap (`OpenAITurn` / `run_agent_streamed_auto_send`) in place of `oai_streaming_model.py`/`oai_hooks.py`. This path runs the OpenAI Agents SDK in-process inside the workflow and is the most coupled to Temporal context; treat as a separate, carefully-scoped follow-up.
76+
**Phase 4 (optional, later) — in-process OpenAI-Agents (litellm) harness** — adopt the SDK openai tap (`convert_openai_to_agentex_events`, wrapped in a `HarnessTurn`; `OpenAITurn` lands in the openai migration PR) + `UnifiedEmitter` in place of `oai_streaming_model.py`/`oai_hooks.py`. Note `run_agent_streamed_auto_send` is the existing provider auto-send wrapper, not a tap/Turn replacement, so it is not the migration target here. This path runs the OpenAI Agents SDK in-process inside the workflow and is the most coupled to Temporal context; treat as a separate, carefully-scoped follow-up.
7777

7878
## Testing
7979
- The SDK's cross-channel conformance (#414) + per-harness fixtures already prove the taps produce correct, channel-equivalent streams + spans + usage. The golden agent inherits that confidence by consuming them.

0 commit comments

Comments
 (0)