Feat/agent runtime local cloud orchestration - #467
Open
Unclebaffa wants to merge 2 commits into
Open
Conversation
Unclebaffa
force-pushed
the
feat/agent-runtime-local-cloud-orchestration
branch
5 times, most recently
from
July 26, 2026 10:19
0dd7418 to
6fa18be
Compare
Bumps [resend](https://github.com/resend/resend-node) from 6.17.1 to 6.17.2. - [Release notes](https://github.com/resend/resend-node/releases) - [Changelog](https://github.com/resend/resend-node/blob/canary/CHANGELOG.md) - [Commits](resend/resend-node@v6.17.1...v6.17.2) --- updated-dependencies: - dependency-name: resend dependency-version: 6.17.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Unclebaffa
force-pushed
the
feat/agent-runtime-local-cloud-orchestration
branch
from
July 26, 2026 10:41
6fa18be to
d42d9c0
Compare
|
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.




Implementation Summary: [EPIC] Agent Runtime — Local Lightweight Agents + Cloud Orchestration
Executive Overview
We implemented the real backend Agent Runtime for Open-Stellar, transforming agents from static UI state into real, executable TypeScript actors capable of receiving tasks, executing custom handlers, emitting lifecycle events, passing messages, persisting state across server restarts, and deploying locally via CLI or to serverless edge platforms (Vercel Edge Functions).
🚀 Key Features Implemented
1. TypeScript Agent SDK & Lifecycle Hooks
lib/agent-runtime/sdk.ts): Created the high-levelAgentSDKclass andcreateAgent()builder function allowing developer-friendly agent creation.lib/agent-runtime/agent.ts): Implemented event hooks for full agent lifecycle management:onStart: Triggered when agent process starts running.onStop: Triggered when agent shuts down cleanly.onTask: Custom task handler for receiving and processing incoming tasks.onMessage: Handles inter-agent communication messages.onError: Intercepts runtime task execution errors.onStateChange: Monitors agent state transitions (idlerunningworkingstopped/degraded).2. Local CLI Tool (
bin/open-stellar.js)open-stellar): Built a Node CLI executable with permissions (#!/usr/bin/env node) registered inpackage.jsonunder"bin": { "open-stellar": "./bin/open-stellar.js" }.npx open-stellar agent start --name <Name> --district <District>: Instantiates an agent, registers its metadata, updates status toactive, and persists state to disk.npx open-stellar agent list: Displays registered and persisted agents formatted in an ASCII table.npx open-stellar agent task --id <AgentID> --title <TaskTitle>: Dispatches tasks directly to active agents via CLI.3. State Persistence (
lib/agent-runtime/persistence.ts).data/agent-state.json): Implemented safe local state persistence for agents and their runtime metrics.eval("require")checks to ensure serverless Edge Function bundles (such as/api/og/agent/[id]) compile cleanly without bundling native filesystem modules (node:fs,node:path).4. Cloud & Serverless Deployments (
lib/agent-runtime/cloud-deploy.ts)createServerlessAgentHandler()(for standard Node.js serverless functions) andcreateEdgeAgentHandler()(for Vercel Edge Runtime / Cloudflare Workers).POST /api/agents/:id/taskand returning JSON task results.5. Canvas & UI Dynamic Hydration (
lib/data.ts)createAgents()inlib/data.tsto dynamically merge persisted and CLI-started agents into the frontend canvas state, ensuring agents started via CLI instantly appear on the canvas and interactive UI.6. Store File Locking Reliability Fixes
copyFileSync): Updatedlib/protocols/x402-receipt-store.ts,lib/agents/agent-error-store.ts, andlib/agent-runtime/persistence.tswithcopyFileSyncandunlinkSyncfallback handling. This eliminates WindowsEPERMfile locking errors when running parallel tests or background file updates.🧪 Comprehensive Testing & Verification
Unit Test Suites Created
__tests__/agent-runtime/sdk.test.ts: Validates agent creation, task execution, lifecycle hooks (onStart,onStop,onError), and metrics tracking.__tests__/agent-runtime/persistence.test.ts: Verifies JSON state persistence, empty file recovery, and agent state upserts.__tests__/agent-runtime/cli.test.ts: End-to-end testing ofopen-stellar agent startandopen-stellar agent listprocess execution.Full Test Suite Results (
npx vitest run)🛡️ Code Quality & Build Checks
npm run lintnpx tsc --noEmitnpm run secretlintnpx prettier --checknpm run build📦 Git Branch & Remote Sync
feat/agent-runtime-local-cloud-orchestrationorigin/feat/agent-runtime-local-cloud-orchestration.Closes #17