Skip to content

[codex] Preserve managed endpoint failure diagnostics#3366

Open
juliusmarminge wants to merge 1 commit into
mainfrom
codex/preserve-managed-endpoint-diagnostics
Open

[codex] Preserve managed endpoint failure diagnostics#3366
juliusmarminge wants to merge 1 commit into
mainfrom
codex/preserve-managed-endpoint-diagnostics

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • decode persisted managed-endpoint configuration through a structured schema error that retains the parser cause and secret resource
  • retain active relay-process probe and shutdown causes with PID/tunnel context while preserving best-effort reconciliation
  • keep spawn failure presentation stable instead of deriving the user-facing reason from an internal cause

Verification

  • vp test apps/server/src/cloud/ManagedEndpointRuntime.test.ts (9 passed)
  • vp check (passes with 20 pre-existing warnings)
  • vp run typecheck

Overlap audit

No active PR touches the three changed files (gh pr list --state open --limit 1000).


Note

Medium Risk
Touches cloud relay process lifecycle (probe, stop, restart, and config load); behavior is mostly logging and stable error text, but failed probes now trigger restarts.

Overview
Improves observability and recovery for the cloud managed relay (cloudflared) runtime without changing the outward reconciliation behavior.

Persisted endpoint config is decoded via decodeUnknownEffect and failures are wrapped in CloudManagedEndpointRuntimeConfigDecodeError, keeping the secret resource id and underlying parser cause for logs instead of dropping decode errors silently.

When reconciling an already-running connector, isRunning probe failures are logged with PID/tunnel context and treated as not running so the connector can restart; stop failures are logged as warnings rather than swallowed. User-visible spawn failures now use the stable message "Failed to start the relay client." instead of exposing internal cause strings.

Tests cover failed process probes, malformed persisted config diagnostics, and the fixed spawn-failure reason.

Reviewed by Cursor Bugbot for commit cb4ff22. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Preserve managed endpoint failure diagnostics with structured errors and warning logs

  • Introduces CloudManagedEndpointRuntimeConfigDecodeError in ManagedEndpointRuntime.ts, a tagged error class emitted when persisted runtime config decoding fails, replacing silent null returns.
  • Logs structured warnings (with cause, pid, tunnelId, tunnelName) for three previously silent failure paths: stop-connector failures, active-process probe failures, and config decode failures during initialization.
  • Fixes the failed-start status reason to use the stable string 'Failed to start the relay client.' instead of String(cause), which varied by error type.
  • Active-process probe failures now trigger a restart (treats process as not running) rather than reporting the connector as running.
  • Switches decodeRuntimeConfig in config.ts from Schema.decodeUnknownOption to Schema.decodeUnknownEffect so decode errors propagate as failures instead of being silently dropped.

Macroscope summarized cb4ff22.

Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Jun 20, 2026
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c4e8b71f-6627-4449-9fcc-cea9146a4a0c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/preserve-managed-endpoint-diagnostics

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Changes are limited to error handling paths - replacing silent failures with warning logs that include diagnostic context. Success path behavior is unchanged, and the modifications are well-covered by new tests.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant