Skip to content

docs: golden-agent adoption plan for the unified harness surface#422

Draft
declan-scale wants to merge 4 commits into
nextfrom
declan-scale/golden-agent-adoption-plan
Draft

docs: golden-agent adoption plan for the unified harness surface#422
declan-scale wants to merge 4 commits into
nextfrom
declan-scale/golden-agent-adoption-plan

Conversation

@declan-scale

@declan-scale declan-scale commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The capstone plan for the unified harness surface workstream: how golden_agent (in agentex-agents) adopts the SDK taps + UnifiedEmitter, retiring its bespoke HarnessEvent/AgentexStreamAdapter + per-provider parsers while keeping all SGP-coupled orchestration (sandbox pool, secrets, MCP reauth, data-plane override).

Phased: prereqs (pin SDK) → claude-code → codex → delete the harness layer → optional in-process OpenAI-Agents. Implementation lands in agentex-agents, after this SDK stack merges + releases.

🤖 Generated with Claude Code

Greptile Summary

This PR adds a planning document for migrating the golden_agent in agentex-agents from its bespoke HarnessEvent/AgentexStreamAdapter layer to the SDK's unified harness surface (convert_<harness>_to_agentex_events taps + <Harness>Turn + UnifiedEmitter), while leaving all SGP-coupled concerns (sandbox pool, secrets, MCP reauth, data-plane override) untouched.

  • The plan is phased (Phase 0 prereqs → Phase 1 claude-code → Phase 2 codex → Phase 3 delete bespoke layer → Phase 4 optional OpenAI-Agents), with each phase independently shippable and reversible until Phase 3.
  • The timestamp and wire-shape behavior differences between the new SDK path and the prior dispenser are explicitly called out in the "Determinism / timestamps" and "Risks" sections, giving implementers the right caveats before they write a line of code.

Confidence Score: 5/5

Documentation-only change with no runtime code; safe to merge.

This is a planning document with no executable code. All three prior review concerns (phase label alignment, timestamp delta from old dispenser, OpenAI API surface) have been addressed in the current revision. The one remaining gap — HarnessTurn appearing as an undefined symbol alongside OpenAITurn in Phase 4 — is a minor naming inconsistency that would not block an implementer from understanding the intent.

No files require special attention; the single changed file is a markdown planning document.

Important Files Changed

Filename Overview
docs/superpowers/plans/2026-06-22-golden-agent-unified-surface-adoption.md New planning document describing a phased migration of golden_agent's bespoke harness layer to the SDK unified surface; well-structured with a clear disposition table, pseudocode target flow, and explicit risks section. One undefined symbol (HarnessTurn) in the Phase 4 description; all previous review concerns (phase label, timestamp delta, OpenAI API surface) have been addressed in the current revision.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    P0[Phase 0 — Prereqs\nMerge + release SDK stack\nPin scale-agentex version\nCommit uv.lock]
    P1[Phase 1 — claude-code\nKeep ClaudeProvider sandbox/spawn\nReplace _StreamJsonProcessor + HarnessEvent\nClaudeCodeTurn + UnifiedEmitter.auto_send_turn\nDelete _StreamJsonProcessor]
    P2[Phase 2 — codex\nSame pattern with CodexTurn\nDelete _CodexEventProcessor]
    P3[Phase 3 — retire bespoke harness\nDelete harness/events.py\nDelete harness/adapter.py\nShrink/delete harness/protocol.py\nSimplify harness/activity.py]
    P4[Phase 4 — optional OpenAI-Agents\nAdopt convert_openai_to_agentex_events\nOpenAITurn pending openai migration PR\nTrickiest — deferred]

    KEEP[(Keep unchanged\nSandbox pool/setup\nSecrets/MCP reauth\nData-plane override\nCapabilities/workflow/cron)]

    P0 --> P1
    P1 --> P2
    P2 --> P3
    P3 -.->|optional, later| P4
    P1 & P2 & P3 & P4 --- KEEP
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    P0[Phase 0 — Prereqs\nMerge + release SDK stack\nPin scale-agentex version\nCommit uv.lock]
    P1[Phase 1 — claude-code\nKeep ClaudeProvider sandbox/spawn\nReplace _StreamJsonProcessor + HarnessEvent\nClaudeCodeTurn + UnifiedEmitter.auto_send_turn\nDelete _StreamJsonProcessor]
    P2[Phase 2 — codex\nSame pattern with CodexTurn\nDelete _CodexEventProcessor]
    P3[Phase 3 — retire bespoke harness\nDelete harness/events.py\nDelete harness/adapter.py\nShrink/delete harness/protocol.py\nSimplify harness/activity.py]
    P4[Phase 4 — optional OpenAI-Agents\nAdopt convert_openai_to_agentex_events\nOpenAITurn pending openai migration PR\nTrickiest — deferred]

    KEEP[(Keep unchanged\nSandbox pool/setup\nSecrets/MCP reauth\nData-plane override\nCapabilities/workflow/cron)]

    P0 --> P1
    P1 --> P2
    P2 --> P3
    P3 -.->|optional, later| P4
    P1 & P2 & P3 & P4 --- KEEP
Loading

Reviews (8): Last reviewed commit: "docs: correct timestamp + OpenAI-tap cla..." | Re-trigger Greptile

Comment thread docs/superpowers/plans/2026-06-22-golden-agent-unified-surface-adoption.md Outdated
Comment thread docs/superpowers/plans/2026-06-22-golden-agent-unified-surface-adoption.md Outdated
@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from 37421b6 to df3461c Compare June 22, 2026 14:13
@declan-scale declan-scale force-pushed the declan-scale/golden-agent-adoption-plan branch 2 times, most recently from 10e753f to 5003af8 Compare June 22, 2026 14:37
@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from ccbd5cf to e3fa1cc Compare June 22, 2026 15:14
@declan-scale declan-scale force-pushed the declan-scale/golden-agent-adoption-plan branch 2 times, most recently from 1fdeb33 to 83a7a28 Compare June 22, 2026 16:01
Comment thread docs/superpowers/plans/2026-06-22-golden-agent-unified-surface-adoption.md Outdated
Comment thread docs/superpowers/plans/2026-06-22-golden-agent-unified-surface-adoption.md Outdated
@@ -0,0 +1,93 @@
# Golden Agent — Adopting the Unified Harness Surface

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm can we not put this under superpowers? if it is worthy of doc maybe in notion? or in https://agentex.sgp.scale.com/docs

@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from c8c63d1 to 05120f3 Compare June 22, 2026 18:47
@declan-scale declan-scale force-pushed the declan-scale/golden-agent-adoption-plan branch from 8de7221 to 0bb3161 Compare June 22, 2026 18:47
@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from 05120f3 to c9a907c Compare June 22, 2026 19:54
@declan-scale declan-scale force-pushed the declan-scale/golden-agent-adoption-plan branch from 0bb3161 to 02ff283 Compare June 22, 2026 19:54
@declan-scale declan-scale force-pushed the declan-scale/agx1-373-conformance-equivalence branch from c9a907c to a04bf5e Compare June 22, 2026 20:01
Base automatically changed from declan-scale/agx1-373-conformance-equivalence to next June 22, 2026 20:09
declan-scale and others added 4 commits June 22, 2026 16:10
Migration plan (implementation in agentex-agents/golden_agent): replace the
bespoke HarnessEvent/AgentexStreamAdapter + per-provider parsers with the SDK
taps + UnifiedEmitter, keeping all SGP-coupled orchestration (sandbox pool,
secrets, MCP reauth, data-plane override). Phased: claude-code -> codex ->
delete harness layer -> optional in-process OpenAI-Agents.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Step 4 pseudocode now chains at the canonical StreamTaskMessage level
  (convert_claude_code_to_agentex_events(stdout)) to match the "Sandbox-setup
  event interleaving" prose; ClaudeCodeTurn does not accept raw stdout lines
  alongside parsed events.
- Disposition table now labels the in-process OpenAI-Agents harness as
  Phase 4 (optional), matching the Phases section (Phase 2 is the codex provider).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tile]

The target-flow pseudocode (and the Phase 1 + Determinism subsections) called
workflow.now() from inside execute_agent_turn, which is a Temporal activity —
workflow.now() is only valid in workflow context and raises in an activity. Show
the workflow capturing workflow.now() and passing it into the activity as a
created_at parameter, with the activity forwarding params.created_at to
auto_send_turn.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ptile]

- 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>
@declan-scale declan-scale force-pushed the declan-scale/golden-agent-adoption-plan branch from 02ff283 to 1d66f7a Compare June 22, 2026 20:11
@declan-scale declan-scale marked this pull request as draft June 22, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants