Skip to content

browse_mr_discussions hangs without default pagination #97

@polaz

Description

@polaz

Problem

browse_mr_discussions with action list can hang for extended periods (observed 80+ seconds) when fetching discussions without explicit per_page parameter.

Root Cause Analysis

  1. No default pagination - Unlike other tools that use PaginationOptionsSchema with per_page default of 20, browse_mr_discussions has no default
  2. Large response payload - Discussion responses include:
    • Full diff context for each discussion
    • Position data (base_sha, head_sha, paths, line numbers)
    • Nested notes with full content
    • System notes and metadata
  3. Production timeout too high - 300 seconds allows requests to hang too long

Evidence from Logs

Jan 21 23:49:29 - Executing tool: browse_mr_discussions
Jan 21 23:50:49 - Next request (80 seconds later, no completion log)

No completion or error logged - request just hangs.

Solution

  1. Add default per_page: 20 to ListMrDiscussionsSchema
  2. Update tool description to document the default
  3. Reduce default timeout from 300s to 20s

Affected Code

  • src/entities/mrs/schema-readonly.ts - ListMrDiscussionsSchema
  • src/entities/mrs/registry.ts - tool description
  • src/config.ts - API_TIMEOUT_MS default

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions