Skip to content

Stub getCurrentAuthedUser/getUserOrganizations on NullBaseOctoKitService#314529

Closed
meganrogge wants to merge 2 commits intomainfrom
merogge/fix-null-octokit-getCurrentAuthedUser
Closed

Stub getCurrentAuthedUser/getUserOrganizations on NullBaseOctoKitService#314529
meganrogge wants to merge 2 commits intomainfrom
merogge/fix-null-octokit-getCurrentAuthedUser

Conversation

@meganrogge
Copy link
Copy Markdown
Collaborator

Problem

When running an msbench eval against sessionTarget: agent-host-copilot (e.g. runtest local --benchmark vscbench.say_hello --config doc/examples/configs/agent-host.vscode.agent.yaml), the Copilot extension host logs:

WARN this.octoKitService.getCurrentAuthedUser is not a function

…and the agent-host benchmark hangs.

Root cause

In src/extension/extension/vscode/services.ts:

builder.define(IOctoKitService, isScenarioAutomation
    ? new SyncDescriptor(NullBaseOctoKitService)
    : new SyncDescriptor(OctoKitService));

The eval container sets IS_SCENARIO_AUTOMATION=1, so NullBaseOctoKitService is injected as IOctoKitService. But NullBaseOctoKitService extends BaseOctoKitService, which only implements the *WithToken variants (getCurrentAuthedUserWithToken, getUserOrganizationsWithToken). The no-arg interface methods getCurrentAuthedUser() / getUserOrganizations() are only implemented on the real OctoKitService (which has access to IAuthenticationService to fetch the token).

Why agent-host specifically

The only non-test caller of IOctoKitService.getCurrentAuthedUser is GitHubOrgChatResourcesService.computePreferredOrganizationName (src/extension/agents/vscode-node/githubOrgChatResourcesService.ts). That service is consumed by GitHubOrgCustomAgentProvider and GitHubOrgInstructionsProvider — features that only the agent-host code path activates to discover GitHub-org-backed custom agents and instruction files. Regular chat / inline chat / edit mode never traverse this service, which is why every other sessionTarget runs cleanly through the eval and only agent-host-copilot triggers it.

Fix

Add stub overrides on NullBaseOctoKitService:

  • getCurrentAuthedUser() → returns the NullUser placeholder (consistent with the existing getCurrentAuthedUserWithToken stub).
  • getUserOrganizations() → returns [].

The caller already handles the empty / unsigned-in case correctly (it just skips org discovery), so this unblocks the agent-host eval path without changing real-user behavior.

Validation

Type-checks cleanly. End-to-end validation requires this fix to ship in Insiders so the eval Docker image picks it up; once that lands, re-run runtest local --benchmark vscbench.say_hello --config doc/examples/configs/agent-host.vscode.agent.yaml.

Companion to #314526 (which fixes the parallel agentHostPermissionService workbench-DI error encountered on the same eval run).

Copilot AI review requested due to automatic review settings May 5, 2026 19:56
@meganrogge meganrogge self-assigned this May 5, 2026
@meganrogge meganrogge added this to the 1.120.0 milestone May 5, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Copilot extension’s GitHub Octokit “null” implementation used in scenario automation so that agent-host org discovery code paths don’t hit missing-method runtime errors during MSBench eval runs.

Changes:

  • Add a stub getCurrentAuthedUser() implementation to NullBaseOctoKitService.
  • Add a stub getUserOrganizations() implementation to NullBaseOctoKitService.
Show a summary per file
File Description
extensions/copilot/src/platform/github/common/nullOctokitServiceImpl.ts Adds missing no-auth stubs on the null Octokit service to prevent agent-host callers from failing at runtime.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

}

async getCurrentAuthedUser(): Promise<IOctoKitUser | undefined> {
return { avatar_url: '', login: 'NullUser', name: 'Null User' };
return { avatar_url: '', login: 'NullUser', name: 'Null User' };
}

async getUserOrganizations(): Promise<string[]> {
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Base: b6cb647b Current: 01e9f170

No screenshot changes.

@meganrogge
Copy link
Copy Markdown
Collaborator Author

/requires-eval-assessment terminalbench2 gpt-5.4,claude-opus-4.6,claude-opus-4.7

vscodeSettings:
  chat.tools.compressOutput.enabled: true

@meganrogge meganrogge added the ~requires-eval-assessment Evals will be run and will generate a report upon completion label May 6, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

⏳ Queued vscode build for 2a5bc290f3c028feb2e774c4e7239bbd13a2720d (step 1/2).

@meganrogge meganrogge closed this May 6, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

🚀 Queued eval-assessment publish build for 01e9f1709931b3baba7031e5d014ca97728675a5 (step 2/2).

@vs-code-engineering
Copy link
Copy Markdown
Contributor

🔬 Queued eval-assessment benchmark for 51555b0058.

  • Package: @vscode/vscode-copilot-evaluation-agent@0.0.0-dev.01e9f17099 (dev tag)
  • Benchmark: terminalbench2
  • VS Code overrides: applied from PR comment (2 line(s))
  • Model: claude-sonnet-4.5
  • Tracking issue: https://github.com/github/evald/issues/20622

Results will be posted back here when the run completes.

@vs-code-engineering
Copy link
Copy Markdown
Contributor

✅ Eval-assessment build published.

@vs-code-engineering vs-code-engineering Bot removed the ~requires-eval-assessment Evals will be run and will generate a report upon completion label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants