← Back to Pull requests

fix: route stale AgentService.stateManager test refs through getStateManager (build fix for vscode-engineering#3678) #332091

Closed
unknown closed this pull request without merging on Sep 02, 2026 19:52 UTC
View on GitHub
unknown unknown commented on Aug 22, 2026 04:58 UTC
Author

Build failure

The Compile task on main failed typechecking src/tsconfig.json with two TS2339 errors:

src/vs/platform/agentHost/test/node/agentService.test.ts(6560,42): error TS2339: Property 'stateManager' does not exist on type 'AgentService'.
src/vs/platform/agentHost/test/node/agentService.test.ts(6633,30): error TS2339: Property 'stateManager' does not exist on type 'AgentService'.

All downstream test stages cascaded from this single compile break.

Root cause

A sealed Agent Host service graph refactor removed the public AgentService.stateManager escape hatch. Most call sites in agentService.test.ts were migrated to the getStateManager(svc) helper (which delegates to getTestAgentStateManager), but two references at lines 6560 and 6633 were left pointing at the now-removed svc.stateManager property, breaking the typecheck.

How the fix works

Both stale references are updated to use the existing getStateManager(svc) helper already used throughout the same file. This routes through the composition-owned AgentHostStateManager, restoring type correctness with no behavioral change to the tests. The helper returns the same AgentHostStateManager whose getSessionState these assertions already rely on.

Rollback evaluation

  • Recommendation: Do not roll back.

  • Culprit: not confirmed from public history in this environment; the source issue attributes it to the sealed Agent Host service graph refactor.

  • Rationale: The fix is a bounded two-line test-file edit. Fix-forward is faster and safer than reverting a large service-graph refactor that later commits may depend on.

  • Owners to consult: @roblourens
  • Validation

    Static source inspection confirms getStateManager(svc) returns an AgentHostStateManager exposing getSessionState, matching the surrounding usages in the same file. A full tsgo-typecheck build was not run in this environment; the change is confined to replacing two removed-property accesses with the established helper.

    Risk

    Minimal. Change is limited to two lines in a single test file, mirroring the pattern used elsewhere in the same suite. No production code is touched.

    Recommended reviewer

    Recommended owner: @roblourens

    Fixes microsoft/vscode-engineering#3678

    Generated by build-fix · opus48 · 161.3 AIC · ⌖ 18.6 AIC · ⊞ 11.6K · ◷

    <!-- gh-aw-agentic-workflow: build-fix, engine: copilot, model: claude-opus-4.8, id: 32552555924, workflow_id: build-fix, run: https://github.com/microsoft/vscode-engineering/actions/runs/32552555924 -->

    <!-- gh-aw-workflow-id: build-fix -->
    <!-- gh-aw-workflow-call-id: microsoft/vscode-engineering/build-fix -->

    Diff: 359 lines (+269 / -90) across 4 files Reviewer: dianatofficial Review duration: 16734m
    All Vouch review confidence checks passed
    Residual risk 0.18 = 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 · 359 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.352
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #332091"
    general weight: 0.35
    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.6% (MEDIUM) · Higher = larger blast radius
    42.6%
    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.4% · Safe to merge
    18.4%