Skip to content

Fix Python resume_session override test to not require auth#918

Merged
SteveSandersonMS merged 1 commit intomainfrom
fix/python-resume-override-test
Mar 24, 2026
Merged

Fix Python resume_session override test to not require auth#918
SteveSandersonMS merged 1 commit intomainfrom
fix/python-resume-override-test

Conversation

@SteveSandersonMS
Copy link
Copy Markdown
Contributor

@SteveSandersonMS SteveSandersonMS commented Mar 24, 2026

Problem

test_resume_session_sends_overrides_built_in_tool fails 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:

copilot._jsonrpc.JsonRpcError: JSON-RPC Error -32603: Request session.resume failed with message: No authentication info available

Root cause

The test mock interceptor captured the session.resume params 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 for session.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.

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.
@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner March 24, 2026 18:08
Copilot AI review requested due to automatic review settings March 24, 2026 18:08
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

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_tool to return a fake session.resume response rather than forwarding the RPC to the CLI.

@SteveSandersonMS SteveSandersonMS merged commit 84d4f9e into main Mar 24, 2026
22 checks passed
@SteveSandersonMS SteveSandersonMS deleted the fix/python-resume-override-test branch March 24, 2026 18:21
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.

2 participants