← Back to Pull requests

fix(desktop): preserve cached replies and repair CI gates #6129

Closed
unknown closed this pull request without merging on Oct 16, 2026 11:12 UTC
View on GitHub
unknown unknown commented on Oct 16, 2026 05:32 UTC
Author

Summary

Preserve completed replies in the local transcript cache when a normal Session catalog update lands before a coalesced cache write. The global database revision fence discarded that write, leaving offline history without the reply. Keep coalescing and cancel pending writes at the existing service boundary when a Session or authority is actually removed. Catalog reconciliation returns its transaction's actual deleted Session IDs so the service cancels only those pending snapshots, without duplicating the deletion rule.

Restore two stale CI ledgers: the production dependency list omits marked@18.0.11, which Host-side image parsing needs, and AppShell's recorded token count still predates its reduction from 7285 to 7280.

Stabilize two existing tests that also failed in recent CI runs:

  • WorkHub bridge fixtures now wait until the frame consumer finishes reconciliation instead of sleeping for about 60 ms. Consolidate overlapping direct-answer tests while retaining topic recovery, newer-request isolation, and no duplicate delivery after restart.

  • ACP Plan paging uses two byte-limited proposals instead of 17 full model Turns within one 30-second client budget. Keep the real model → ACP → Host continuation and external-write invalidation checks; verify the 16-item limit alongside byte limits in the existing Host coordinator test.
  • Refs #5455, #5969.

    Verification

  • Linux x64, Node 24 and npm 11.19.0: reproduced the dependency-ledger failure, regenerated the ledger, and passed npm run check:artifact-budget with 242 package instances. Install used npm ci --ignore-scripts because the check reads the dependency tree.

  • Renderer architecture: 168 fixture tests passed; the current-tree check failed before the ledger refresh and passes afterward against origin/main --strict-base.

  • WorkHub bridge: 22 tests passed in five consecutive runs. A temporary 120 ms transcript-decode delay reproduces the original CI failure before the fixture fix and passes afterward; the delay is not committed.

  • ACP Goal/Plan child-process suite and Host Plan suite: 10 tests passed. The final ACP suite also passed after removing obsolete loop diagnostics.

  • Desktop and its workspace dependencies, Runtime Host, and CLI builds passed. Desktop typecheck, npm run format, npm run lint, npx knip --workspace apps/desktop, and git diff --check passed.

  • Existing artifact-budget and production-closure tests: 14 passed. Full-repository tests and local Electron E2E were not run.

  • Local Session and real-preload cache-fallback suites: 82 tests passed. SQLite/restart regressions cover ordinary catalog updates, explicit deletion, authority purge, and catalog reconciliation with simultaneous removed/retained Session writes. The catalog-reconciliation regression fails on the reviewed head; after the fix, deleted history stays absent and the retained reply survives restart. Removing the explicit-deletion fence makes its negative regression fail. The existing Electron cached-history test is retained for CI verification.
  • AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: Codex investigated CI failures, fixed cache invalidation, refreshed the ledgers, simplified asynchronous test fixtures, and ran verification.

    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: 446 lines (+334 / -112) across 5 files Reviewer: chinawch007 Review duration: 340m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.45) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 446 lines diff across 5 files
    0.45
    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.365
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6129"
    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: 45.4% (MEDIUM) · Higher = larger blast radius
    45.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: 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: 19.6% · Safe to merge
    19.6%
    Repository