Fix Python resume_session override test to not require auth#918
Merged
SteveSandersonMS merged 1 commit intomainfrom Mar 24, 2026
Merged
Fix Python resume_session override test to not require auth#918SteveSandersonMS merged 1 commit intomainfrom
SteveSandersonMS merged 1 commit intomainfrom
Conversation
The test_resume_session_sends_overrides_built_in_tool test was passing through to the real CLI for session.resume, which fails without auth credentials. Other resume tests in the same file already returned a fake response for session.resume — this one was missed. Mock now returns a fake response instead of calling through, matching the pattern used by the Node.js equivalent and other Python resume tests.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a flaky Python unit test that unintentionally called through to the real Copilot CLI during session.resume, which fails in CI due to missing authentication.
Changes:
- Update
test_resume_session_sends_overrides_built_in_toolto return a fakesession.resumeresponse rather than forwarding the RPC to the CLI.
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
test_resume_session_sends_overrides_built_in_toolfails on CI runs that don't have access to the Copilot token because it makes a real network call, unlike all the other tests. Fails with:Root cause
The test mock interceptor captured the
session.resumeparams but then passed through to the real CLI, which needs auth credentials. This fails in CI environments without Copilot auth.Other resume tests in the same file (e.g.
test_resume_session_forwards_client_name,test_resume_session_forwards_agent) already handled this correctly by returning a fake response forsession.resume. This test was simply missed.The Node.js equivalent also mocks the response rather than calling through.
Fix
Return a fake response from the mock instead of calling the real CLI, consistent with the other resume tests.