github / github/copilot-cli

Issue Summary: Copilot CLI Session Resume Fails Due to Inconsistent Model Name Prefix Handling

未关闭
#4,282 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

area:models area:sessions
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Describe the bug

When attempting to resume a previous session that used a custom endpoint model (e.g., a locally hosted LM Studio model qwen3.6-35b-a3b) in VS Code’s Copilot CLI, the CLI fails to restore the session because of an inconsistency in the model name prefix. The session metadata stores a prefixed name, but the actual API call uses the unprefixed name, leading to a non‑JSON error response and a subsequent parsing failure.

Affected version

GitHub Copilot CLI 1.0.74.

Steps to reproduce the behavior

1.Configure a custom endpoint in VS Code pointing to a local LM Studio server with the model qwen3.6-35b-a3b.

2.Start a new session using that model and complete a conversation successfully. The session is saved normally.

3.End the session (e.g., by closing the conversation or letting it finish).

4.Attempt to resume the session from the VS Code Copilot history panel.

5.Observe the error – the CLI logs show model fallback warnings and eventually an API call failure.

Expected behavior

When resuming a session, the Copilot CLI should:

Maintain model name consistency – either store the unprefixed name in the session metadata, or use the full name (including the customendpoint/ prefix) when making the API call.

Provide clearer error messaging – when a model name mismatch occurs, the CLI should give an explicit, actionable error instead of a cryptic JSON parsing failure.

Additional context

2026-07-28T11:50:21.747Z [INFO] Proxy configuration: HTTP_PROXY=(not set), HTTPS_PROXY=(not set), NO_PROXY=192.168.1.101,localhost,127.0.0.1
2026-07-28T11:50:21.748Z [INFO] Running in offline mode. GitHub features are unavailable.
2026-07-28T11:50:21.748Z [INFO] Shell completions: no supported shell detected, skipping
2026-07-28T11:50:21.748Z [INFO] Starting CLI in server mode (stdio)
2026-07-28T11:50:21.749Z [INFO] Starting CLI in stdio mode (Rust JSON-RPC engine)
2026-07-28T11:50:21.749Z [INFO] CLI server ready (stdio mode, Rust JSON-RPC engine)
2026-07-28T11:50:21.749Z [INFO] Server started, waiting for requests
2026-07-28T11:50:22.651Z [INFO] Workspace initialized: 59d2872e-c098-4f97-872d-e2ee57464169 (checkpoints: 0)
2026-07-28T11:50:22.666Z [INFO] [managedSettings] applied: bypass-permissions mode DISABLED by enterprise policy (fail-closed: policy could not be determined) — /allow-all and permission escalation are now blocked
2026-07-28T11:50:22.666Z [INFO] [managedSettings] self-fetch starting for account https://github.com/YH20250922
2026-07-28T11:50:22.666Z [INFO] [managedSettings] device MDM: no policy present on this device
2026-07-28T11:50:23.538Z [INFO] [managedSettings] server policy: none for this account (404/empty) from https://github.com
2026-07-28T11:50:23.538Z [INFO] [managedSettings] effective policy resolved: source=none, bypassDisabled=false, serverFetchFailed=false
2026-07-28T11:50:23.538Z [INFO] [managedSettings] applied: no bypass restriction in force (managed policy absent)
2026-07-28T11:50:23.538Z [INFO] [managedSettings] self-fetch complete for https://github.com/YH20250922: bypassDisabled=false, serverFetchFailed=false
2026-07-28T11:50:23.551Z [INFO] Resumed session: 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:23.561Z [INFO] Retrieved 17 events from session 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:31.665Z [WARNING] Model 'customendpoint/qwen3.6-35b-a3b' from CLI argument is not available. Falling back to next option.
2026-07-28T11:50:31.665Z [WARNING] Model 'customendpoint/qwen3.6-35b-a3b' from session is not available. Falling back to next option.
2026-07-28T11:50:31.665Z [INFO] Using default model: gpt-5.4
2026-07-28T11:50:31.673Z [INFO] Closing session 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:31.678Z [INFO] Destroyed session: 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:31.688Z [INFO] Workspace initialized: 59d2872e-c098-4f97-872d-e2ee57464169 (checkpoints: 0)
2026-07-28T11:50:31.691Z [INFO] [managedSettings] applied: bypass-permissions mode DISABLED by enterprise policy (fail-closed: policy could not be determined) — /allow-all and permission escalation are now blocked
2026-07-28T11:50:31.691Z [INFO] [managedSettings] self-fetch starting for account https://github.com/YH20250922
2026-07-28T11:50:31.691Z [INFO] [managedSettings] device MDM: no policy present on this device
2026-07-28T11:50:32.114Z [INFO] [managedSettings] server policy: none for this account (404/empty) from https://github.com
2026-07-28T11:50:32.114Z [INFO] [managedSettings] effective policy resolved: source=none, bypassDisabled=false, serverFetchFailed=false
2026-07-28T11:50:32.114Z [INFO] [managedSettings] applied: no bypass restriction in force (managed policy absent)
2026-07-28T11:50:32.114Z [INFO] [managedSettings] self-fetch complete for https://github.com/YH20250922: bypassDisabled=false, serverFetchFailed=false
2026-07-28T11:50:32.125Z [INFO] Resumed session: 59d2872e-c098-4f97-872d-e2ee57464169
2026-07-28T11:50:32.129Z [ERROR] Starting remote MCP client for GitHub with url: https://api.githubcopilot.com/mcp/
2026-07-28T11:50:32.129Z [ERROR] Connecting MCP client for GitHub...
2026-07-28T11:50:32.130Z [ERROR] Starting remote MCP client for unreal-mcp with url: http://127.0.0.1:8000/mcp
2026-07-28T11:50:32.130Z [ERROR] Connecting MCP client for unreal-mcp...
2026-07-28T11:50:32.970Z [ERROR] [rust:rmcp::transport::worker] worker quit with fatal: Transport channel closed, when AuthRequired(AuthRequiredError { www_authenticate_header: "******"invalid_request", error_description="No access token was provided in this request", resource_metadata="https://api.githubcopilot.com/.well-known/oauth-protected-resource/mcp/\"" })
2026-07-28T11:50:32.971Z [ERROR] Server GitHub requires authentication, initiating OAuth flow
2026-07-28T11:50:33.773Z [ERROR] OAuth authentication required for GitHub
2026-07-28T11:50:34.149Z [ERROR] [rust:rmcp::transport::worker] worker quit with fatal: Transport channel closed, when Client(reqwest::Error { kind: Request, url: "http://127.0.0.1:8000/mcp", source: hyper_util::client::legacy::Error(Connect, ConnectError("tcp connect error", 127.0.0.1:8000, Os { code: 10061, kind: ConnectionRefused, message: "由于目标计算机积极拒绝,无法连接。" })) })
2026-07-28T11:50:34.149Z [ERROR] Failed to start MCP client for remote server unreal-mcp: Error: failed to initialize MCP client: Send message error Transport [rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorkermcp::client::RawCapturingReqwestClient>] error: Client error: error sending request for url (http://127.0.0.1:8000/mcp), when send initialize request (code=GenericFailure)
2026-07-28T11:50:34.149Z [ERROR] Recorded failure for server unreal-mcp: failed to initialize MCP client: Send message error Transport [rmcp::transport::worker::WorkerTransport<rmcp::transport::streamable_http_client::StreamableHttpClientWorkermcp::client::RawCapturingReqwestClient>] error: Client error: error sending request for url (http://127.0.0.1:8000/mcp), when send initialize request
2026-07-28T11:50:34.337Z [INFO] Using custom provider: type=openai, baseUrl=http://127.0.0.1:62659/v/customendpoint, wireApi=completions
2026-07-28T11:50:34.337Z [INFO]
2026-07-28T11:50:34.337Z [INFO] --- Start of group: Custom provider configured settings: ---
2026-07-28T11:50:34.337Z [INFO] --- End of group ---
2026-07-28T11:50:34.399Z [INFO] --- Start of group: Completion request configuration: ---
2026-07-28T11:50:34.399Z [INFO] --- End of group ---

session log

First conversation (successful):
{"type":"session.start","data":{"selectedModel":"customendpoint/qwen3.6-35b-a3b",...}}
{"type":"assistant.turn_start","data":{"model":"qwen3.6-35b-a3b",...}} // prefix dropped during actual call

Resume attempt (failure):
{"type":"session.resume","data":{"selectedModel":"customendpoint/qwen3.6-35b-a3b",...}}
{"type":"assistant.turn_start","data":{"model":"qwen3.6-35b-a3b",...}} // still unprefixed
// Repeated model_call errors follow
{"type":"session.error","data":{"errorType":"query","message":"non-streaming response body was not valid JSON: expected value at line 1 column 1"}}

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从会话恢复流程以及报告中显示的 session.start/session.resume 元数据开始,然后将 selectedModel 值与 assistant.turn_start 中发送的模型进行比较。使用自定义端点和 qwen3.6-35b-a3b 模型重现该故障。完成的标准是:恢复会话时保留可用的模型名称,并报告可采取行动的错误,而不是 JSON 解析失败。

由索引模型根据 Issue 内容生成。

评估

技术栈
rust, vscode
领域
api, cli
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。