github / github/copilot-cli

AHP 0.7: native resume uses a derived /chat URI instead of advertised defaultChat

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

还没有人认领这个 Issue。

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

描述

Summary

The experimental native AHP client can discover an existing session on the VS Code agent host, but resume fails at the chat resource. The failed resource has the form <sessionUri>/chat, which differs from the defaultChat advertised in that session's state.

The intended workflow is for unmodified Copilot CLI and unmodified VS Code to access one server-backed session.

Observed versions

  • Official Copilot CLI 1.0.85 stable.
  • Official standalone Copilot CLI 1.0.86-0 prerelease, not an updated payload selected by an older launcher.
  • Official VS Code Server 1.132.0, commit df53daabb18cd157bdb08c7f01c34df936cf12f4.
  • Stock VS Code 1.137.0 connects and authenticates to the same agent host. This observation alone is not a claim of complete two-client conversation compatibility.
  • The tested CLI and host negotiate AHP 0.7.0.
  • CLI AHP mode is enabled with COPILOT_CLI_ENABLED_FEATURE_FLAGS=AHP_CLIENT.

Reproduction

  1. Start the official server's native, token-authenticated agent-host listener on loopback, using the normal server entrypoint.

  2. Create a Copilot session through AHP with an explicit provider and a provider-specific session URI.

  3. Materialize the session using the host-advertised native /env diagnostic command. Confirm its completed command turn and that listSessions returns the session.

  4. Subscribe to that session and note its actual defaultChat field.

  5. Supply the authenticated endpoint privately through COPILOT_AHP_URL, then run the stock CLI in a real interactive terminal:

    copilot --no-auto-update --ahp= --resume <session-uri>
    
  6. Resume finds the session, but attachment fails with JSON-RPC error -32001, identifying a resource ending in /chat.

No model prompt is necessary to reach this failure. An unmaterialized provisional session is not sufficient for this reproduction: it is absent from the catalogue and causes a different, earlier not-found result.

Resource identity

The identifiers below are synthetic and normalized, not captured logs:

S = copilotcli:/11111111-1111-4111-8111-111111111111
Advertised defaultChat = ahp-chat://default/<base64url-encoding-of-UTF8(S), without padding>
Resource identified by the CLI attach failure = S + "/chat"

Both tested CLI versions fail with the same resource shape.

Expected behavior

When SessionState.defaultChat is present, native resume should use that advertised resource rather than assume a chat URI can be constructed by appending /chat to the session URI. Changes to the advertised default chat should also be handled without retaining a stale derived address.

Useful public source anchors:

Please add a native-client regression case in which the advertised chat URI differs from <sessionUri>/chat, and verify that resume follows the advertised resource.

Boundaries

The failure and advertised state were observed with the official distributions above. The exact proprietary CLI implementation responsible has not been identified from public source; this report does not claim that a particular internal function is at fault.

A separate generic session-create/URI-preservation failure exists and is being investigated independently. Provider omission alone is not established as its cause.

No credentials, real endpoints, local paths, raw logs, private project code, or real session identifiers are included here.

贡献指南

打开贡献指南

从这里开始

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

调研方向

从原生 resume/attach 路径开始,将其请求的资源与 SessionState.defaultChat 进行比较。使用 AHP SessionState 定义以及 VS Code 的 buildChatUri/buildDefaultChatUri 参考,实现一个不同于 /chat 的已声明 URI。当回归用例验证 resume 请求的是已声明资源,且不会保留过时的派生地址时,即可完成。

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

评估

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

把新 issue 发到你的邮箱

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