Repository navigation
perf: agent SDK snapshot wiring + bench harness + preview secure-exec dep - #1527
Merged
NathanFlurry merged 3 commits intoJun 25, 2026
Conversation
Member
Author
|
Stack for rivet-dev/agentos
Get stack: |
NathanFlurry
force-pushed
the
stack/perf-agent-sdk-snapshot-wiring-bench-harness-preview-secure-exec-dep-uusymyzz
branch
from
June 25, 2026 01:51
cb6b5d8 to
390511a
Compare
esbuild bundles the lean pi-SDK graph (the 13 exports loadPiSdkRuntime needs) into a single IIFE, dist/pi-sdk-snapshot.js, that publishes globalThis.__PI_SDK_RUNTIME__. - src/snapshot-entry.ts: imports the SDK exports, assigns the runtime global. - scripts/build-snapshot-bundle.mjs: format:iife, platform:node (node builtins external), deep-import plugin to bypass the package exports map (avoids the ~100MB TUI graph the adapter skips), provider SDKs kept lazy/external, sha256 sidecar for dep-keying. C0 mitigations baked in: import.meta.url pinned to projected guest path; clipboard native-addon require made unreachable (DISPLAY=''). - package.json build chains build:snapshot; tsconfig excludes the esbuild-only entry. Validated (host, CJS harness): 13/13 exports populate, ~201ms eval, 880 modules inlined, 7.6MB. Traced top-level fs footprint = 2 deterministic package.json reads only (no net/ sockets/timers/native addons/per-session config). Artifact (dist) is gitignored. Step 2a of the agent-SDK snapshot goal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…flag + docs Foreign fix (the last 2d blocker): build-snapshot-bundle.mjs snapshotSafePlugin now also lazy-inits pi-tui/dist/utils.js's module-level `new Intl.Segmenter` (an ICU-backed native External that V8 SnapshotCreator can't serialize) behind a Proxy — created on first use post-restore, not at module-init. With this, the real full pi SDK bundle snapshots cleanly and restores with createAgentSession/createAllTools intact (secure-exec Part 22 = ok). Also adds: config.js package.json inline, env-api-keys sync-require, and the PI_SNAPSHOT_ENTRY/OUTFILE/STUB_MODULES bisection overrides used to find it. Flag: agent.snapshot?: boolean on AgentSoftwareDescriptor (default false, opt-in, automatic fallback to per-session dynamic-import for SDKs that aren't snapshot-safe or fail to snapshot). Docs: agent.snapshot field + 'SDK snapshotting & snapshot-safety' rules in custom-software/definition.mdx. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… dep - Pin @secure-exec/* to the secure-exec preview (npm); @agentos-software/* preserved. - Clone-at-pinned-version cargo build mechanism (prepare-build) — crates.io has no preview track; clone secure-exec at the pinned sha and build cargo local for previews. Wired into publish.yaml + darwin.Dockerfile; documented in CLAUDE.md. - Rust client: add snapshot_userland_code: None to JsRuntimeConfig initializer. - Bundle transform hardening: env-api-keys transform asserts exactly 3 eager imports (loud fail on drift); pin @mariozechner/* exactly (direct + overrides). - JS-layer session benchmark + baseline gate + vm-vs-node phase traces. - Agent SDK snapshot opt-in (pi), MinimalResourceLoader fast path, architecture doc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
NathanFlurry
force-pushed
the
stack/perf-2c-safety-pi-tui-intl-segmenter-foreign-fix-snapshot-opt-in-flag-docs-lzvqqnps
branch
from
June 25, 2026 08:11
6592029 to
c72bf59
Compare
NathanFlurry
force-pushed
the
stack/perf-agent-sdk-snapshot-wiring-bench-harness-preview-secure-exec-dep-uusymyzz
branch
from
June 25, 2026 08:11
390511a to
8e92a53
Compare
NathanFlurry
changed the base branch from
stack/perf-2c-safety-pi-tui-intl-segmenter-foreign-fix-snapshot-opt-in-flag-docs-lzvqqnps
to
main
June 25, 2026 08:12
NathanFlurry
deleted the
stack/perf-agent-sdk-snapshot-wiring-bench-harness-preview-secure-exec-dep-uusymyzz
branch
June 25, 2026 08:12
railway-app
Bot
requested a deployment
to
rivet-frontend / secure-exec-pr-122
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / secure-exec-pr-124
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / rivet-pr-5328
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / secure-exec-pr-123
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / rivet-pr-5324
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / secure-exec-pr-112
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / rivet-pr-5320
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / rivet-pr-5314
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / secure-exec-pr-121
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / secure-exec-pr-126
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / secure-exec-pr-111
June 25, 2026 08:12
In progress
railway-app
Bot
requested a deployment
to
rivet-frontend / secure-exec-pr-119
June 25, 2026 08:12
In progress
This branch is being deployed
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.
preview track; clone secure-exec at the pinned sha and build cargo local for
previews. Wired into publish.yaml + darwin.Dockerfile; documented in CLAUDE.md.
imports (loud fail on drift); pin @mariozechner/* exactly (direct + overrides).