[codex] structure server secret store errors#3243
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR refactors error types in the secret store to provide more structured diagnostic information (specific field names, reason codes, operation context). The changes are mechanical restructuring of error classes and handlers without altering runtime behavior beyond error reporting. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
a92067e to
93072ff
Compare
47c0424 to
8090110
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
7d654e4
into
codex/server-auth-error-boundaries
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Summary
Stack
Validation
Note
Medium Risk
Touches secret persistence and cloud link/auth HTTP surfaces with breaking error shapes for in-process matchers, though wire decoding stays compatible with legacy payloads.
Overview
This PR reshapes failure reporting across the environment server’s secret store, cloud HTTP layer, and shared HTTP contracts.
ServerSecretStoredrops genericresourcestrings in favor of structured fields (secretName,secretPath,operation,byteCount,directoryPath). Directory init failures are explicit tagged errors; each store method’s Effect error union is narrowed. Concurrent-create recovery usesEffect.catchTagsinstead of broadisSecretStoreErrorchecks.Environment HTTP errors in
@t3tools/contractsgain stablereason/operation(and relayrelayOperation/relayPhase) codes with centralized user-facing messages. Wire encoding omits internalcause; decoders still accept legacy message-only bodies for rolling deploys.Cloud relay calls map client failures to
CloudRelayRequestError(phase, redacted URL diagnostics, no secrets in messages). Internal 500s logcauseTagonly; clients see stable relay failure text. Unauthorized link flows usecloud_cli_authorization_required(mobile test updated accordingly).Reviewed by Cursor Bugbot for commit 050fbe6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure server secret store and HTTP environment errors with typed, contextual fields
ServerSecretStoreerror classes in ServerSecretStore.ts to carry structured fields (e.g.secretName,secretPath,operation,cause) instead of plain messages, and narrows per-method error union types.generate_link_proof,persist_relay_configuration) and redact sensitive details from logs and response bodies.CloudRelayRequestErrorandCloudRelayConfigurationErrorfor relay-specific failures, classifying errors by phase (encode/send/status/decode) with sanitized URL diagnostics.Macroscope summarized 050fbe6.