← Back to Pull requests

feat(runtime-host): enable ShellRun event waits #6206

Closed
unknown closed this pull request without merging on Oct 22, 2026 04:32 UTC
View on GitHub
unknown unknown commented on Oct 21, 2026 02:54 UTC
Author

Summary

Enables an active Goal using AI SDK direct tools to wait for managed background Bash without repeated work-model or Goal-evaluator calls. The source Turn yields, and persisted terminal facts resume the same Goal through existing Root admission.

  • Verify same-Session, same-State-Root Bash provenance with bounded SQLite/Memory queries. A terminal result may indicate failure, timeout or cancellation; the continuation reads it to determine success. Orphaned tasks report uncertainty without replaying commands.

  • Add Desktop/CLI waiting, unknown and awaiting-admission states, with diagnostics preserved across reconnects. Cancellation targets the original Goal, generation and wait; it pauses the Goal while the background task keeps running.
  • Refs #5926 (PR4 implementation plan).
    Refs the original discussion #5920.

    Verification

  • Root build/typecheck, lint, Desktop/UI Knip, renderer architecture and E2E budget checks passed on macOS. Final build uses Node 24.18.0/npm 11.19.0.

  • Current-commit Host/storage regression: 410 passed, 1 subprocess-fixture entry skipped. Desktop preload/controller/IPC: 33 passed. Covers real Bash/PTY, cancellation, source revocation, reconnects, polling and SIGKILL recovery with a command-start counter. Defect regressions were verified failing before their fixes.

  • Chrome Storybook: 8 light/dark checks, including narrow layout and cancellation tooltip assertions. Captured UI components are unchanged by the later Host/preload fixes.

  • Tracked-file formatting passed. Root format:check includes unrelated untracked local investigation scripts and fails on those files; they are excluded from this PR. Full npm test, Windows/Linux runs and Electron E2E were not run.
  • <img width="1280" height="900" alt="image" src="https://github.com/user-attachments/assets/73fc02d7-1d33-4837-b2b3-0fa2f6800053" />
    <img width="1280" height="900" alt="image" src="https://github.com/user-attachments/assets/1bb16219-c6f6-4c6c-982b-179aa57f859c" />

    Protocol compatibility

    The new Goal projection and cancellation operation advance Runtime Host compatibility epoch 226→ 227. Snapshot preflight reserves the wait summary within the existing frame limit, reducing the remaining capacity for queued content. No storage schema migration is required.

    AI use

    Select exactly one:

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: OpenAI Codex contributed implementation, tests, documentation and review assistance. The commit retains Generated-by: OpenAI Codex.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • The second item remains unchecked because of the root format-command limitation above; tracked-file formatting and the other listed checks passed.

    Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • Diff: 393 lines (+294 / -99) across 4 files Reviewer: me2seeks Review duration: 1538m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 393 lines diff across 4 files
    0.43
    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.358
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6206"
    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: 43.1% (MEDIUM) · Higher = larger blast radius
    43.1%
    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.7% · Safe to merge
    18.7%
    Repository