claude-code - 💡(How to fix) Fix Claude misinterprets ADO PR status enum (1=Active read as "merged") [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#60654Fetched 2026-05-20 03:52:54
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Root Cause

In practice Claude (Opus, Sonnet) repeatedly reads status: 1 as "completed/merged" — probably because 1 reads like "true/first state" without enum context, and the adjacent mergeStatus: 3 + populated lastMergeCommit reinforce the wrong conclusion.

RAW_BUFFERClick to expand / collapse

Problem

The Microsoft azure-devops MCP server (mcp__azure-devops__repo_get_pull_request_by_id) returns ADO PR state as raw numeric enums:

  • status: 1 — Active (open)
  • status: 2 — Abandoned
  • status: 3 — Completed (merged)
  • mergeStatus: 3 — Succeeded (the preview merge computed cleanly, NOT that the PR has merged)
  • lastMergeCommit — present on open PRs too; it's the preview commit, not a record of an actual merge

In practice Claude (Opus, Sonnet) repeatedly reads status: 1 as "completed/merged" — probably because 1 reads like "true/first state" without enum context, and the adjacent mergeStatus: 3 + populated lastMergeCommit reinforce the wrong conclusion.

Impact

Claude confidently tells the user "this PR is merged" when it is open and awaiting review. This is not a one-off; it has happened multiple times in a single day for this user, and any ADO MCP user is exposed to the same defect.

Suggested fixes (any of)

  1. Translate enums in the MCP response. Return "status": "active" (string) or add "statusName": "Active" alongside the integer.
  2. System-prompt guidance in Claude Code when the ADO MCP server is configured — inline the enum tables for PullRequestStatus and PullRequestAsyncStatus so the model has the mapping in context.
  3. Document the gotcha in the ADO MCP server README so wrappers/users can normalize on their side.

Option 1 is the durable fix and applies to every model/host calling the server.

Reference

ADO REST API enum reference: Microsoft.TeamFoundation.SourceControl.WebApi.PullRequestStatus and PullRequestAsyncStatus.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING