Skip to content

Standalone smoke test depends on a live relaycast backend, and its error path logs raw SQL with bound params #1562

Description

@khaliqgant

Summary

Two separate defects surfaced by the same CI failure on Package Validation / Standalone macOS Smoke today.

1. The standalone smoke test depends on a live relaycast backend, making a required check non-deterministic

scripts/ci-standalone-smoke.sh runs standalone up with no workspace key:

Workspace: none selected (no --workspace-key, no RELAY_WORKSPACE_KEY, no repository pin,
no active workspace in the machine-global store). A new workspace will be created.

Creating a workspace requires reaching the relaycast backend, so the test passes or fails on backend availability rather than on the code under test. Package Validation is a required check, so when the backend is unhealthy no PR in this repo can go green and the release workflow cannot complete.

Evidence it is non-deterministic rather than a code defect — two runs on the same commit of feat/relay-1387-delivery-observability, 63 seconds apart:

success   2026-08-17T14:47:32Z
failure   2026-08-17T14:48:35Z

Two different failure modes observed on the same run id (32040314356, PR #1551, head ef82fa59), on successive attempts:

Attempt 1 — handshake timeout:

[startup +5004ms]  handshake attempt 1/4 timed out after 5000ms; retrying in 250ms
[startup +10258ms] handshake attempt 2/4 timed out after 5000ms; retrying in 500ms
[startup +15765ms] handshake attempt 3/4 timed out after 5000ms; retrying in 1000ms
Error: relaycast startup handshake timed out after 4 attempt(s) of 5000ms each;
       the relay backend was unreachable or too slow to complete registration

Attempt 3 — workspace insert failure:

Error: failed to initialize relaycast session
Caused by:
Failed query: insert into "workspaces" (...) values (...)

Same dependency, two symptoms.

Worth deciding: should this smoke test provision against a live backend at all? A merge gate that is hostage to an external service's health reports "your code is broken" during someone else's outage. If the standalone lifecycle genuinely needs a workspace, a hermetic or pre-seeded one would keep the check meaningful.

2. The error path dumps raw SQL and bound parameters into the log

The attempt-3 failure printed the full INSERT statement together with its bound parameters, including the workspace api_key_hash:

Failed query: insert into "workspaces" ("id", "name", "api_key_hash", "system_prompt",
"plan", "created_at", "metadata", "retention") values (?, ?, ?, null, ?, (unixepoch()), ?, null)
returning ...
params: <workspace id>,<workspace name>,<api_key_hash>,free,{}

In this instance it is an ephemeral throwaway CI workspace, so the practical exposure is low. The defect is that the error boundary is missing, not that this particular value mattered — the same handler runs wherever workspace creation can fail, and a CI log is not a private surface.

The fix is to stop rendering the query and params in the surfaced error. Redacting only api_key_hash would relocate the problem rather than close it; an allowlist of safe diagnostic fields is the durable shape.

Impact

Blocked today: relay #1551, #1556, and the 11.6.11 publish (which failed on Verify Standalone (macOS) — same workflow, same path).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions