Cut cold-read latency and probe storms; instrument isolate residency - #2030
Draft
RhysSullivan wants to merge 6 commits into
Draft
RhysSullivan wants to merge 6 commits into
RhysSullivan wants to merge 6 commits into
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 0265b4f | Sep 16 2026, 06:36 PM |
Contributor
Cloudflare preview
Sign-in is Cloudflare Access (one-time PIN to an allowed email). The preview has its own database and encryption key; it is destroyed when this PR closes. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 0265b4f | Commit Preview URL Branch Preview URL |
Sep 16 2026, 06:36 PM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
…lth-probe memory by identity Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…icts under the probe floor Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…status Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…tence inference Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Production traces (Axiom, Cloudflare analytics, PostHog, 24h) put the console's slow reads on a few specific causes. This PR fixes the ones that are code, and adds instrumentation for the one that is not yet explained.
Latency fixes
packages/core/sdk). Every remote-catalog connection expired on the same 15-minute clock, so a read that tripped the TTL paid onetools/listhandshake per connection (p50 2.2s onGET /api/tools; p50 380ms when no sync fired). Expiry is a guess, not a signal: expired catalogs now re-list behind the read (stale-while-revalidate), while stale-marked and config-revised rebuilds are still awaited within the grace budget.toolsSyncGraceMs: nullkeeps strict mode. New span attributes:executor.tools.sync_awaited,executor.tools.sync_deferred,executor.tools.sync_trigger.DbServiceShape.keepAliveretains the detached work; the scope finalizer handssql.endto the platformwaitUntilafter every retained promise settles, including ones registered while earlier ones were settling.makeScopedExecutorfolds the handle'skeepAliveintoExecutorConfig.waitUntil. Long-lived-driver hosts are unaffected.apps/cloud/src/auth/jwks-cache.ts). The Workers Cache API read measured p50 1.4s / p90 2.8s on cold isolates while the upstream fetch measured p50 26ms; the store was read first, so every cold verify paid ~1.5s. Whichever answers first wins; the store still covers a slow or dead key server.apps/cloud/src/server.ts). They were dispatched through the app plane and paid its first evaluation on cold isolates (p95 5.0s cold vs 0ms warm).listOrgMembersonce instead of twice; per-membergetUserfan-out raised from 5 to 20. AlistOrgMembersfailure still surfaces as anAccountError; an Autumn or invitations failure or defect still only degrades seats.packages/react). One session was posting/healthonce per second per connection for hours (12k/day per connection). A module-scope memory keyed by user, org, and connection with a 30s floor now survives remounts. A reconnect that clears the server verdict still probes, whether it lands while mounted or not, and suppression is bounded by an in-mount retry timer rather than by the next remount.Trace volume
mcp.host.register_tool(1.5M spans/day, always 0ms),mcp.host.register_resource,mcp.host.register_search_invoke, andmcp.request.read_json_rpc(460k/day, 0ms).mcp.namespace_search.countmoved onto the enclosing span.Instrumentation for the memory kills
The Worker is killed for
exceededMemory~24k times/day, taking every co-resident MCP session down with it.McpSessionDO.initreports resident runtimes up to 139 against a soft cap of 32, and the cap cannot evict a session with an open stream. New on every residency span:mcp.isolate.resident_evictable,resident_pinned,resident_streaming,resident_eviction_pending,in_flight_cold_builds. New unsampled log linemcp_isolate_cap_overflowwhenever an init finds nothing evictable, with the same breakdown.Review
Six Codex review passes. Findings fixed in follow-up commits: deferred-rebuild socket lifetime (including late registrations), JWKS blocking-fetch count on the failure path, seat defect fallback in
listMembers, health memory partitioned by identity, reconnect-clear detection while unmounted, and bounded floor suppression that survives effect reruns. Final verdict: ready on correctness.Verification
db,account,jwks-cache,api.request-scope,mcp/*,app-paths: 170 tests), core sdk (executor,connections,health-check: 113), core apiserver(10), plugin-mcpcatalog-sync(9), host-mcptool-server(61), cloudflareagent-session-durable-object(51), reactuse-connection-health(20).🤖 Generated with Claude Code