← Back to Pull requests

fix(desktop): correct the preview loopback boundary and pin its boot wiring #6037

Closed
unknown closed this pull request without merging on Oct 10, 2026 03:23 UTC
View on GitHub
unknown unknown commented on Oct 10, 2026 01:59 UTC
Author

Summary

Two small follow-ups from the #5254 review (preview capability preflight). Neither changes behaviour.

  • Correct the loopback_endpoint boundary copy. It said a verified answer does not prove "that the embedded browser shares this loopback namespace". But the embedded browser runs in the Desktop process, so it does share Desktop's loopback. What a verified answer actually leaves unproven is the remote case: when the Runtime Host runs over SSH (runtime-host-managed-services.ts:54), the listener answering on the Desktop machine need not be the server the agent started. A local service on the same port would also answer. The boundary now says that, and the existing endpoint test asserts it. This matters for #5235, which builds on this classification.

  • Pin the boot wiring of the preflight. runtime-host-boot.ts publishes the preflight in the desktop_artifact_preview offer via buildArtifactPreviewOfferTools({ preflight: createPreviewPreflightAuthority(), … }), and no test covered that call. Boot can't be constructed in a unit test, so the new test pins the call from source, the same way main-startup-lifetime.test.ts pins other boot contracts.
  • Refs #5254

    Verification

  • node --test dist/main/__tests__/preview-preflight.test.js: 28/28 pass (the existing 27 plus the new wiring test).

  • Mutation checks, each restored afterwards:

  • - Replacing createPreviewPreflightAuthority() in boot fails the new wiring test (27/1).
    - Restoring the old boundary copy in the built output fails the endpoint test (27/1).
  • biome lint on both files: clean. apps/desktop/** is outside Biome's formatter scope.

  • Built locally on Windows: core, storage, mcp, runtime and runtime-host build, and build:main emits. The remaining tsc errors come only from @maka/ui and @maka/computer-use, which I couldn't build on this host, and none are in the changed files. CI's full typecheck is the authority here.
  • AI use

    Select exactly one:

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: Claude Code wrote both changes and ran the mutation checks; I reviewed them.

    Checklist

  • Tests cover the change and fail without it: both mutants above fail.

  • Lint, format, typecheck and the affected suites pass locally. Lint and the affected suite pass; full typecheck is left to CI, as described.
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • 🤖 Generated with Claude Code

    Diff: 324 lines (+243 / -81) across 4 files Reviewer: M4n5ter Review duration: 83m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 324 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.346
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6037"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.0% (MEDIUM) · Higher = larger blast radius
    42.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.2% · Safe to merge
    18.2%
    Repository