Skip to content

[Bug]: Azure DevOps PR Code tab disables line selection, so "Add to agent" is unreachable #19608

Closed

Description

@olegbal

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Add a project whose remote is an Azure DevOps Services repository (dev.azure.com), with az + the azure-devops extension signed in.
  2. Open one of its pull requests in the pull request panel and switch to the Code tab. The diff renders fine.
  3. Try to select a line range (or use the gutter button) in order to use Add to agent and ask the agent about those lines.

Expected behavior

Line selection and Add to agent work the same way they do for a GitHub pull request. Sending a selection to the local agent does not post anything to the host, so it should not depend on whether the host supports writing review comments.

Actual behavior

Line selection and the gutter utility are disabled entirely for Azure DevOps pull requests, so there is no way to reach Add to agent from the Code tab.

The cause: in PullRequestCodeTab.tsx, both the selection and the draft that carries the Add to agent secondary action are gated on the host's ability to post inline review comments:

The Azure DevOps provider deliberately declares review: { inlineComment: false, ... }, so canCommentOnLines is always false there and the agent path goes away with it. The same presumably applies to any host, or any viewer without comment permission, where inlineComment resolves to false.

A possible fix: gate selection on review.inlineComment || onAddToAgentSelection !== undefined, and when the host cannot comment, open a draft that offers only Add to agent (no "Add to review").

Impact

Major degradation or frequent failure

Version or commit

v0.0.45; the gating is unchanged on main @ 348f217

Environment

Azure DevOps Services (dev.azure.com) repository, Azure CLI with the azure-devops extension, T3 Code server on Linux

Workaround

Reference lines manually in the chat composer (path/to/File.kt:42) instead of selecting them in the Code tab.

Activity

  1. juliusmarminge commented on Oct 14, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Confirmed on main: this is a bug, not intended gating. In PullRequestCodeTab.tsx, canCommentOnLines (L375) is derived from review.inlineComment, and that one flag controls beginComment, enableGutterUtility, and enableLineSelection. Add to agent only shows up as a secondary action on that same draft, so it disappears whenever the host can't post inline comments. Azure DevOps hard-codes inlineComment: false (AzureDevOpsPullRequestProvider.ts L72), and L368 also ANDs in viewer.comment. That means a GitHub viewer without comment permission loses Add to agent too, even though it never writes to the host.

    The PR view has no other entry point for Add to agent (no context menu or Files-panel action), so the only workaround is the one you gave: reference path:line in the composer.

    Direction: gate selection on review.inlineComment || onAddToAgentSelection, and when commenting isn't available, open a draft that offers only Add to agent.

  2. added
    acceptedfeature request accepted
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 14, 2026
  3. t3-code-bot commented on Oct 21, 2026

    @t3-code-bot
    Contributor

    closing as addressed by #19701, merged into main: the PR Code tab allows local Add to agent line selection independently of host inline-comment permission, including Azure DevOps. Agent-only submission does not queue or post a host review.

    thanks for reporting this. if you still face it on a build containing this fix, please ask us to reopen this issue or open a new issue linking back here, with your version, os and reproduction steps.

    closed at the request of @UtkarshUsername.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions