Skip to content

fix(runtime): clarify successful startup diagnostics - #1511

Merged
skevetter merged 1 commit into
mainfrom
codex/microsandbox-startup-diagnostics
Oct 16, 2026
Merged

skevetter merged 1 commit into
mainfrom
codex/microsandbox-startup-diagnostics

Conversation

@skevetter

@skevetter skevetter commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

A successful MicroSandbox workspace startup logged routine helper shutdown as gRPC Unavailable/EOF, normal pipe cleanup as context canceled, and planned post-start agent delivery as a skipped or failed pre-start attempt. These messages made a healthy launch appear broken.

Routine go-plugin lifecycle output is now available at trace level while runtime stderr, redaction, framework warnings/errors and unexpected exits remain preserved. Successful pipe bridges use a plain completion message; real tunnel/handler failures and parent cancellation retain their diagnostics. Agent delivery selects its phase before preparing pre-start options and distinguishes planned post-start delivery from actual nonfatal fallback failures. Return values and cleanup ownership are preserved.

Validation:

  • Relevant full package race tests, vet, Windows test compilation, module verification, Linux CI lint and scoped pre-commit checks passed. Regression checks reproduce the previous misleading-success behavior.
  • All 90 implementation CI jobs passed, including 80 actual Linux native cases across 16 MicroSandbox suites, 84 dynamically discovered Windows provider-update tests, both helper unit packages and six Windows WSL BuildKit cases. The current warm performance artifact contains 808 reaped launches. Desktop work was correctly filtered for this Go-only change.
  • Fresh Greptile scored 5/5. Completed full CodeRabbit review covered all seven files with no actionable findings, Minimal merge risk and Low security architecture risk. The advisory docstring metric and preparation-error-content observation have documented source dispositions. Local CodeRabbit's unavailable service-start gate remains temporarily waived by the user.

Fixes #1510

@netlify

netlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit ca8f5f1
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ad287623e1d3405f3aa776f

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9aed4bbf-2037-4978-b93f-917e5c74dcae
📥 Commits

Reviewing files that changed from the base of the PR and between 2a9f58e and ca8f5f1.

📒 Files selected for processing: 7
  • pkg/devcontainer/single.go
  • pkg/devcontainer/single_delivery_test.go
  • pkg/driver/external/internal/testfixture/main.go
  • pkg/driver/external/session.go
  • pkg/driver/external/session_logging_test.go
  • pkg/tunnel/pipebridge.go
  • pkg/tunnel/pipebridge_test.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

📝 Walkthrough

The changes update pre-start delivery phase handling, external runtime framework log levels, and pipe-bridge completion logging. Tests cover planned delivery, runtime diagnostics, successful completion, failures, and cancellation.

Changes: Startup diagnostics

Layer / File(s) Summary
Pre-start delivery diagnostics
pkg/devcontainer/single.go, pkg/devcontainer/single_delivery_test.go
The caller checks the selected strategy phase and passes the strategy to pre-start delivery. Preparation and delivery failures are logged with post-start fallback. Tests check planned post-start delivery and preparation failure logs.
External runtime logging
pkg/driver/external/session.go, pkg/driver/external/internal/testfixture/main.go, pkg/driver/external/session_logging_test.go
Framework logs use warning level by default and trace level when the application log level is trace. The fixture can write a startup diagnostic to stderr. Tests check startup, lifecycle, and unexpected-exit diagnostics.
Pipe-bridge completion diagnostics
pkg/tunnel/pipebridge.go, pkg/tunnel/pipebridge_test.go
RunPair classifies errors before logging and returning. Tests check successful completion, error details and identity, and cancellation behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to ca8f5

The supplied evidence identifies no issue that needs correction before merge. Complete the required current-head CI and remote review checks.

Security architecture risk: 🔵 Low · up to ca8f5

Existing delivery authority, cleanup, and tunnel error handling are preserved. No introduced security weakness was established. Some uncertainty remains around the contents of newly logged preparation errors.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected changes affect existing workspace-startup and diagnostic paths rather than adding an execution entrypoint or credential authority. Diagnostic output continues through the existing stderr and additional-sink logging paths.

Trust Boundaries and Controls

  • observed — External-runtime framework output and raw stderr share a mutex-protected streaming redactor before reaching the diagnostic sink. The new regression source asserts that a startup token is redacted and that unexpected helper exits remain visible at debug level; this is not a guarantee of visibility at normal warning-level logging.

Resilience and Maintainability Implications

  • observed — Failure-containment ownership is preserved: bridge cancellation and writer closure remain guarded by sync.Once, callers retain bridge cleanup, and delivery teardown remains independently dispatched to the selected strategy.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed The changes satisfy the coding requirements in issue #1510. Host.call keeps routine go-plugin lifecycle output at warning level and exposes it at trace level. The diagnostic writer still preserves r…
Out of Scope Changes check Passed The seven changed files remain within issue #1510. The fixture change provides controlled stderr and exit behavior for external-runtime logging tests. The test changes verify the requested success and…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the runtime diagnostic improvements, including successful startup and lifecycle logging. It does not mention pipe-bridge completion or delivery phase changes, but it remain…
Full details: Linked Issues check

Explanation

The changes satisfy the coding requirements in issue #1510. Host.call keeps routine go-plugin lifecycle output at warning level and exposes it at trace level. The diagnostic writer still preserves runtime stderr and redaction. RunPair reports plain success only for classified shutdown or success cases and retains failure and cancellation details. Agent delivery selects the phase before preparing options, logs planned post-start delivery as normal, and logs pre-start preparation or delivery failures with post-start fallback. The added tests cover helper diagnostics, redaction, unexpected exit, pipe-bridge outcomes, and delivery outcomes. The supplied validation reports that these regressions fail against the original implementation.

Full details: Out of Scope Changes check

Explanation

The seven changed files remain within issue #1510. The fixture change provides controlled stderr and exit behavior for external-runtime logging tests. The test changes verify the requested success and failure diagnostics. The production changes address external-runtime logging, pipe-bridge logging, and agent-delivery phase handling. No unrelated feature, configuration, provider, or ownership change is shown in the supplied change summary.

Full details: Title check

Explanation

The title clearly describes the runtime diagnostic improvements, including successful startup and lifecycle logging. It does not mention pipe-bridge completion or delivery phase changes, but it remains specific and related to the pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@netlify

netlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit ca8f5f1
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ad28762bf7f01e9d325b47e

@skevetter

Copy link
Copy Markdown
Contributor Author

@greptileai review

Please review the complete current head ca8f5f1. All implementation/external checks are green. Inspect all seven files, including whether real runtime stderr, redaction, unexpected exits, raw tunnel failures and nonfatal delivery fallbacks remain visible while routine success diagnostics become clear. Preserve existing return values and lifecycle/cleanup ownership. Use included free allowance only.

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Clarifies successful startup diagnostics without changing returned errors or cleanup ownership.

  • Routine helper shutdown messages stay out of debug logs.
  • Successful pipe bridges get a plain completion message.
  • Agent delivery logs show whether post-start delivery is planned.

Reviews (1) · Last reviewed commit: "fix(runtime): clarify successful startup..." · Reviewed by Greptile

@skevetter

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

Please review the entire exact current head ca8f5f1 while this PR remains draft, covering every one of its seven changed files:

  • pkg/devcontainer/single.go
  • pkg/devcontainer/single_delivery_test.go
  • pkg/driver/external/internal/testfixture/main.go
  • pkg/driver/external/session.go
  • pkg/driver/external/session_logging_test.go
  • pkg/tunnel/pipebridge.go
  • pkg/tunnel/pipebridge_test.go

Include current security and architecture concerns and merge-risk assessment alongside all inline findings. Inspect runtime stderr/redaction, unexpected helper exit diagnostics, trace access, raw tunnel failures even when existing classification returns nil, and planned versus failed pre-start delivery. Confirm existing return values, startup ordering, cancellation and owned process cleanup remain preserved. Please explicitly identify the reviewed head and full file coverage. All implementation CI and fresh Greptile5/5 are complete. Use included free review allowance only; do not use paid credits.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@skevetter

Copy link
Copy Markdown
Contributor Author

The completed exact-head full CodeRabbit review covers all seven files and reports no actionable findings, Minimal merge risk and Low security architecture risk.

The docstring metric is advisory. The touched code consists of internal helpers, existing documented lifecycle methods and descriptive regression tests; there is no new exported production API needing a missing contract. Boilerplate comments or a settings change solely to satisfy that percentage would not improve this change.

I also traced the newly logged preparation errors through both run-option builders. Their current errors come from JSON serialization/conversion or fixed unsupported secure-mount capability messages. The diagnostic records the error cause, not run options, environment maps or secret values. The later container-creation path already propagates the same builders' failures. No concrete newly introduced disclosure was identified. This is a scoped source disposition, not a blanket guarantee for arbitrary future error implementations. External runtime stderr retains its existing streaming redactor, with a real subprocess canary regression.

All 90 implementation jobs, 80 actual native cases, dynamic Windows coverage and six BuildKit cases passed on the reviewed head. No code change or further bot review is needed for these advisory observations.

@skevetter
skevetter marked this pull request as ready for review October 16, 2026 21:27
@skevetter
skevetter merged commit 02aa279 into main Oct 16, 2026
112 checks passed
@skevetter
skevetter deleted the codex/microsandbox-startup-diagnostics branch October 16, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: clarify successful MicroSandbox startup diagnostics

1 participant