Skip to content

feat(agents)!: write the agent core once in Tish, for JavaScript and native - #38

Merged
spacedevin merged 1 commit into
mainfrom
feat/agents-tish
Oct 14, 2026
Merged

spacedevin merged 1 commit into
mainfrom
feat/agents-tish

Conversation

@spacedevin

Copy link
Copy Markdown
Member

The agent core (loop, runtime of agents, orchestration tools, profiles, supervisor, plans, stores, persistent runs, Hypery model call) is now written once in Tish in tish/agents/. Dune's cloud agents run it natively; this package ships it compiled to JavaScript with generated TypeScript declarations.

  • npm run build:core compiles it (@tishlang/tish 4.2.2), then tsc builds the TypeScript adapters around it.
  • ./agents gets a tish export condition, so Dune imports the Tish source.
  • npm run test:tish (in CI) runs tish/agents/smoke.tish on Tish's VM and as the shipped JS and checks they agree. Verified locally that the same program builds and matches natively.
  • Stays TypeScript (host adapters): indexedDbStore, fileStore, the React hooks, the platform fetch default for createHyperyModel, and real AbortSignals per child (createSignal), so a child's tools can pass ctx.signal to fetch and stopping a child cancels its requests.

Breaking (major release)

  • No classes: createAgentRuntime(host) replaces new AgentRuntime(host), and createTodoList(…) replaces new TodoList(…).
  • Model errors are values (isAgentModelError / agentModelError).
  • Absent values are null.

Upstream fixes this needed: tishlang/tish #768, #769, #770 (JS lowering of Promise.spawn, delay, utf8Complete, --types, and the native compiler fixes).

Tests: 100 SDK tests pass (one new: a child's ctx.signal is a real AbortSignal that aborts on stop). Examples type-check. VM, native and JS smoke runs agree. Docs: docs/AGENTS.md.

Note: if CI's npm ci returns 404 for @tishlang/tish-4.2.2.tgz, npm hasn't started serving the new tarball yet (it was published minutes ago). It needs a re-run once npm serves it.

…native

The agent core (loop, runtime of agents, orchestration tools, profiles, supervisor, plans, stores, persistent runs,
the Hypery model call) is now Tish (tish/agents), compiled into the package with its TypeScript declarations by
`npm run build:core` (@tishlang/tish 4.2.2). Dune's cloud agents run the same source natively: the `./agents` export
has a `tish` condition pointing at it. `npm run test:tish` runs tish/agents/smoke.tish on Tish's VM and as the
shipped JavaScript and checks they agree (in CI); the same program builds and matches natively.

What JavaScript hosts add stays TypeScript: indexedDbStore, fileStore, the React hooks, the platform fetch for
createHyperyModel, and real AbortSignals for each child (createSignal → AbortController), so a child's tools can
pass ctx.signal to fetch and stopping it cancels its requests.

BREAKING CHANGE: no classes. `new AgentRuntime(host)` is `createAgentRuntime(host)`, `new TodoList(…)` is
`createTodoList(…)`, and model errors are values `{ name: "AgentModelError", message, code, status }` (check with
`isAgentModelError`, make with `agentModelError`) — `instanceof AgentModelError` no longer works. Absent values are
`null`: `runtime.get(id)` / `wait` return null for an unknown id. A host model call's `signal` is anything with
`aborted`; with a host-supplied createSignal it may be a plain flag rather than an AbortSignal.
@spacedevin
spacedevin merged commit 0322a0b into main Oct 14, 2026
5 of 6 checks passed
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