feat(harness): add sandbox specific expansion for harness abstraction, add sandbox-just-bash and sandbox-vercel - #15919
Merged
Conversation
…cel Sandbox and just-bash adapters
lgrammel
approved these changes
Jun 9, 2026
gr2m
approved these changes
Jun 9, 2026
Contributor
|
🚀 Published in:
|
felixarntz
pushed a commit
that referenced
this pull request
Jun 9, 2026
…box-just-bash`, and `@ai-sdk/sandbox-vercel` (#15932) follow up to #15911 and #15919 Problem was that we set the version in the initial package.json file to `"0.0.0-canary.0"` instead of just `"0.0.0"` https://github.com/vercel/ai/blob/16ff5014109c69679cbef3db35da1d9b036add29/packages/harness/package.json#L3 The [`changeset` CLI](https://www.npmjs.com/package/@changesets/cli) is using [semver](https://www.npmjs.com/package/semver) to calculate the next version. this is the problem ``` semver.inc("0.0.0-canary.0", "major") // 0.0.0 ``` this works as expected ``` semver.inc("0.0.0", "major") // 1.0.0 ```
5 tasks
felixarntz
added a commit
that referenced
this pull request
Jun 10, 2026
## Background After #15919, this is the 2nd breakout PR from the overarching harness SDK work in #15496. ## Summary * implement the harness specification v1 that each harness adapter must implement * eventually this should probably live in `@ai-sdk/specification`, but we keep it in its own `@ai-sdk/harness` for now due to the experimental nature of it all * implement `HarnessAgent` as consumer-facing entrypoint `@ai-sdk/harness/agent` for running harnesses * implement bridge foundation (separate entrypoint `@ai-sdk/harness/bridge`) which each harness that runs the underlying SDK inside a remote sandbox uses to communicate with that process in the remote sandbox * implement harness adapter utilities (separate entrypoint `@ai-sdk/harness/utils`), exclusively for harness adapter use * implement supplementary `HarnessAgent` helpers to fit into existing AI SDK paradigms where reasonable (e.g. observability) * a few additional `ai` package exports are added because `HarnessAgent` lives in this separate package (because it's considered experimental) * only the `HarnessAgent` layer relies on these exports - the specification itself rightfully does not have any dependency on `ai` ## Manual Verification Verification is happening via the original PR #15496. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
5 tasks
felixarntz
added a commit
that referenced
this pull request
Jun 10, 2026
…15969) ## Background After #15919 and #15941, this is the 3rd breakout PR from #15496. ## Summary - Implements the harness adapters for Claude Code, Codex, Pi - Clarifies one harness specification confusion where `HarnessV1ResumeState` was used for two things (resuming a session _and_ continuing a turn); it is now replaced by two distinct types - Adds executable code examples for harness in `examples/ai-functions` - Adds end-to-end surfaces for testing the harness adapters on various agent configurations: - `examples/harness-e2e-next` (Next app) - `examples/harness-e2e-tui` (TUI) ## Manual Verification Run the new `examples/ai-functions` snippets and/or play around with the two interactive surfaces `examples/harness-e2e-next` and `examples/harness-e2e-tui`. ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [ ] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Future Work Follow-up PRs will add documentation and the workflow specific utilities so you can use `HarnessAgent` with `workflow`.
felixarntz
added a commit
that referenced
this pull request
Jun 11, 2026
## Summary This adds documentation for the new harness abstraction added in #15919, #15941, and #15969: - new top-level `harnesses` entry point - harness adapters section (equivalent to existing providers section) - two mentions in suitable places in existing docs ## Manual Verification N/A ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [ ] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [ ] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
This was referenced Jun 13, 2026
Merged
5 tasks
felixarntz
added a commit
that referenced
this pull request
Jun 23, 2026
…ess agent execution (#16315) ## Background After #15919, #15941, and #15969, this is the 4th and final production code breakout PR from #15496. ## Summary This PR introduces `@ai-sdk/workflow-harness`, a package that lets you run a `HarnessAgent` turn in a durable [`workflow`](https://vercel.com/docs/workflow). A long turn is sliced into short, time-boxed steps. Between slices the agent is frozen non-destructively — the sandbox keeps running and the next slice reattaches to the in-flight turn — while a serializable state object is persisted as the durable step return value. The package ships plain, framework-independent helpers plus a serializable state machine; you own the thin `'use workflow'` / `'use step'` wrappers so that Node-heavy dependencies (the agent, sandbox provider) stay out of the compiled workflow bundle. - New `@ai-sdk/workflow-harness` package exposing `createHarnessWorkflowState`, `runHarnessAgentSlice`, and `finalizeHarnessWorkflow`, with the `HarnessWorkflowState` machine that drives slice-by-slice execution and resumption. - Executable examples for the existing harness adapters demonstrating non-destructive turn freezing. - End-to-end workflow examples (route, workflow, and step modules) for each harness in `harness-e2e-next`. - New "Workflow Utilities" documentation page under AI SDK Harnesses. ## Manual Verification Run the workflow examples in `harness-e2e-next` for each harness adapter (Claude Code, Codex, Pi). ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
This is the first PR broken out from #15496, the harness abstraction layer. All code in these new packages is considered experimental.
Summary
HarnessV1NetworkSandboxSession. Its shape is driven by harness needs (see original draft PR).restricted()method which returns an (effectively lower-capability) instance ofExperimental_SandboxSession. This instance should be passed to tool calls, not the network session instance. Otherwise tools would be able to perform actions that go widely beyond their authority, e.g. stopping the sandbox.provider-utilsorspecificationas an expansion to the existingExperimental_SandboxSession, however we leave it in this experimental package, particularly because it's directly related to the harness abstraction.HarnessV1SandboxProvider, a basically stateless container for sandbox definition. It allows to define a specific sandbox definition in the file root, similarly to e.g.ToolLoopAgent(or the futureHarnessAgent). ThecreateSession()andresumeSession()methods are then used to create stateful sandboxes by actually bootstrapping the resource.just-bashand Vercel Sandbox. These provide both an implementation ofExperimental_SandboxSessionandHarnessV1NetworkSandboxSession, accessible via theHarnessV1SandboxProvider.Note: Merging this PR will publish the first canary releases of the new packages:
@ai-sdk/harness@ai-sdk/sandbox-just-bash@ai-sdk/sandbox-vercelManual Verification
examples/ai-functionswere updated to use these implementations instead of local ones.Checklist
pnpm changesetin the project root)