Skip to content

ModeHandlersTest.shouldInvokeExitPlanModeHandlerWhenModelUsesTool fails after CLI 1.0.57 upgrade #1547

@edburns

Description

@edburns

Summary

ModeHandlersTest.shouldInvokeExitPlanModeHandlerWhenModelUsesTool fails on both JDK 17 and JDK 25 after upgrading the Java SDK to depend on @github/copilot ^1.0.57.

Failing run: https://github.com/github/copilot-sdk/actions/runs/26802258445
Last passing run (CLI 1.0.55-5): https://github.com/github/copilot-sdk/actions/runs/26787985570
PR that introduced the upgrade: #1546

Root Cause

The test uses the replaying CAPI proxy with the snapshot at:

test/snapshots/mode_handlers/should_invoke_exit_plan_mode_handler_when_model_uses_tool.yaml

This snapshot was recorded against CLI 1.0.55-5 (commit 671b50a3, PR #1228). The .lastmerge file now points to commit 753d4729 which installs CLI 1.0.57 into the test harness. CLI 1.0.57 sends requests to the CAPI proxy that no longer match the recorded snapshot patterns, so the proxy returns 500 Proxy error. The CLI retries 5 times (~30s) then surfaces the error as a test failure.

The snapshot YAML itself is unchanged between the old and new .lastmerge commits — nobody has re-recorded it for the 1.0.57 request format.

Error Output

ModeHandlersTest.shouldInvokeExitPlanModeHandlerWhenModelUsesTool:100 » Execution
java.lang.RuntimeException: Session error: Execution failed: Error: Failed to get
response from the AI model; retried 5 times (total retry wait time: 30.64 seconds)
(Request-ID proxy-error) Last error: CAPIError: 500 500 Proxy error

All 3 retry attempts produce the same error.

What Changed in 1.0.57

The 1.0.57 schema introduced several new fields that likely affect the request shape sent to CAPI:

  • contextTier added to SessionModelSwitchToParams, SessionStartEvent, SessionResumeEvent, SessionModelGetCurrentResult
  • model field added to ToolExecutionStartEvent
  • mcpToolsTokens added to context info
  • suppressCustomAgentPrompt and other new fields in SessionOptionsUpdateParams
  • New RPC namespaces (user, runtime)

Any of these could change how the CLI constructs the chat completion request that the replay proxy tries to match.

Fix Required

The snapshot needs to be re-recorded against CLI 1.0.57 so the replay proxy can match the updated request patterns. The snapshot is located at:

test/snapshots/mode_handlers/should_invoke_exit_plan_mode_handler_when_model_uses_tool.yaml

Additional Context

  • The other mode_handlers test (shouldInvokeAutoModeSwitchHandlerWhenRateLimited) passes.
  • All other 1692 tests pass cleanly.
  • The snapshot format itself is simple (single conversation with an exit_plan_mode tool call), so re-recording should be straightforward.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions