Stub getCurrentAuthedUser/getUserOrganizations on NullBaseOctoKitService#314529
Open
meganrogge wants to merge 1 commit intomainfrom
Open
Stub getCurrentAuthedUser/getUserOrganizations on NullBaseOctoKitService#314529meganrogge wants to merge 1 commit intomainfrom
meganrogge wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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 toNullBaseOctoKitService. - Add a stub
getUserOrganizations()implementation toNullBaseOctoKitService.
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[]> { |
Contributor
Screenshot ChangesBase: Changed (20) |
roblourens
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:…and the agent-host benchmark hangs.
Root cause
In
src/extension/extension/vscode/services.ts:The eval container sets
IS_SCENARIO_AUTOMATION=1, soNullBaseOctoKitServiceis injected asIOctoKitService. ButNullBaseOctoKitServiceextendsBaseOctoKitService, which only implements the*WithTokenvariants (getCurrentAuthedUserWithToken,getUserOrganizationsWithToken). The no-arg interface methodsgetCurrentAuthedUser()/getUserOrganizations()are only implemented on the realOctoKitService(which has access toIAuthenticationServiceto fetch the token).Why agent-host specifically
The only non-test caller of
IOctoKitService.getCurrentAuthedUserisGitHubOrgChatResourcesService.computePreferredOrganizationName(src/extension/agents/vscode-node/githubOrgChatResourcesService.ts). That service is consumed byGitHubOrgCustomAgentProviderandGitHubOrgInstructionsProvider— 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 othersessionTargetruns cleanly through the eval and onlyagent-host-copilottriggers it.Fix
Add stub overrides on
NullBaseOctoKitService:getCurrentAuthedUser()→ returns theNullUserplaceholder (consistent with the existinggetCurrentAuthedUserWithTokenstub).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
agentHostPermissionServiceworkbench-DI error encountered on the same eval run).