Skip to content

Agent Host:浏览器重连/会话恢复后工具从 No client connected 变为 does not exist,旧共享页失效 #340718

Closed as not planned

Description

@solar555

问题概述

VS Code 的 Copilot SDK / Agent Host 会话在浏览器客户端重连及会话恢复期间,浏览器工具先返回 No client connected,之后调用同一个工具返回 Tool 'openBrowserPage' does not exist.。再次恢复会话后工具可执行,但原共享页面失效;强制新建空白页面并读取成功。

希望核查浏览器客户端工具注册、重连时的工具刷新,以及失效共享页面的恢复与错误提示。当前证据不足以确定根因,也不能证明某个模型不支持浏览器工具。

环境

  • VS Code:1.141.0
  • Commit:2a59476c9bfcb90b3ddc372c36762471b7dfad1c
  • 系统:macOS 26.6.2,arm64
  • 内置 GitHub Copilot 扩展:GitHub.copilot-chat 0.69.0(读取本机内置扩展清单核实)
  • 功能:Agent Host / Copilot SDK 会话,集成浏览器工具
  • 模型:首次故障时为 claude-sonnet-5;随后自动路由记录为 gpt-6.1-sol

实际操作与结果

时间为 2026-10-09 UTC+08:00。以下是从本机会话日志提取的脱敏摘要,不附原始日志。

时间 操作 实际结果
17:08 openBrowserPage 请求共享现有页 返回用户未共享页面的结果,说明该工具当时可以执行
20:41 openBrowserPage;对已有页面 readPage → navigatePage(type=reload) → readPage 均返回 No client connected
20:42–20:43 用户告知已连接;同模型会话恢复后再次调用 openBrowserPage 返回 Tool 'openBrowserPage' does not exist.
20:45 起 会话恢复并自动路由到另一模型;已有页面读取 → 刷新 → 重读 均返回 Page "<原共享页面ID>" not found
随后 openBrowserPage({"url":""}) 返回同一原共享页面不存在的错误
随后 openBrowserPage({"url":"about:blank","forceNew":true}) 成功,返回新页面ID
随后 readPage 读取新页面 成功,URL 为 about:blank
随后 openBrowserPage({}) 返回用户未共享现有页面的结果,不再是工具不存在或客户端未连接

上述顺序是已观察到的故障路径,尚未在干净会话中反复复现;模型切换与客户端恢复同时发生,不能将成功归因于模型切换。

可供排查的复现路径

  1. 在支持集成浏览器工具的 Agent Host / Copilot SDK 会话中共享浏览器页面。
  2. 让客户端断开后重新连接,并恢复同一个会话。
  3. 调用 openBrowserPage,再对已有页面读取、刷新、重读。
  4. 检查工具是否由 No client connected 变为 Tool 'openBrowserPage' does not exist.,以及页面ID是否失效。
  5. 对比新建 about:blank 页面并读取的结果。

预期

  • 客户端重连后,现有会话的浏览器工具注册应与当前活跃客户端保持一致。
  • 若工具或旧共享页面需要重新绑定,应返回可操作的恢复提示,而不是让用户反复重连、共享或更换模型。
  • 区分“无客户端”“工具未注册”“页面ID失效”“用户未授权共享”。

影响与已验证的临时恢复

工作流程因无法读取已登录页面而中断。强制新建空白页面后,打开和读取工具实际成功;原页面授权并未因此恢复。未使用其他通道绕过页面登录或访问授权。

相关问题

可能与 #331289 的客户端重连/旧客户端归属现象相关,但这里没有协议日志证明是同一根因;本次还出现了明确的工具不存在错误。

本机没有可用的 AHP 协议日志,因此不对客户端ID归属或工具注册实现作推断。未上传业务页面、内网地址、账户信息、页面ID、原始日志或任何凭据。

此报告由用户明确要求提交,使用 AI 协助整理并核对了本机版本与实际工具调用结果。

Activity

  1. vs-code-engineering commented on Oct 9, 2026

    @vs-code-engineering
    Contributor

    AI Translation:

    Title:

    Agent Host: After browser reconnect / session restore, tool changes from "No client connected" to "does not exist"; old shared page becomes invalid

    Body:

    Problem Overview

    During browser client reconnection and session restoration of a VS Code Copilot SDK / Agent Host session, the browser tool first returns No client connected, and then calling the same tool returns Tool 'openBrowserPage' does not exist.. After restoring the session again, the tool can execute, but the original shared page becomes invalid; forcibly creating a new blank page and reading it succeeds.

    I would like a review of browser client tool registration, tool refresh on reconnect, and the recovery and error messaging for invalidated shared pages. The current evidence is insufficient to determine the root cause, and it cannot prove that a particular model does not support browser tools.

    Environment

    • VS Code: 1.141.0
    • Commit: 2a59476
    • System: macOS 26.6.2, arm64
    • Built-in GitHub Copilot extension: GitHub.copilot-chat 0.69.0 (verified by reading the local built-in extension manifest)
    • Feature: Agent Host / Copilot SDK session, with integrated browser tools
    • Model: claude-sonnet-5 at the time of the first failure; subsequently auto-routed and recorded as gpt-6.1-sol

    Actual Steps and Results

    Times are 2026-10-09 UTC+08:00. The following is a redacted summary extracted from the local session log; raw logs are not attached.

    Time Operation Actual Result
    17:08 openBrowserPage requests to share an existing page Returned a result indicating the user had not shared a page, showing the tool could execute at that time
    20:41 openBrowserPage; on an existing page readPage → navigatePage(type=reload) → readPage All returned No client connected
    20:42–20:43 User reported being connected; after restoring the same-model session, called openBrowserPage again Returned Tool 'openBrowserPage' does not exist.
    From 20:45 Session restored and auto-routed to another model; read existing page → refresh → re-read All returned Page "<original shared page ID>" not found
    Then openBrowserPage({"url":""}) Returned the same error that the original shared page does not exist
    Then `openBrowserPage({"url":"(redacted) Succeeded, returned a new page ID
    Then readPage reading the new page Succeeded, URL was `(redacted)
    Then openBrowserPage({}) Returned a result indicating the user had not shared an existing page — no longer "tool does not exist" or "client not connected"

    The above sequence is the observed failure path; it has not been repeatedly reproduced in a clean session. Model switching and client recovery happened simultaneously, so success cannot be attributed to the model switch.

    Reproduction Path for Investigation

    1. In an Agent Host / Copilot SDK session that supports the integrated browser tools, share a browser page.
    2. Have the client disconnect and reconnect, and restore the same session.
    3. Call openBrowserPage, then read, refresh, and re-read an existing page.
    4. Check whether the tool changes from No client connected to Tool 'openBrowserPage' does not exist., and whether the page ID becomes invalid.
    5. Compare against creating a new `(redacted) page and reading it.

    Expected

    • After the client reconnects, the existing session's browser tool registration should stay consistent with the currently active client.
    • If the tool or the old shared page needs to be re-bound, an actionable recovery hint should be returned, rather than making the user repeatedly reconnect, re-share, or switch models.
    • Distinguish between "no client", "tool not registered", "page ID invalid", and "user has not authorized sharing".

    Impact and Verified Temporary Recovery

    The workflow was interrupted because the already-logged-in page could not be read. After forcibly creating a new blank page, the open and read tools actually succeeded; the original page's authorization was not restored as a result. No other channel was used to bypass page login or access authorization.

    Related Issues

    This may be related to the client-reconnection / old-client-ownership phenomenon in #331289, but there are no protocol logs here to prove it is the same root cause; this time there was also a clear "tool does not exist" error.

    There are no AHP protocol logs available on this machine, so no inference is made about client ID ownership or the tool registration implementation. No business pages, internal addresses, account information, page IDs, raw logs, or any credentials were uploaded.

    This report was submitted at the explicit request of the user, organized with AI assistance, and the local version and actual tool-call results were verified.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • host.docker.internal

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "host.docker.internal"

    See Network Configuration for more information.

    Generated by Issue Triage · copilot · opus48 · 135.2 AIC · ⌖ 29.8 AIC · ⊞ 8.8K · ◷

  2. added
    ai-translated
    on Oct 9, 2026
  3. kycutler commented on Nov 3, 2026

    @kycutler
    Collaborator

    Thanks for reporting! This should be fixed by #340894. Please re-open if you still see the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ai-translated

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions