← Back to Pull requests

feat(assistant): add tested condition waits and simplify Matter settlement #6193

Closed
unknown closed this pull request without merging on Oct 21, 2026 07:29 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 09:52 UTC
Author

Summary

Matter tasks can now wait for an Agent-authored, tested read-only condition, with an absolute deadline as fallback. The Host evaluates conditions without model calls and resumes the same task session when the condition matches, repeated source checks fail, or the deadline expires. Time-only waits remain supported; no Goal is created.

Settlement is also shorter: MatterSettle accepts a summary and optional inline note instead of requiring a draft file and model-supplied revision. Independent review for wait/complete, activation and input-revision checks, durable history, and idempotent submissions remain. The Host binds settlement to the exact task context delivered before the calling tool event. Delegated workers retain their own lifecycle and business tools but no longer see the Bot's delegation/management tools.

  • Condition checkers use the existing isolated code executor with explicit source/session read capabilities and current permissions. Code and inputs are bound to a tested checker ID.

  • Observation checkpoints, dispatch leases and task events survive restart. Cancellation, stale observations and deadline races do not create duplicate wakeups.

  • Existing task data and legacy file access are retained. Rejected reviews or review transport failures leave the task active.
  • Builds on the merged cache fix #6177 and includes main through 85e942724.

    Same-turn handoff successors validate inherited Inbox context through Runtime's authenticated continuation lineage. The reader verifies seals, claims and successor openings; it does not borrow unrelated Session history. Tool-call matching also requires the current physical run, and input arriving after the call cannot authorize that submission.

    Verification

    Local verification after updating main and fixing inherited-context validation:

  • TypeScript build/typecheck for core, storage, MCP, runtime and runtime-host passed.

  • Runtime/Host group: 938/939 passed. Main's newly added workspace fallback assertion failed because macOS canonicalizes the temporary directory alias; the same test passed with TMPDIR=/private/tmp.

  • All 189 native assistant tests passed (memory-network 83, index-initiative 24, proactive-matters 82).

  • Final settlement tests: 13/13 passed, including two authenticated handoffs, SQLite reopen, stale user input, pre-call ordering, missing continuation authority, and reused tool-call IDs across physical runs. The old current-run-only reader reproduced the missing-input failure before the fix.

  • Changed-file Biome lint/format, ASF headers and git diff --check passed.

  • The prior feature tree also passed 935 runtime/Host plus 189 native assistant tests before the main update.

  • No full-repository test run, desktop UI run or paid-model replay of the handoff correction was performed. GitHub CI is rerunning on the pushed head.
  • Real-model replay before incorporating the latest main update used GPT 6.1 Sol medium, actual Runtime Host/Bot/Matter tools and independent model review. Business records were controlled through an isolated HTTP/SQLite source, not mocked model or tool responses. Four concurrent tasks covered an amended acceptance condition, source HTTP 503 and recovery, cancellation followed by a late update, deadline fallback, Host restart and duplicate terminal updates. All 25 outcome checks passed; the test environment was stopped afterward.

    | Outcome | Previous run | Simplified run |
    | --- | ---: | ---: |
    | A: full acceptance to visible notification | 89.8 s | 51.0 s |
    | B: confirmed pickup to visible notification | 75.6 s | 40.2 s |
    | D: unsigned deadline to visible notification | 49.3 s | 36.1 s |
    | Final activation model calls, A / B / D | 10 / 8 / 5 | 4 / 4 / 4 |

    The final activations used MatterRead → MemoryOriginal → MatterSettle, without draft writes or separate three-file reads. Review calls remained 10. No settlement self-invalidation loop or worker misuse of coordinator tools occurred. This is a single scenario comparison with manually timed source changes, not a latency benchmark.

    Known observations: the Bot twice tried to combine exclusive delegation calls; checker construction had three missing-object-field errors; one retry time expired before submission. These recovered without intervention. Two additional tool errors came from the injected 503. The deliberate Host restart aborted one Bot model call; subsequent processing and final notifications recovered. Multi-day operation across repeated context compaction has not been live-tested.

    AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: OpenAI Codex assisted with implementation, regression tests, the isolated live replay, and this description. Commits include Generated-by: Codex trailers.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • Diff: 632 lines (+474 / -158) across 7 files Reviewer: chinawch007 Review duration: 1296m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 632 lines diff across 7 files
    0.50
    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%
    60%
    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.386
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6193"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 50.4% (MEDIUM) · Higher = larger blast radius
    50.4%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 19.9% · Safe to merge
    19.9%
    Repository