Skip to content

Stub getCurrentAuthedUser/getUserOrganizations on NullBaseOctoKitService#314529

Open
meganrogge wants to merge 1 commit intomainfrom
merogge/fix-null-octokit-getCurrentAuthedUser
Open

Stub getCurrentAuthedUser/getUserOrganizations on NullBaseOctoKitService#314529
meganrogge wants to merge 1 commit 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

Screenshot Changes

Base: 98b4a731 Current: 2045b330

Changed (20)

chat/input/chatInput/Default/Dark
Before After
before after
chat/input/chatInput/Default/Light
Before After
before after
chat/input/chatInput/WithArtifacts/Dark
Before After
before after
chat/input/chatInput/WithArtifacts/Light
Before After
before after
chat/input/chatInput/WithFileChanges/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Light
Before After
before after
chat/input/chatInput/WithTodos/Dark
Before After
before after
chat/input/chatInput/WithTodos/Light
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Light
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Light
Before After
before after
chat/input/chatInput/Full/Dark
Before After
before after
chat/input/chatInput/Full/Light
Before After
before after
chat/widget/chatWidget/SimpleQA/Light
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Dark
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after
chat/widget/chatWidget/MultiTurn/Light
Before After
before after
agentSessionsViewer/ApprovalRowLongLabel/Dark
Before After
before after
agentSessionsViewer/ApprovalRowLongLabel/Light
Before After
before after

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