Repository navigation
Description
Problem Description
The GitHub session waits at most DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS (60 s) for each read (#4626). Many MCP tools of CONST_MCP_EXPOSURE_TABLE (src/devops_cli/config/constants.py) run a devops gh or devops pr command that reads GitHub, with a bound of 60 s or 30 s. The owner rule of 2026-11-11 says that each inner timeout is shorter than the call around it, with a margin. A bound that is equal to the read bound or shorter breaks the rule: the dispatch can stop first with exit code 124 Command timed out, and the GitHubUnreadError of the read is lost.
Census on main (CONST_MCP_EXPOSURE_TABLE, entries with a bound of 60 s or less): 23 gh tools and 11 pr tools. The census does not show which of them read GitHub; the item decides each one. Example: ("gh", "issues", "status"), 60.0 runs the same command as resource://gh/issues/status, which reads the issues through the GitHub session.
#4678 fixes the 4 resource://gh/ resources of the MCP server only.
Reproduction Steps
- Read
CONST_MCP_EXPOSURE_TABLEinsrc/devops_cli/config/constants.py. - Find the
ghandprtools whose bound is 60.0 or 30.0. - Compare each bound with
DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS(60 s) insrc/devops_cli/config/defaults.py.
Expected vs Actual Behavior
Expected: each MCP tool whose command reads GitHub has a bound that is longer than the session read bound, with a margin, and the chain test tests/github/test_github_session_timeouts.py holds it.
Actual: 34 gh and pr tools have a bound of 60 s or less. The table also holds the bounds as numbers with no name.
Environment Diagnostics
devops-cli main, after #4678.
Logs, Traces, or Terminal Output
None. The census reads the source.
Source: #4678
Alternatives check of 2026-11-14: none.
Tool: none found.
Proposed design
Problem statement
The GitHub session stops a read at 60 s. Many gh and pr MCP tools use a dispatch bound of 60 s or 30 s. The dispatch can stop first with exit 124 Command timed out, and the GitHubUnreadError of the read is lost. The change gives each GitHub-reading MCP tool a named bound of 300 s, and the chain test holds it.
Acceptance criteria
Requirement: GitHub MCP tools use a named bound
Each gh and pr tool in CONST_MCP_EXPOSURE_TABLE SHALL use the named bound CONST_MCP_GITHUB_TOOL_TIMEOUT_SECONDS.
Scenario: The GitHub MCP rows use the named bound
- WHEN The test reads every
ghandprrow ofCONST_MCP_EXPOSURE_TABLE. - THEN Each row's timeout equals
CONST_MCP_GITHUB_TOOL_TIMEOUT_SECONDS, and that value is 300.0.
Requirement: GitHub MCP tools outlast a GitHub read
Each gh and pr MCP tool MUST have a dispatch bound that is longer than DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS.
Scenario: A short GitHub MCP bound fails
- WHEN A
ghorprrow has a timeout at or belowDEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS. - THEN The chain test fails and names the command path and its timeout.
Requirement: A write tool also outlasts a GitHub read
A gh or pr MCP tool that writes to GitHub SHALL also have a dispatch bound longer than the GitHub session read bound.
Scenario: A write tool gets the GitHub MCP bound
- WHEN The test reads the
gh issue closerow and thepr readyrow. - THEN Each row has the timeout
CONST_MCP_GITHUB_TOOL_TIMEOUT_SECONDS, above 60 s.
Requirement: The chain test holds the GitHub MCP table
The chain test tests/github/test_github_session_timeouts.py SHALL check each gh and pr row against DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS.
Scenario: The chain test covers the exposure table
- WHEN The chain test runs with the exposure table.
- THEN The test passes when every
ghandprrow is above 60 s, and fails on a row at or below 60 s.
Existing Tool Considered
The alternatives check of 2026-11-14 returned none and found no tool. No open, maintained library covers a project-specific MCP timeout table. The change edits one constant, the gh and pr rows of CONST_MCP_EXPOSURE_TABLE, and the existing chain test. The written cost is one small pull request, with one constant, the table rows and one test. The project keeps this table for every MCP tool, so the change adds no new subsystem to keep.
Key questions
- Which MCP tools read GitHub?: All
ghandprrows read GitHub. A write command reads GitHub before it writes. The change applies the GitHub MCP bound to everyghandprrow. (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/commands/pr.py, src/devops_cli/github/issues.py, docs/adr/0006-github-session-requests-go-through-gidgethub.md]- Chosen: All
ghandprrows. Every command in these groups sends at least one GitHub request. A write command reads before it writes, so the read bound applies. - Rejected: Only rows with
read_only=True. Theread_onlyflag says the tool writes nothing. It does not say the tool reads nothing. A write tool would keep the 60 s risk. - Rejected: Audit each command separately. No
ghorprcommand avoids GitHub, so the audit adds work with no different result.
- Chosen: All
- What margin above the 60 s GitHub read does the change use?: Use 300 s. The existing MCP read bound is 300 s, and
resource://gh/reads already use it. The margin is 240 s. (best practice) [sources: src/devops_cli/config/defaults.py, tests/github/test_github_session_timeouts.py, docs/adr/0006-github-session-requests-go-through-gidgethub.md]- Chosen: 300 s, the existing MCP read bound. The chain test already holds
DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDSbelowDEFAULT_MCP_TOOL_TIMEOUT_SECONDS(300 s). The margin is 240 s. - Rejected: 120 s. It leaves 60 s. The project has no evidence for this margin, and it is below the existing MCP read bound.
- Rejected: 90 s. It leaves 30 s. A slow GitHub read can take almost 60 s, so this margin is too small.
- Rejected: Keep 60 s. It is equal to the read bound, so the dispatch can stop first and break the owner rule.
- Chosen: 300 s, the existing MCP read bound. The chain test already holds
- How does the table name its GitHub MCP bound?: Add
CONST_MCP_GITHUB_TOOL_TIMEOUT_SECONDStosrc/devops_cli/config/constants.pywith 300.0, and use it for everyghandprrow.constants.pycannot importdefaults.py, becausedefaults.pyimportsconstants.py. (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/config/defaults.py]- Chosen: Add a new constant in
constants.py. The table lives inconstants.py. The constant gives the bound one name and keeps the import direction. - Rejected: Import
DEFAULT_MCP_TOOL_TIMEOUT_SECONDSintoconstants.py.defaults.pyimportsconstants.py, so this import is circular. - Rejected: Leave
300.0literals in the table. The issue reports that the table holds bare numbers with no name. A literal leaves that problem in place.
- Chosen: Add a new constant in
- How does the chain test cover the exposure table?: Extend
tests/github/test_github_session_timeouts.pywith a loop over theghandprrows. Keep the existing strict less-than test. (best practice) [sources: tests/github/test_github_session_timeouts.py]- Chosen: Extend the existing chain test. The issue names this test. It already holds the inner-shorter-than-outer rule, so the MCP table chain belongs there.
- Rejected: Add a new test file. It duplicates the chain test and splits the timeout rule across two files.
- Rejected: Change only the table values. No test would stop a later row at 60 s or less.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(mcp)scope of the title gives the scope.34 tools lose their GitHubUnreadError when the dispatch bound fires first, but the system still returns a timeout exit code.Users get a generic exit 124 instead of the specific GitHub error on 34 tools, which hinders diagnosis.The change updates 34 numeric bounds in one constants table and adjusts one chain test.Both items work on the timeout layering rule; #4626 set the inner 60 s bound, the candidate fixes the outer MCP tool bounds to exceed it.fix(mcp): bound the gh resources longer than a GitHub read (#4844)
dan-petty commentedon Nov 14, 2026
Cannot build as written without a design: the item asks to decide, for each of 34 gh/pr MCP tools, whether its command reads GitHub, then to give each read a bound above DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS and a chain in tests/github/test_github_session_timeouts.py, and to replace the table's bare numbers with names. The table also mixes reads and writes with the same 60 s bound. No refine block names the classification or the margin (10 s, 20 s, or a ratio), so a change would guess the owner's rule. Refine the item with the read/write list and the margin, or split it: (1) name the bounds, (2) raise the read tools, (3) add the chain test.
devops-cli-service commentedon Nov 14, 2026
Alternatives check: none
Reason: The searches found general MCP timeout guidance and SDK/FastMCP per-tool timeout settings (e.g. server-side
tool_timeout_seconds, per-servertimeoutfields), but none of them covers this need. The issue is an internal change to devops-cli's ownCONST_MCP_EXPOSURE_TABLEbounds and a chain test intests/github/test_github_session_timeouts.py, which no external tool or library provides.Tool: none found
Lacks:
CONST_MCP_EXPOSURE_TABLEaboveDEFAULT_GH_SESSION_READ_TIMEOUT_SECONDSwith a margintests/github/test_github_session_timeouts.pythat holds the inner-shorter-than-outer ruleSearches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Status set to Ready at e5dfddb (see proposed design in issue body).
devops-cli-service commentedon Nov 18, 2026
Released in v0.176.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.176.0
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 13:25 UTC