Skip to content

feat(evals): add Deep Agents bench harness (integrations/deepagents-sdk + Python runner) - #2810

Draft
miguelg719 wants to merge 9 commits into
harness/wave-evefrom
harness/wave-deepagents
Draft

feat(evals): add Deep Agents bench harness (integrations/deepagents-sdk + Python runner)#2810
miguelg719 wants to merge 9 commits into
harness/wave-evefrom
harness/wave-deepagents

Conversation

@miguelg719

@miguelg719 miguelg719 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

What

Adds --harness deepagents to evals. Deep Agents (LangChain/LangGraph) is a Python library with no CLI or Node SDK, so this adds a Python runner plus a TS session layer that spawns it.

  • packages/integrations/deepagents/runner/run_eval.pycreate_deep_agent + MultiServerMCPClient over the stagehand facade stdio server; emits JSONL events (tool_call, tool_result, final with EVAL_RESULT, usage); harness tool profiles disable summarization/subagents/filesystem/todo tools; pytest coverage.
  • packages/integrations/deepagents-sdkrunDeepagentsSession: spawns the runner via uv, parses JSONL with bounded draining and malformed-line tolerance, process-group termination with SIGTERM→SIGKILL escalation, signal-terminated runs reported as sdk_error, recursion-limit → max_turns, redaction.
  • packages/evals/framework/deepagentsToolAdapter.ts / harnesses/deepagentsAdapter.tsvia:"mcp" mounts with bounded cleanup; events → NormalizedToolCall[].
  • Registered via defineExternalHarness. CI: new Deep Agents runner checks job (uv lock check + pytest) gated on runner path changes.

Testing

  • Full unit gate green (evals + deepagents-sdk 12 + all other suites); uv run --locked pytest 6/6.
  • Connected smoke (evals run b:webvoyager --harness deepagents --tool stagehand_facade -l 1 -t 1 -e browserbase): 5 Stagehand tool calls via the facade, final answer produced.

Stacked on the eve PR. Implemented with Codex (gpt-5.6) under supervision; review blocker (signal exit reported as completed) fixed in-branch.


Summary by cubic

Adds a Deep Agents harness and Python runner so evals can run LangChain/LangGraph agents over MCP. Previously Deep Agents weren’t supported; now --harness deepagents mounts MCP servers and streams JSONL events to the verifier.

  • Registers --harness deepagents with default model openai/gpt-5.4-mini and supported tool surfaces: stagehand_facade (default), playwright_mcp, chrome_devtools_mcp; resolves --tool/--startup via shared helpers.
  • Uses the shared external-harness runner: deepagentsRunner runs with runExternalHarnessTask, normalized harnessStatus/harnessStopReason, and usage mapping.
  • Python runner (packages/integrations/deepagents/runner/run_eval.py) keeps persistent MCP sessions and emits JSONL events: assistant, tool_call, tool_result, final (with eval result), usage, error; applies sanitize-then-clip and a full redaction policy (redacted error/iterationError); disables filesystem/todo/summarization via harness tool profiles (guidance moved into the system prompt).
  • New SDK @browserbasehq/stagehand-integrations-deepagents-sdk spawns the runner via uv, parses JSONL with bounded drain and malformed-line tolerance, forwards AbortSignal to the process group (SIGTERM→SIGKILL), reports signal exits as sdk_error, and normalizes stop reason and token usage.
  • Evals wiring: deepagentsToolAdapter mounts MCP servers and startup profiles; harnesses/deepagentsAdapter converts events to Trajectory; tests cover registry, adapter, runner, and session behavior.
  • CI adds “Deep Agents runner checks” (uv lock + pytest) gated on packages/integrations/deepagents/runner/**; vitest/turbo include the new SDK.

Review/rollout

  • Review the JSONL event contract, status/usage mapping, redaction, and signal/abort handling between the SDK and the Python runner.
  • Local runs require Python 3.11+ and uv. Example: evals run b:webvoyager --harness deepagents --tool stagehand_facade -l 1 -t 1 -e browserbase.
  • Only MCP tool mounts are supported.

Written for commit bd1e627. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bd1e627

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

socket-security Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​deepagents@​0.7.898100100100100
Addedpypi/​langchain-openai@​1.6.0100100100100100

View full report

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

All reported issues were addressed across 25 files

Architecture diagram
sequenceDiagram
    participant EV as Evals Framework
    participant TA as DeepagentsToolAdapter
    participant SDK as Deepagents SDK (TS)
    participant PY as Python Runner (uv/run_eval.py)
    participant MCP as MCP Tool Servers

    Note over EV,MCP: NEW: Deep Agents Harness Integration Flow

    EV->>TA: prepareDeepagentsToolAdapter()
    TA->>TA: Resolve ToolSurface & Startup Profile
    TA->>MCP: NEW: Mount MCP Servers (stdio)
    TA-->>EV: Return config (cwd, env, mcpServers)

    EV->>SDK: runDeepagentsSession(prompt, config)
    SDK->>PY: NEW: Spawn process via 'uv'
    SDK->>PY: NEW: Write JSON config to stdin (prompt, model, mcp_servers)

    loop Agent Loop (LangGraph)
        PY->>PY: Reason/Generate Tool Call
        PY->>SDK: NEW: Emit "assistant" & "tool_call" events (JSONL)
        PY->>MCP: Invoke Tool (via MultiServerMCPClient)
        MCP-->>PY: Return Observation
        PY->>SDK: NEW: Emit "tool_result" event (JSONL)
        
        opt AbortSignal triggered
            SDK->>PY: CHANGED: Send SIGTERM to process group
            Note over SDK,PY: Escalates to SIGKILL after 5s
        end
    end

    PY->>SDK: NEW: Emit "final" & "usage" events (JSONL)
    PY-->>SDK: Process exit
    SDK->>SDK: NEW: Parse JSONL & normalize token usage
    
    alt Signal Exit or Truncated Output
        SDK-->>EV: Return status: "sdk_error"
    else Success
        SDK-->>EV: Return DeepagentsSessionResult
    end

    EV->>EV: NEW: deepagentsAdapter.fromHarnessResult()
    Note over EV: Normalize JSONL events into Trajectory for verification
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/integrations/deepagents-sdk/src/session.ts Outdated
Comment thread packages/integrations/deepagents-sdk/src/session.ts
Comment thread packages/integrations/deepagents/runner/run_eval.py
Comment thread packages/evals/tests/framework/deepagentsAdapter.test.ts Outdated
Comment thread packages/integrations/deepagents-sdk/src/session.ts Outdated
@miguelg719
miguelg719 marked this pull request as draft August 24, 2026 18:20
@miguelg719
miguelg719 force-pushed the harness/wave-deepagents branch 2 times, most recently from 6ae0c5b to 368813e Compare August 24, 2026 18:52
…nner

Phase 1 of the deepagents harness (no registry/planner wiring yet):

- packages/integrations/deepagents/runner: uv project + run_eval.py that
  drives LangChain Deep Agents over persistent stdio MCP sessions and emits
  JSONL events (assistant, tool_call, tool_result, final, usage, error).
- packages/integrations/deepagents-sdk: runDeepagentsSession spawns the
  runner via `uv run --project <dir> --locked python run_eval.py`, forwards
  AbortSignal as SIGTERM, and normalizes status/stopReason/tokenUsage.
- packages/evals/framework: deepagentsToolAdapter (MCP mounts only),
  harnesses/deepagentsAdapter (events -> NormalizedToolCall), and
  deepagentsRunner mirroring codexRunner (prompt/parse duplicated on purpose
  until the shared externalRunner skeleton lands).
- turbo/ci/vitest/evals package wiring for the new workspace package.
…arness core

- define deepagentsHarness via defineExternalHarness and register it after codex
- switch deepagentsRunner onto runExternalHarnessTask (marker result contract,
  normalized harness_* metrics, harnessStatus/harnessStopReason)
- resolve --tool/--startup through the shared toolSurfaceResolution helpers
  (DEEPAGENTS_TOOL_SURFACES: stagehand_facade, playwright_mcp, chrome_devtools_mcp)
- move the file/todo-tool guidance into DEEPAGENTS_SYSTEM_PROMPT
- tests: registry/parse coverage for deepagents; three-harness flag guidance
…group cleanup, redaction, runner tool profiles, CI checks
…lip, redacted error events/iterationError, full redaction policy in Python runner
@miguelg719
miguelg719 force-pushed the harness/wave-deepagents branch from 368813e to bd1e627 Compare August 24, 2026 19:00
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.

1 participant