Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ndjson-output-arrays.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@executor-js/plugin-openapi": patch
---

Advertise NDJSON operation outputs as arrays. Endpoints declaring `application/stream+json`, `application/x-ndjson`, or `application/jsonl` responses (for example Vercel's runtime-logs) spec the schema of one line, but invocations return an array of parsed lines; describe previews now wrap the line schema in an array so generated code matches what actually comes back. Existing integrations with NDJSON operations are stale-marked once so their tool catalogs rebuild with the corrected schemas.
23 changes: 23 additions & 0 deletions apps/cloud/drizzle/0010_ndjson_output_arrays.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- Extraction used to persist an NDJSON operation's PER-LINE response schema
-- as the tool's output schema, while the invoke path returns an ARRAY of
-- parsed lines, so describe previews promised a single object invocations
-- never returned. The producer now wraps those schemas in an array. Persisted
-- `tool` rows can't be recognized as NDJSON-derived from their schema alone,
-- but the stored operation bindings kept the response content type, so the
-- affected connections are findable: stale-mark `tools_synced_at` and the
-- next read rebuilds their tool rows through the fixed producer.
--
-- Effectively idempotent: re-running re-marks the same connections, and a
-- rebuild from unchanged bindings writes identical rows.
UPDATE "connection" c
SET "tools_synced_at" = NULL
FROM (
SELECT DISTINCT ps."tenant", ps."data"::jsonb ->> 'integration' AS integration
FROM "plugin_storage" ps
WHERE ps."collection" = 'operation'
AND (ps."data"::text LIKE '%application/stream+json%'
OR ps."data"::text LIKE '%application/x-ndjson%'
OR ps."data"::text LIKE '%application/jsonl%')
) ndjson
WHERE c."tenant" = ndjson."tenant"
AND c."integration" = ndjson."integration";
Loading
Loading