惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
G
Google Developers Blog
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
腾讯CDC
博客园_首页
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
WordPress大学
WordPress大学
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
有赞技术团队
有赞技术团队
博客园 - 叶小钗

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
OpenComputer Durable Agent Sessions
igorzij · 2026-06-23 · via Hacker News: Show HN

Preview

Durable Agent Sessions

Resumable, steerable agent sessions

OpenComputer handles session state, runtime lifecycle, streaming, and webhooks, so your app code stays small enough to run on an edge worker.

Example: PR-review agent repo

Built into every session

Use sessions for durable agents; use sandboxes for one-shot commands.

runtime

Self-healing runtime

  • Runtime crashes restart automatically.
  • Idle sessions hibernate and wake on the next message.
  • Hung runs stop cleanly instead of staying stuck.

sandbox

Brain / hands sandboxing

  • Brain: agent loop. Hands: files and commands.
  • Untrusted work stays contained in the hands sandbox.
  • Your model key stays in the secret store, never in a sandbox.

webhook

Reliable backend delivery

  • Deliver user-level events to your webhook.
  • Requests are signed when the destination has a secret.
  • Deliveries are retried, dead-lettered, inspectable, and redeliverable.

1. Create an agent

An agent stores name, runtime, model, prompt, and model credential.

TypeScript SDK
import { OpenComputer } from "@opencomputer/sdk";

const oc = new OpenComputer({
  apiKey: process.env.OPENCOMPUTER_API_KEY,
});

const agent = await oc.agents.create({
  name: "quickstart-coder",
  runtime: "claude",
  model: "anthropic/claude-opus-4-8",
  prompt: "Work in /workspace. Say progress. Ask only when blocked.",
  key: process.env.ANTHROPIC_API_KEY,
  limits: { turns: 4, turnSeconds: 600 },
});

2. Start a session

A session starts work and returns a browser-safe client_token scoped to that session.

Start work
const session = await oc.sessions.create({
  agent: agent.id,
  input: "Create a todo app with local storage.",
  metadata: {
    projectId: "proj_123",
    taskId: "task_456",
  },
  idempotencyKey: "task_456",
  destinations: [{
    url: "https://your.app/oc-webhook",
    level: "user",
    types: ["turn.completed"],
  }],
});

// session.id + session.clientToken

3. Stream and steer

Use the session token in the browser. EventSource resumes after dropped connections.

Browser client
import { connectSession } from "@opencomputer/sdk";

const live = await connectSession({ sessionId, clientToken });

for await (const event of live.events({ level: "progress" })) {
  render(event);
}

await live.steer("Add a completed-task filter.", {
  idempotencyKey: "msg_01",
});

Session lifecycle

A session is the durable unit of an agent at work: an append-only event log, pinned agent snapshot, and lifecycle status. Compute attaches, hibernates, and wakes on the next message.

Status Meaning
queuedScheduled; a turn has not started running yet.
runningA turn is executing.
awaiting_inputA turn ended asking a question. Reply by steering.
idleDone for now, quiescent and steerable. The sandbox is hibernated.
failedThe session errored out.
archivedClosed and read-only.
Fetch the result
const session = await oc.sessions.get("ses_...");
const { lastTurn, result } = await session.result();

// lastTurn.yieldReason: "completed", "needs_input",
// "deadline_exceeded", "budget_exceeded", "max_turns", "canceled"

Event log

Each session has ordered events. Use seq to resume and type to handle structured events.

Turn event sequence
turn.started
  tool.call          npm test
  exec.completed     exit 1
  agent.message      "3 tests fail"   level: user
turn.completed       needs_input
Event field Use it for
typeStable discriminator: agent.message, turn.completed, tool.call, exec.completed, errors.
levelVisibility filter: user, progress, or internal.
seqMonotonic cursor for ordering and resume.
bodyTyped payload for that event.
actorWho produced the event: human, agent, or system.

Webhooks deliver committed events

Register a destination and user-level events are delivered at least once and retried. Deliveries are signed when the destination has a secret. The envelope includes the session metadata you set at create time.

Delivery envelope
{
  "type": "turn.completed",
  "sessionId": "ses_...",
  "eventId": "evt_...",
  "metadata": {
    "projectId": "proj_123",
    "taskId": "task_456"
  },
  "event": {
    "id": "evt_...",
    "seq": 12,
    "type": "turn.completed",
    "level": "user",
    "body": { "yield_reason": "completed" }
  }
}
Signed destination
const session = await oc.sessions.get("ses_...");

await session.destinations.create({
  url: "https://your.app/oc-webhook",
  secret: "whsec_...",
  level: "user",
  types: ["turn.completed"],
});

Dedupe on webhook-id. Verify the raw body with a Standard Webhooks library when a destination secret is set. A delivery succeeds on any HTTP 2xx.

The PR-review agent stores GitHub PR IDs in metadata. Completion webhooks carry them back, so the app can update the PR without a database, queue, or always-on worker.

The claude and codex runtimes use tools against the hands sandbox. The brain has no direct filesystem or shell; commands and file edits run through the hands tools.

Tool What it does
bashRun a shell command in the sandbox.
readRead a file from the sandbox.
writeWrite a file to the sandbox.
lsList a directory in the sandbox.
sayEmit a user-level message. The final say is the session result.
askAsk a question and yield with needs_input. Reply by steering.

For public repositories, put the repo URL and branch or commit in the task text. Prepared workspaces and private-repo access are coming soon.

How it works

Your app starts, streams, and steers a durable session. The managed runtime drives the agent loop, acts through the hands sandbox, and delivers user-level events to your webhook.

How Durable Agent Sessions connect the app, session event log, managed runtime, brain sandbox, hands sandbox, model provider, and webhook delivery.

Examples and docs

Docs explain the API. Repos show complete apps.