Skip to content

Add Tenki coding agent example - #327

Open
martincarrera wants to merge 1 commit into
inngest:mainfrom
martincarrera:main
Open

martincarrera wants to merge 1 commit into
inngest:mainfrom
martincarrera:main

Conversation

@martincarrera

Copy link
Copy Markdown

Description

This PR introduces the Tenki Coding Agent: an AgentKit example where the agent does all of its work inside a Tenki Cloud sandbox — an ephemeral, isolated Linux microVM — so no generated code or shell command ever runs on the host machine.

The agent takes a task (by default, building a small React app with Vite), and iterates autonomously inside the sandbox: it scaffolds the project, installs dependencies, writes files, runs code, starts the dev server, health-checks it, and finally exposes a public preview URL so you can open the resulting app in your browser. When the run ends, the sandbox is destroyed.

How it works

  • A single long-lived sandbox session (@tenkicloud/sandbox) is created for the run and shared with the agent through the network state.
  • The agent gets 9 tools backed by the sandbox: shell commands, Python/Node code execution, file upload/read/delete, directory management, dev-server start, and dev-server health check.
  • Dev servers are detached inside the sandbox and their port is bridged automatically if the server only binds to loopback, so the preview URL works regardless of how the framework configures its host binding.
  • Sandbox networking is opt-in: the example enables outbound (npm/git) and inbound (preview URL) explicitly.

Demo

The Notes app below was built and served entirely inside the sandbox by the agent, and captured from the public preview URL:

Notes app built by the agent, served from the sandbox preview URL

Changes

  • Added the Tenki Coding Agent implementation under examples/tenki-coding-agent
  • Created the integration guide at integrations/tenki.mdx with setup instructions and code examples
  • Updated examples/overview.mdx with a Tenki example card
  • Added Tenki to the integrations list in the main README.md and docs/index.mdx
  • Added a sidebar entry for Tenki in docs/astro.config.mjs

Running the example

cd examples/tenki-coding-agent
cp .env.example .env   # set TENKI_API_KEY and ANTHROPIC_API_KEY
npm install
npm run start

TENKI_API_KEY comes from tenki.cloud (or tenki login with the Tenki CLI).

Testing

  • Verified end-to-end: the agent built a Vite React app inside the sandbox and the preview URL served it (HTTP 200), with the sandbox torn down cleanly afterwards.
  • All 9 sandbox tools exercised against live sandboxes, including edge cases: background processes launched from shell commands, loopback-only dev servers (bridged automatically), command timeouts, and non-zero exit codes.
  • tsc --noEmit passes.

Links

* Add Tenki coding agent example
@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 48e8a7a

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

This branch has not been deployed

No deployments
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