Skip to content

chore(deps): pin mcp <2.0 to guard _compat.py shim - #125

Merged
mlorentedev merged 2 commits into
masterfrom
chore/HIVE-115-pin-mcp-sdk
May 23, 2026
Merged

mlorentedev merged 2 commits into
masterfrom
chore/HIVE-115-pin-mcp-sdk

Conversation

@mlorentedev

Copy link
Copy Markdown
Owner

Summary

src/hive/_compat.py monkey-patches private attributes on mcp.shared.session.RequestResponder (_completed, _on_complete, _entered, _cancel_scope, __exit__, respond) to work around the cancel-race tracked upstream at modelcontextprotocol/python-sdk#2610.

Until the upstream fix lands, ANY mcp release that renames these internals will silently break the shim. The shim is self-gated and degrades to a WARNING + no-op (no crash), but the cancel-race protection disappears.

Pin mcp>=1.26,<2.0 forces a deliberate review on the next major release — the most likely place for a RequestResponder refactor.

Test plan

  • make check → 573 passed, 2 skipped, 87% coverage; no behaviour change
  • uv lock regenerated; mcp resolves to 1.26.0 (current)
  • Comment in pyproject.toml documents the bump workflow for future maintainers

Bump workflow (when this PR's pin needs widening)

  1. Bump lower bound, hold upper at the next minor
  2. Run pytest tests/test_compat_shim.py — the cancel-race test exercises the shim path
  3. If _compat.apply() returns without WARNING log, the bump is safe
  4. Otherwise, port the shim to the new internal attribute shape

Refs: src/hive/_compat.py docstring.

src/hive/_compat.py monkey-patches private attributes on
mcp.shared.session.RequestResponder (_completed, _on_complete,
_entered, _cancel_scope, __exit__, respond) to work around the
cancel-race tracked at modelcontextprotocol/python-sdk#2610.

Until upstream lands a fix and we can drop the shim, ANY mcp release
that renames these private attributes will silently break the shim.
The shim is self-gated and degrades to a WARNING log + no-op, so the
server doesn't crash — but the cancel-race protection disappears.

Pinning `<2.0` forces a deliberate review on the next major release
(the most likely place for a RequestResponder refactor). When the
upper bound needs lifting, the workflow is:

1. Bump mcp lower bound, hold upper at 2.0
2. Run the suite (in particular tests/test_compat_shim.py)
3. If the shim still applies cleanly (no WARNING in apply() output),
   the bump is safe. Otherwise port the shim to the new internals.

Lock file regenerated: mcp pinned at 1.26.0 (current).

Refs: src/hive/_compat.py docstring; HIVE-115 PR-4 wraps the related
multi-process termination authority via bounded_call.
@mlorentedev
mlorentedev merged commit d43e309 into master May 23, 2026
4 checks passed
@mlorentedev
mlorentedev deleted the chore/HIVE-115-pin-mcp-sdk branch May 23, 2026 02:49
mlorentedev added a commit that referenced this pull request May 23, 2026
#126)

## Summary

Configures Dependabot for three ecosystems, each emitting **ONE grouped
PR per week** (Monday 07:00 America/Denver):

| Ecosystem | Where | Group | Special |
|-----------|-------|-------|---------|
| pip | `/pyproject.toml` + `uv.lock` | all (minor + patch only) | `mcp`
major-version-update **ignored** — see [_compat.py
shim](https://github.com/mlorentedev/hive/blob/master/src/hive/_compat.py)
(tracker
[modelcontextprotocol/python-sdk#2610](modelcontextprotocol/python-sdk#2610))
|
| github-actions | `/.github/workflows/` | all | — |
| npm | `/site` (Astro + Starlight) | all (minor + patch only) |
separate PR so docs-site bumps don't mix with Python |

Three PRs/week ceiling under normal load — well below the "20 stale
Dependabot PRs" failure mode that prompted this.

## Why grouped weekly instead of per-package daily?

- Per-package daily produces a long backlog of one-line PRs nobody
triages
- Grouped weekly produces ONE rebase-able PR per ecosystem the
maintainer can review in 5 minutes
- `make check` runs on every PR via existing CI, so regressions are
caught before merge

## Test plan

- [x] YAML syntax validates locally (visually + against Dependabot
schema; will get rejected at PR time if invalid)
- [ ] First Dependabot run after merge (next Monday) opens at most 3 PRs
total

Refs: HIVE-115 follow-up; pairs with PR #125 (mcp `<2.0` pin).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant