Skip to content

Advertise NDJSON operation outputs as arrays#1389

Merged
RhysSullivan merged 2 commits into
mainfrom
ndjson-output-arrays
Jul 10, 2026
Merged

Advertise NDJSON operation outputs as arrays#1389
RhysSullivan merged 2 commits into
mainfrom
ndjson-output-arrays

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

NDJSON endpoints (application/stream+json, x-ndjson, jsonl) declare the schema of one line, but invocations return an array of parsed lines. The advertised output schema now wraps the line schema in an array, so describe previews match what actually comes back. Existing integrations with NDJSON operations get stale-marked once (sqlite ledger + drizzle 0010) so their catalogs rebuild with the corrected schemas.

New cross-target e2e scenario (openapi-ndjson-output.test.ts) pins the contract end to end: register an NDJSON spec, compare the advertised type from tools.schema / describe.tool against a live invocation. Green on cloud and selfhost.

NDJSON endpoints (application/stream+json, x-ndjson, jsonl) declare the
schema of one line, but the invoke path collects the stream and returns an
array of parsed lines. Extraction stored the per-line schema unwrapped, so
describe previews promised a single object that invocations never returned,
pushing agents into runtime shape-probing (seen with Vercel getRuntimeLogs).

Wrap the stored output schema in an array (with the truncation and raw-text
caveats in its description) on both serve paths, share one NDJSON media-type
set between extraction and invocation, and stale-mark affected connections
via data migrations (sqlite ledger + cloud drizzle 0010) so existing
catalogs rebuild with the corrected schemas.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 6949919 Commit Preview URL

Branch Preview URL
Jul 10 2026, 05:41 AM

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 6949919 Jul 10 2026, 05:42 AM

@RhysSullivan RhysSullivan marked this pull request as ready for review July 10, 2026 05:43
@RhysSullivan RhysSullivan merged commit 9e38928 into main Jul 10, 2026
20 checks passed
@RhysSullivan RhysSullivan mentioned this pull request Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant