Skip to content

[codex] Structure server environment-label probe failures - #3321

Merged
juliusmarminge merged 2 commits into
mainfrom
codex/structure-server-environment-label-errors
Jun 20, 2026
Merged

[codex] Structure server environment-label probe failures#3321
juliusmarminge merged 2 commits into
mainfrom
codex/structure-server-environment-label-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • represent machine-info probe failures with operation, path, and the exact underlying cause
  • represent friendly-label command failures with command, arguments, and the exact process failure
  • retain best-effort hostname fallback behavior while emitting structured debug diagnostics
  • verify filesystem and process error chains with external-service test layers

Validation

  • vp test apps/server/src/environment/ServerEnvironmentLabel.test.ts
  • vp check (passes with 20 pre-existing warnings)
  • vp run typecheck

Note

Low Risk
Observability-only change in server startup label resolution; public return values and fallback order are unchanged.

Overview
Replaces silent handling of /etc/machine-info and friendly-label command (scutil, hostnamectl) failures with typed tagged errors and debug logs annotated with path, probe, executable, and cause chains, while hostname / cwd fallback behavior stays the same.

Adds ServerEnvironmentLabelFileError and ServerEnvironmentLabelCommandError; command failures record argument count only (not argv) so sensitive values do not appear in logs. Tests now assert debug messages and full error chains when probes fail, including Linux continuing to hostnamectl after a machine-info inspect error.

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

Note

Structure environment-label probe failures as typed errors with debug logging

  • Adds ServerEnvironmentLabelFileError and ServerEnvironmentLabelCommandError tagged error classes in ServerEnvironmentLabel.ts to wrap failures from file inspection/read and command execution respectively.
  • Errors are now logged at debug level with structured annotations (probe, executable, path, cause) before being suppressed, replacing the previous silent orElseSucceed suppression.
  • Updates ServerEnvironmentLabel.test.ts with tests asserting the new structured error types and captured log annotations on probe failures.

Macroscope summarized 2ee5fac.

@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: 2ccb8f01-45ff-4d05-a32d-7d74c9fdf580

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/structure-server-environment-label-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:M 30-99 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

This PR adds structured error types and debug logging for environment-label probe failures without changing runtime behavior - probes still fail gracefully and fall back to hostname. The changes improve observability and type safety with comprehensive test coverage.

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

@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 17:02

Dismissing prior approval to re-evaluate b5d7546

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
juliusmarminge and others added 2 commits June 20, 2026 12:31
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the codex/structure-server-environment-label-errors branch from b5d7546 to 2ee5fac Compare June 20, 2026 19:32
@macroscopeapp
macroscopeapp Bot dismissed their stale review June 20, 2026 19:32

Dismissing prior approval to re-evaluate 2ee5fac

@juliusmarminge
juliusmarminge merged commit a51691a into main Jun 20, 2026
16 checks passed
@juliusmarminge
juliusmarminge deleted the codex/structure-server-environment-label-errors branch June 20, 2026 22:13
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