feat(ai-harness): build artifacts, worker mode, and remote harnessText - #1521
Open
AlemTuzlak wants to merge 7 commits into
Open
AlemTuzlak wants to merge 7 commits into
AlemTuzlak wants to merge 7 commits into
Conversation
@tanstack/ai-harness/build: buildHarness bundles a harness with Bun into a
worker artifact (harness.js) plus harness.manifest.json (name, agents,
plugins, requirements, sha256 digest), and can compile a single executable.
artifactText(dir) checks the digest, starts one worker process per thread,
and uses it as a text adapter.
@tanstack/ai-harness/worker: runHarnessWorker serves session-tier frames as
NDJSON on stdin and stdout.
harnessText({ url, token }) uses a harness served on another machine (for
example with runCli --serve) as a text adapter.
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: TanStack/ai/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (14)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit 458f665
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-acp
@tanstack/ai-angular
@tanstack/ai-anthropic
@tanstack/ai-bedrock
@tanstack/ai-byteplus
@tanstack/ai-claude-code
@tanstack/ai-client
@tanstack/ai-cloudflare
@tanstack/ai-code-mode
@tanstack/ai-code-mode-snippets
@tanstack/ai-codex
@tanstack/ai-cohere
@tanstack/ai-compaction
@tanstack/ai-devtools-core
@tanstack/ai-durable-stream
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-grok-build
@tanstack/ai-groq
@tanstack/ai-harness
@tanstack/ai-harness-cli
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-daytona
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-isolate-quickjs-bun
@tanstack/ai-llmgateway
@tanstack/ai-lovable
@tanstack/ai-mcp
@tanstack/ai-memory
@tanstack/ai-mistral
@tanstack/ai-octane
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-opencode
@tanstack/ai-openrouter
@tanstack/ai-perplexity
@tanstack/ai-persistence
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-reactor
@tanstack/ai-remix
@tanstack/ai-sandbox
@tanstack/ai-sandbox-blaxel
@tanstack/ai-sandbox-boxd
@tanstack/ai-sandbox-cloudflare
@tanstack/ai-sandbox-daytona
@tanstack/ai-sandbox-docker
@tanstack/ai-sandbox-e2b
@tanstack/ai-sandbox-local-process
@tanstack/ai-sandbox-sprites
@tanstack/ai-sandbox-upstash-box
@tanstack/ai-sandbox-vercel
@tanstack/ai-skills
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-typesafe
@tanstack/ai-utils
@tanstack/ai-vercel-gateway
@tanstack/ai-vertex
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/ai-worldlabs
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
@tanstack/svelte-ai-devtools
commit: |
7 tasks
AlemTuzlak
added this pull request to stack #1536
September 28, 2026 08:53
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.
A harness can now run outside your server: as a worker process built with Bun, on another machine behind
--serve, or as a single executable.buildHarnesswrites a bundle and a manifest,artifactText(dir)runs it as a model, andharnessText({ url, token })talks to a remote harness. This is Phase 5 of the harness stack.Stacked on #1520 (Phase 4) → #1519 → #1518 → #1515 → #1513 → #1509. Merge those first.
🎯 Changes
@tanstack/ai-harness/build:buildHarness({ entry, export, outDir, compile? })bundles with Bun intoharness.jsand writesharness.manifest.json(name, agents, plugins, requirements, sha256 digest).artifactText(dir)checks the digest, starts one worker per outer thread, and is a text adapter withdispose().readManifest(dir).@tanstack/ai-harness/worker:runHarnessWorker(harness)serves session-tier frames as NDJSON on stdin and stdout.harnessText({ url, token }): a remote harness (served bycreateHarnessHandlerorrunCli --serve) as a text adapter. It sends only the new message, because the remote session keeps the history.docs/harness/deploy.md. Changeset: harness (minor).✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.docs/for this change, or this change is not user-facing.pnpm changeset), or this PR does not change a published package.🚀 Release Impact
Testing
Commands run (not the full
pnpm test:pr, see below):@tanstack/ai-harness:vitest run(72 passed, including a real Bun build and a worker process),tsc --noEmit,test:oxlint,build,test:build.@tanstack/ai-harness-cli:vitest run(8 passed).testing/e2e:tsc --noEmit,playwright test tests/harness.spec.ts tests/harness-protocol.spec.ts(9 passed, including a remote harness over HTTP).pnpm test:docs,kiira check docs/harness/deploy.md,pnpm test:sherif,pnpm test:knip.pnpm test:prrun because it is slow on this machine. CI runs it.compileoption is not run in tests (a Bun executable is about 100 MB).Manual test
pnpm --filter @tanstack/ai-harness exec vitest run tests/build.test.ts. It writes a harness file, builds it, and chats with the worker twice.docs/harness/deploy.md:buildHarnesson a harness file, thenchat({ adapter: await artifactText('./dist/studio'), ... }).How this PR makes testing easy
packages/ai-harness/tests/build.test.ts: worker frames, remoteharnessText, a realbuildHarnessrun,artifactTextkeeping the conversation across calls, and a refused tampered bundle.remotescenario intesting/e2e/tests/harness.spec.tscalls the app's own protocol route over HTTP.Risk / rollback
Low. New subpaths and a new
harnessTextoverload. The build imports the user's entry in a child process (documented). Revert the PR to undo.Public API change
Before
After
🤖 Generated with Claude Code
https://claude.ai/code/session_01APYv1qshKyjPPpkFyRZhfZ
Summary by CodeRabbit