Skip to content

[codex] Structure Tailscale command failures#3257

Merged
juliusmarminge merged 3 commits into
mainfrom
codex/tailscale-command-errors
Jun 20, 2026
Merged

[codex] Structure Tailscale command failures#3257
juliusmarminge merged 3 commits into
mainfrom
codex/tailscale-command-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the generic Tailscale command error with distinct Schema errors for spawn, output, exit, and timeout failures
  • preserve exact process and timeout causes with tagged catch semantics
  • retain only fixed executable/subcommand identity, argument count, exit code, timeout, and output lengths so auth keys and command output cannot enter direct error fields or messages

Validation

  • vp test packages/tailscale/src/tailscale.test.ts (12 tests)
  • vp check
  • vp run typecheck

Note

Structure Tailscale command failures into typed error classes with sanitized context

  • Replaces the generic TailscaleCommandError helper with four distinct Schema.TaggedErrorClass types: TailscaleCommandSpawnError, TailscaleCommandOutputError, TailscaleCommandExitError, and TailscaleCommandTimeoutError, each carrying structured context (executable, subcommand, argument count, and relevant metrics).
  • Exit errors expose only stdoutLength/stderrLength instead of raw stdio content, and timeout errors include timeoutMs derived from the Duration input.
  • TailscaleStatusParseError is also migrated to Schema.TaggedErrorClass with a fixed message and a Defect cause, avoiding raw error text in the message.
  • Behavioral Change: error messages and types surfaced by readTailscaleStatus, ensureTailscaleServe, and disableTailscaleServe all change; callers relying on the previous error shape or message strings will break.

Macroscope summarized 1db0e32.

Co-authored-by: codex <codex@users.noreply.github.com>
@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: a8d2787c-dbc8-4318-8b51-4e09a5ac0562

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/tailscale-command-errors

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Refactor that restructures Tailscale command error types into specific classes while keeping identical control flow. Includes security improvement by excluding sensitive data (stderr, auth tokens) from error messages. Well-tested with comprehensive new test cases.

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

Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 14:49

Dismissing prior approval to re-evaluate 311e609

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 16:24

Dismissing prior approval to re-evaluate 1db0e32

@juliusmarminge
juliusmarminge merged commit d2e38c5 into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/tailscale-command-errors branch June 20, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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