Skip to content

release: to prod#1485

Merged
joelorzet merged 12 commits into
prodfrom
staging
Jun 8, 2026
Merged

release: to prod#1485
joelorzet merged 12 commits into
prodfrom
staging

Conversation

@joelorzet

Copy link
Copy Markdown

No description provided.

joelorzet and others added 12 commits June 5, 2026 12:26
Step outputs that contain a BigInt (gas amounts, block numbers, token
values from web3 steps) crashed when drizzle-orm serialized them to a
JSONB column: PgJsonb.mapToDriverValue runs JSON.stringify, which throws
on BigInt. The redacted output column was already protected, but the
raw output_raw path (and step input) had no guard.

Add a shared toJsonSafe helper that recursively normalizes BigInt,
Uint8Array/Buffer, Map, Set, Date and circular refs to JSON-safe values,
and apply it to the input, output, output_raw and workflow output writes
at the persistence boundary so no non-serializable value can reach JSONB.

Also harden batch-read-contract: when a call has no ABI outputs it
returned the raw ethers Result (with BigInts) instead of serializing it.
Agents that need a transaction hash before continuing had to run their
own while(!terminal){sleep+GET} loop against the status endpoint, which
times out serverless workers.

Add GET /api/workflows/executions/{id}/wait?timeoutMs= that blocks until
the execution reaches a terminal state (or the timeout, capped at 60s)
and returns the receipt including transactionHashes, reusing the existing
waitForExecutionCompletion poller. Extract the shared auth + lookup +
access check into resolveAuthorizedExecution and route both the status
and wait endpoints through it.
KH_RELEASE_NAME was env-suffixed (keeperhub-staging / keeperhub-prod), so the rollout/teardown steps operated on ${KH_RELEASE_NAME}-common = keeperhub-staging-common / keeperhub-prod-common. No such ExternalSecret/Deployment exists; the main app release is keeperhub-common in namespace keeperhub. The rollout step failed NotFound and the vitest escape-matrix suite was skipped per deploy. Set KH_RELEASE_NAME to keeperhub so the resource resolves to keeperhub-common. Env-specific canary path / APP_URL stay keyed off the environment input. KEEP-648.
…x-rollout-step-keeperhub-env-common

ci: resolve escape-matrix rollout to keeperhub-common
The shared seen WeakSet was never cleared, so an object reachable via two
sibling paths was falsely serialized as [Circular] on its second visit.
Delete each node from the set once its subtree is done so only true
ancestor cycles are flagged. Add tests for shared refs and a sibling cycle.
…elper

The logs route carried its own auth + access copy that checked only
hasFullAccess, so a soft-deleted workflow still exposed its per-step
logs while the status endpoint hid them. Route it through
resolveAuthorizedExecution so all three execution endpoints enforce the
same soft-delete 404 rule, matching what the helper's docstring already
claims.
The wait route polled for completion and then re-read the same row to
pick up transactionHashes/gasUsedWei/completedAt, which the poller did
not surface. Have the poller select those columns and return the
last-seen row plus a completed flag (waitForExecutionReceipt), so the
route reads the receipt straight from the poll result. Removes one DB
round-trip per request. waitForExecutionCompletion keeps its exact
contract (null on timeout, no query when timeout <= 0).
The wait endpoint holds a connection and polls the execution row for up
to 60s; at 250ms that is ~240 queries per in-flight waiter. Raise the
default to 1s (~60 queries) to ease connection-pool pressure now that
the long-poll is a public endpoint. Worst-case completion-detection lag
grows by under a second, which is immaterial for both the 60s receipt
wait and the 25s x402 call wait that share this poller.
The runs API whitelist omitted "cancelled", so selecting the Cancelled
status filter dropped the param server-side and returned every run. Add
it to VALID_STATUSES; the query layer already filters it correctly.
…ialization

fix(executor): make step and workflow JSONB writes BigInt-safe
…-filter

fix(analytics): allow cancelled status filter on runs endpoint
feat(executions): add wait-for-receipt long-poll endpoint
@joelorzet joelorzet requested review from a team, OleksandrUA, eskp and suisuss and removed request for a team June 8, 2026 17:19
@joelorzet joelorzet merged commit e2d05d2 into prod Jun 8, 2026
25 checks passed
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.

2 participants