Skip to content

fix(mcp): bound the gh resources longer than a GitHub read - #4844

Merged
dan-petty merged 5 commits into
mainfrom
fix/4678-bound-gh-resources-past-read
Nov 11, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/4678-bound-gh-resources-past-read

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Each of the four resource://gh/ resources of the MCP server now dispatches its command with DEFAULT_MCP_TOOL_TIMEOUT_SECONDS (300 s), not DEFAULT_MCP_TOOL_FAST_TIMEOUT_SECONDS (30 s). resource://gh/issues/status reads the issues through the GitHub session, and each session read waits up to 60 s (#4626). With a bound of 30 s, a read that got no answer stopped the dispatch with exit code 124, and the error of the read was lost. Now the read fails first and the resource returns its error: each inner timeout is shorter than the call around it. The chain test of the bounds around a GitHub read holds a second chain for the MCP read of a resource://gh/ resource, and a new test checks the bound of each resource://gh/ resource. ADR 0006 and the comment of the read bound name the calls around a read. #4784 gives the same bound to the MCP tools that read GitHub.

Closes #4678

Change: openspec/changes/archive/2026-11-11-4678-bound-the-gh-resources-longer-than/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/mcp Model Context Protocol tools, system resources, and prompts labels Nov 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record

All runs are on the final code, rebased onto origin/main, in the devcontainer.

Check Command Result
Static rows uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures 10 of 10 pass
Tests of the changed modules uv run devops ci test tests/ai/mcp/ tests/github/test_github_session_timeouts.py tests/github/test_github_session.py 692 passed
Narrow tests after the last rebase uv run devops ci test tests/ai/mcp/test_mcp_prompts_and_resources.py tests/github/test_github_session_timeouts.py tests/github/test_github_session.py 84 passed
Types uv run mypy src/devops_cli/ai/mcp/server.py src/devops_cli/config/defaults.py no issues in 2 files
Pre-push rows uv run devops ci --check --only lint,format pass

The full local gate (uv run devops ci) did not run to the end. An earlier run passed 49 rows; its pytest and coverage row stopped at its 30-minute limit under host load, not on a test failure. The required CI checks of this pull request are the merge gate.

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main:

  passed on base: tests.github.test_github_session_timeouts::test_each_bound_of_the_chain_is_shorter_than_the_bound_around_it[DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS-DEFAULT_MCP_TOOL_TIMEOUT_SECONDS]
  passed on base: tests.github.test_github_session_timeouts::test_each_bound_of_the_chain_is_shorter_than_the_bound_around_it[DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS-DEFAULT_ROADMAP_IMPLEMENT_MONITOR_TIMEOUT_SECONDS]
  passed on base: tests.github.test_github_session_timeouts::test_a_host_that_does_not_answer_fails_the_read_at_the_sessions_read_bound
  passed on base: tests.github.test_github_session_timeouts::test_each_bound_of_the_chain_is_shorter_than_the_bound_around_it[DEFAULT_VALKEY_TIMEOUT_SECONDS-DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS]
  failed on base: tests.ai.mcp.test_mcp_prompts_and_resources::test_each_gh_resource_waits_longer_than_a_github_read (AssertionError: assert {'resource://...status': 30.0} == {'resource://...tatus': 300.0})
  passed on base: tests.ai.mcp.test_mcp_prompts_and_resources::test_fastmcp_prompts_rendering
  passed on base: tests.ai.mcp.test_mcp_prompts_and_resources::test_fastmcp_prompts_and_resources_registration
  passed on base: tests.ai.mcp.test_mcp_prompts_and_resources::test_mcp_prompts_execution
1 failed on base (1 failed and 7 passed in tests/ai/mcp/test_mcp_prompts_and_resources.py, tests/github/test_github_session_timeouts.py; 0 errored).

The new pair DEFAULT_GH_SESSION_READ_TIMEOUT_SECONDS < DEFAULT_MCP_TOOL_TIMEOUT_SECONDS passes on base, because both constants exist there. The defect is the bound that the resources used, and the resource test finds it.

Notes

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 22:12
@dan-petty
dan-petty enabled auto-merge (squash) November 11, 2026 22:12
@dan-petty
dan-petty merged commit 7f09921 into main Nov 11, 2026
26 checks passed
@dan-petty
dan-petty deleted the fix/4678-bound-gh-resources-past-read branch November 11, 2026 22:23
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.114.0](v0.113.0...v0.114.0)
(2026-11-11)


### Features

* **k8s:** add cert-manager and the Barman Cloud plugin
([#4789](#4789))
([cd6fb76](cd6fb76))
* **roadmap:** collect the git facts of a project review window
([#4794](#4794))
([21d1bc0](21d1bc0))
* **roadmap:** consolidate has a read-only MCP mirror
([#4807](#4807))
([2ec561d](2ec561d))


### Bug Fixes

* **ai:** devops ai agents detects the project manifest
([#4790](#4790))
([e8d1e53](e8d1e53))
* **mcp:** bound the gh resources longer than a GitHub read
([#4844](#4844))
([7f09921](7f09921))
* **roadmap:** run stage before refine on the model lane
([#4841](#4841))
([96c9bee](96c9bee))
* **roadmap:** stop refusing test paths in base docstrings
([#4826](#4826))
([1bbfce0](1bbfce0))
* **telemetry:** key the project gauges by repository
([#4804](#4804))
([9f0e0c8](9f0e0c8))


### Performance Improvements

* **ci:** run the in-image suite nightly and on image pull requests
([#4828](#4828))
([a2cfd9a](a2cfd9a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/mcp Model Context Protocol tools, system resources, and prompts type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(mcp): bound the gh resources longer than a GitHub read

1 participant