claude-code - 💡(How to fix) Fix linear-server MCP tool calls intermittently fail with user-rejection error during long sessions (hang / block / disconnect — root cause unknown) [2 comments, 3 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#51674Fetched 2026-04-22 07:55:55
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

Error Message

During long Claude Code sessions using the linear-server MCP, tool calls (list_issues, save_comment, save_issue) intermittently return an error shape identical to a user-initiated rejection: The user did not reject the tool call. From the agent side we cannot distinguish whether the MCP server hung, timed out, blocked, or disconnected — the error text is the same.

  • After ~30-60 minutes of active use, tool calls begin failing intermittently with the user-rejection error shape.
  1. A distinct error signal for transport-level MCP failures vs genuine user rejection, so the agent doesn't misattribute causality.

Fix Action

Workaround

/mcp reconnect when the failure shape appears.

RAW_BUFFERClick to expand / collapse

Observed symptom

During long Claude Code sessions using the linear-server MCP, tool calls (list_issues, save_comment, save_issue) intermittently return an error shape identical to a user-initiated rejection:

"The user doesn't want to proceed with this tool use.
 The tool use was rejected (eg. if it was a file edit,
 the new_string was NOT written to the file).
 STOP what you are doing and wait for the user to tell
 you how to proceed."

The user did not reject the tool call. From the agent side we cannot distinguish whether the MCP server hung, timed out, blocked, or disconnected — the error text is the same.

Reproduction

  • Long Claude Code session with frequent linear-server tool invocations.
  • After ~30-60 minutes of active use, tool calls begin failing intermittently with the user-rejection error shape.
  • /mcp reconnect restores the tool set; after reconnect the same tool calls succeed.

Impact

  • False-positive user-rejection signal: the agent treats the failure as user intervention and stops / pivots incorrectly. The conversation log records a "user rejection" that the user never issued. Agents using the log for behavior-tuning learn the wrong lesson.
  • Mid-turn interruption during autonomous or peer-review loops, requiring a manual /mcp reconnect to resume.

Workaround

/mcp reconnect when the failure shape appears.

Environment

  • Claude Code CLI (version TBD)
  • linear-server MCP (official Linear hosted server)
  • Linux (WSL2), long-running interactive session

Ask

  1. A distinct error signal for transport-level MCP failures vs genuine user rejection, so the agent doesn't misattribute causality.
  2. Root-cause investigation of the hang / block / disconnect pattern on long sessions.

extent analysis

TL;DR

Implement a retry mechanism with a distinct error handling for transport-level MCP failures to differentiate them from genuine user rejections.

Guidance

  • Investigate the linear-server MCP connection management to identify potential causes of hang, block, or disconnect patterns during long sessions.
  • Consider implementing a heartbeat or keep-alive mechanism to maintain the connection and prevent timeouts.
  • Develop a custom error handling mechanism to catch and retry tool calls that fail with the user-rejection error shape, allowing the agent to distinguish between genuine user rejections and transport-level failures.
  • Analyze the conversation log to identify patterns or correlations between the false-positive user-rejection signals and other system events.

Example

# Pseudo-code example of a retry mechanism with custom error handling
def tool_call_retry(tool_call):
    max_retries = 3
    for attempt in range(max_retries):
        try:
            # Perform the tool call
            response = perform_tool_call(tool_call)
            if response.error_shape == "user_rejection":
                # Custom error handling for transport-level failures
                if is_transport_failure(response):
                    # Retry the tool call
                    continue
                else:
                    # Genuine user rejection, stop and wait for user input
                    break
            else:
                # Successful tool call, return the response
                return response
        except Exception as e:
            # Handle other exceptions
            print(f"Error: {e}")
    # Max retries exceeded, raise an error
    raise Exception("Max retries exceeded")

def is_transport_failure(response):
    # Custom logic to determine if the error is a transport-level failure
    # This could involve analyzing the error message, response headers, or other factors
    pass

Notes

The provided example is a pseudo-code illustration and may require modifications to fit the actual implementation. The is_transport_failure function is a placeholder for custom logic to determine if the error is a transport-level failure.

Recommendation

Apply a workaround by implementing a retry mechanism with custom error handling, as this will allow the agent to distinguish between genuine user rejections and transport-level failures, reducing the impact of false-positive user-rejection signals.

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

claude-code - 💡(How to fix) Fix linear-server MCP tool calls intermittently fail with user-rejection error during long sessions (hang / block / disconnect — root cause unknown) [2 comments, 3 participants]