Skip to content

Chat view "New Chat" always opens a read-only Claude session when the Claude agent is disabled by org policy #345117

Closed

Description

@sksmsqhzjfGmail

Environment

  • VS Code 1.144.0 (macOS)
  • GitHub Copilot Business; Claude agent disabled by account policy (Claude3PIntegration)
  • Policy Diagnostics: no managed settings, chat harness enforcement "Not enforced"

Steps

  1. Open the Chat view (secondary side bar)
  2. Click "New Chat" (+)

Actual

  • No chat input appears. The view only shows:
    "Your organization has disabled this agent. This conversation is read-only.
    Continue in Copilot to copy the conversation and keep the original."
  • "Continue in Copilot" does nothing (the conversation appears empty).
  • Same result with "New Chat Editor", a new window, and a new profile.
  • Setting chat.editor.localAgent.enabled: true / chat.defaultToCopilotHarness: false did not help.

Expected

  • New chats fall back to an allowed harness (Copilot/Local) with a working chat input.

Workaround

  • Starting a session in the Agents window and opening it from the Chat view's
    session list works. New chats via "+" still fail.

Activity

  1. added
    bug
    on Oct 30, 2026
  2. rwoll commented on Oct 30, 2026

    @rwoll
    Member

    Thanks for reporting! I will take a look at this tomorrow.

  3. rwoll commented on Oct 30, 2026

    @rwoll
    Member

    Thanks again for the detailed report, and sorry again for the trouble! We have a fix in #345207. When policy disables Claude, New Chat (+) and New Chat Editor will fall back to Local or Copilot with a working input.

    Until it ships, you can reset the remembered Claude choice:

    1. In Keyboard Shortcuts, search for Chat: New Local Chat (workbench.action.chat.newLocalChat) and assign it a key, or add this to keybindings.json:
      { "key": "ctrl+alt+l", "command": "workbench.action.chat.newLocalChat" }
    2. Press it to open a Local chat with a working input.
    3. In the harness picker below the chat input, pick Local or Copilot.

    After that, New Chat (+) opens that harness again. Step 3 matters: the keybinding alone opens one working chat, but New Chat (+) goes back to Claude until you pick a harness.

  4. added this to the 1.145.0 milestone on Oct 30, 2026
  5. added
    unreleased
    on Oct 30, 2026
  6. vs-code-engineering commented on Oct 30, 2026

    @vs-code-engineering
    Contributor

    Sharing media and context from merged PR #345207 for verification:

    Problem

    When org policy disables the Claude agent (Claude3PIntegration, e.g. via the account's preview-features setting), users who had previously chosen Claude could not start a usable chat. Chat view New Chat (+), New Chat Editor, a new window and the restored Chat view all opened an empty Claude chat that only showed:

    Your organization has disabled this agent. This conversation is read-only. Continue in Copilot to copy the conversation and keep the original.

    There was no chat input, and Continue in Copilot did nothing because the conversation was empty.

    The new-chat harness resolver treated every Agent Host session type as usable when the Agent Host was enabled. A remembered (chat.userSelectedSessionType), current or explicit Claude/Codex type therefore kept winning even after policy disabled that provider. The resulting chat was immediately marked read-only.

    The same happens with Codex (Codex3PIntegration) when chat.editor.codex.preferAgentHost is on (experiment-controlled in stable), which looks like #344867. Reproduced on main at c6315a9 in an Ubuntu desktop; with that setting off, main falls back to Local.

    Fix

    • isNewChatSessionTypeUsable now treats a local Agent Host provider that policy disables (Claude or Codex) as unusable, so remembered and current choices fall back to the regular default (Local or Copilot).
    • An explicit request for a policy-disabled harness falls through to the regular resolution instead of opening an unusable chat.
    • The remembered choice is not cleared, so it applies again if the policy is lifted.
    • The fallback never picks Local when Local is unavailable: with managed policy requiring the Agent Host, the managed sandbox, chat.editor.preferCopilotHarness, or chat.editor.localAgent.enabled set to false, it resolves to the Copilot harness.
    • Empty untitled drafts of a disabled harness, persisted before the fix, are replaced on restore in the Chat view and in chat editors. Saved Claude chats with history stay readable as before.
    • Unsent prompts: the replacement chat gets the chat input's saved empty-chat draft. If the policy arrives while VS Code is open, the read-only draft is replaced with a Local chat that keeps the prompt. With several drafts across a restart, the replacement shows the most recently typed one (existing draft-memory behavior). No step waits on account policy or the network before you can type.

    Before / after

    Code - OSS built from source in a fresh Ubuntu 24.04 desktop, with the policy in /etc/vscode/policy.json and the user's earlier harness choice remembered. Captions come from checks of the live UI: red marks the read-only banner, green the working chat input.

    Scenario Before (main @ c6315a9) After (this PR @ ee0b5bd, merged with main)
    Claude disabled by policy, click New Chat (+) Before: New Chat (+) opens a read-only Claude chat with no input After: New Chat (+) opens a Local chat with a working input
    Codex disabled by policy (chat.editor.codex.preferAgentHost on), click New Chat (+) Before: New Chat (+) opens a read-only Codex chat with no input After: New Chat (+) opens a Local chat with a working input
    Policy applied while VS Code is open, with an unsent prompt in a new Claude chat Before: the draft turns into a read-only Claude chat and the prompt is gone After: the draft is replaced by a Local chat that keeps the prompt
    Full annotated recording (all three scenarios; Claude also covers Continue in Copilot and New Chat Editor)
    before.mp4
    after.mp4

    Workaround until this ships

    • Codex: set "chat.editor.codex.preferAgentHost": false in user settings and reload the window. The user setting overrides the experiment value.
    • Claude: no setting helps (chat.editor.localAgent.enabled and chat.defaultToCopilotHarness don't override the remembered choice). Reset the remembered harness instead: assign a keybinding to Chat: New Local Chat (workbench.action.chat.newLocalChat, hidden from the Command Palette but listed in Keyboard Shortcuts), use it to open a Local chat, then pick Local or Copilot in the harness picker under the chat input. Later New Chat (+) clicks then open that harness. Verified on main at c6315a9.

    How to test

    1. Set the Claude3PIntegration policy to false (Linux: /etc/vscode/policy.json; macOS dev build: a defaults value for the product's darwinBundleIdentifier).
    2. Have chat.userSelectedSessionType remembered as agent-host-claude (for example, Claude was picked before the policy applied).
    3. Start VS Code, open the Chat view, click New Chat (+), and run Chat: New Chat Editor. Each should open a usable chat with an input, not the read-only banner.
    4. For Codex, repeat with Codex3PIntegration set to false, chat.editor.codex.preferAgentHost set to true and agent-host-codex remembered.

    Validation

    Run in the Ubuntu desktop:

    • At 8c78ba7: ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/common/constants.test.ts: passed (64 tests). The new "only the Copilot harness is allowed" test fails when the policy check is reverted: every case then resolves to the disabled Claude/Codex harness.
    • At 8c78ba7: npm run eslint -- src/vs/workbench/contrib/chat/test/common/constants.test.ts and npm run typecheck-client: passed.
    • At ee0b5bd (the code under test is unchanged since): ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/common/constants.test.ts --run src/vs/workbench/contrib/chat/test/browser/widgetHosts/viewPane/chatViewPane.test.ts --run src/vs/workbench/contrib/chat/test/browser/widgetHosts/editor/chatEditorInput.test.ts: passed (145 tests). npm run eslint -- <the 6 changed files>: passed.

    🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).

    Source PR: #345207

  7. added
    insiders-released
    and removed
    unreleased
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugchatinsiders-releasedon-testplan

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions