Serve runtime-observed output shapes for schemaless tools - #1759
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 9f8f477 | Commit Preview URL Branch Preview URL |
Aug 27 2026, 12:27 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 9f8f477 | Aug 27 2026, 12:28 AM |
Contributor
Cloudflare previewTorn down — the PR is closed. |
@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: |
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.
Muscle memory for code mode: most tools declare no output schema, so
tools.describe.tool()rendersdata: unknownand models guess response shapes (or dump whole payloads). This learns shapes from live responses and serves them where nothing was declared.Learn —
executor.executefolds every successful dynamic-tool payload into a bounded inferred shape (packages/core/sdk/src/shape-inference.ts): field names and broad types only, never values; wide objects collapse toadditionalPropertiesso data-bearing keys (emails, ids) never persist; depth/width/union/size all capped. Merging across calls makes missing fields optional and unions divergent types.Store —
plugin_storageunder a reserved system id (executor.shape-memory): already migrated in every host, tenant/owner-scoped, and untouched by catalog refresh (which wipestoolrows). In-memory read-through cache per executor; a row write happens only when a new observation changes the merged shape, so stable APIs converge to zero writes.Serve —
tools.schemasubstitutes the observed shape only when neither the catalog row norprojectToolSchemadeclares an output schema, rendered through the existing JSON-Schema→TS compiler.ToolSchemaViewgainsoutputSchemaSource: "observed"+outputSchemaObservations, anddescribe.tooladdsoutputTypeScriptNotetelling the model the fields are reliable but possibly incomplete (the compact TS render drops schema descriptions). The execute skill text documents the note.Evidence — new e2e scenario
shape-memory.test.tspasses on selfhost and cloud: schemaless OpenAPI tool describes asdata: unknown, one live call teaches{ issues: { id: number; title: string; open: boolean; }[]; total: number; }, next describe serves it with the provenance note. The cloud pass spans three separate HTTP requests, so it proves the cross-session persistence path, not just the in-memory cache. Unit: 14 inference tests, 2 executor integration tests, 1 invoker cold→warm test.Out of scope (follow-ups) — MCP tools: the MCP plugin always synthesizes a CallToolResult envelope schema, so its generic
structuredContentslot needs an envelope-aware splice in the MCP plugin's projection. Search results still carry no type signatures (separate change on theToolrow). No TTL on observed shapes: continued use keeps them fresh; an unused tool's shape can go stale after an upstream API change.