Skip to content

fix(deps): cap kiota below 1.13 — /me was reaching the wire as the SDK placeholder - #81

Merged
mpalermiti merged 2 commits into
mainfrom
fix/cap-kiota-below-1.13
Sep 30, 2026
Merged

mpalermiti merged 2 commits into
mainfrom
fix/cap-kiota-below-1.13

Conversation

@mpalermiti

Copy link
Copy Markdown
Owner

Fixes #80.

A fresh uv tool install outlook-graph-mcp==1.22.0 resolves microsoft-kiota-* 1.14.0 today, and every /me call fails with me-token-to-replace is invalid. Every new user's install is broken right now; every developer and CI install is green. That asymmetry is the whole bug.

Root cause, verified against the installed packages

  • kiota 1.13.0 (2026-09-18) moved per-request options from a monkey-patched request.options attribute to request.extensions["kiota_request_options"], and its UrlReplaceHandler now reads only the new place. Diffed kiota_http 1.12.3 → 1.13.0 to confirm.
  • msgraph-core 1.5.1 — the latest release, July — still reads request.options at middleware/async_graph_transport.py:29. So the rewrite it installs for /users/me-token-to-replace → /me never fires and Graph gets the literal placeholder.
  • Upstream fix: fix: honor Kiota request extensions in Graph transport microsoftgraph/msgraph-sdk-python-core#1129, opened 2026-09-22, open and unreleased. msgraph-core pins kiota <2.0, so nothing upstream excludes 1.13/1.14.
  • Nothing in pyproject.toml capped kiota. uv.lock pins 1.12.3 — which is why uv sync, all four CI jobs and every developer install passed while the published package was broken.

The fix

Cap microsoft-kiota-{abstractions,http,authentication-azure,serialization-json} < 1.13 with a comment that says exactly when to lift it (a msgraph-core release carrying #1129). The lock is unchanged.

The guard, because the cap alone would just move the next one

The install canaries imported the package, counted tools and ran the CLI — they never sent a request, so they could not see a URL. tests/test_me_rewrite_reaches_the_wire.py builds the client exactly the way msgraph does, hands the factory an httpx client on a mock transport, and asserts on the URL the real middleware pipeline hands to it. No network. It runs against whatever kiota/msgraph-core the environment resolved — under the lock it pins the rewrite; in the fresh-install and published-install jobs it fails the moment a dependency drifts outside the working range. Both jobs now run it as a script after their version report.

Verified by mutation, not by assertion:

kiota 1.12.3 (the lock)     -> https://graph.microsoft.com/v1.0/me                        OK
kiota 1.14.0 (fresh resolve) -> https://graph.microsoft.com/v1.0/users/me-token-to-replace  FAIL

Expect the weekly published-install job to go red as soon as this merges — it installs PyPI-latest, which is 1.22.0, which is broken. That's the canary working. It goes green when the next release ships, which is the argument for shipping it soon.

Notes

  • 1037 offline, ruff clean, suite run with HOME redirected.
  • Touches .github/workflows/ci.yml, so this needs the workflow scope or a UI merge.
  • This was reported by a first-time user with a reproduction table that pointed straight at the cause. Credited in the CHANGELOG.

Generated with Claude Code

https://claude.ai/code/session_01LparmojWQ3m9tcJhRGqZjP

…K placeholder

A fresh `uv tool install outlook-graph-mcp` resolved microsoft-kiota-*
1.13+ and every /me call failed with "me-token-to-replace is invalid"
(#80). kiota 1.13.0 (2026-09-18) moved per-request options from a
monkey-patched `request.options` attribute to
`request.extensions["kiota_request_options"]`, and its UrlReplaceHandler
now reads only the new place. msgraph-core 1.5.1, the latest release,
still reads `request.options` in middleware/async_graph_transport.py, so
the rewrite it installs for `/users/me-token-to-replace` -> `/me` never
fires and Graph receives the literal placeholder. The upstream fix is
microsoftgraph/msgraph-sdk-python-core#1129, open and unreleased.

Nothing capped kiota; msgraph-core itself allows <2.0. The lock pinned
1.12.3, so `uv sync`, every CI job and every developer install were
green while every new user's install was broken — the fresh-install
and published-install canaries imported the package, counted the tools
and never sent a request. Same class as the five-week outage.

The kiota family is capped below 1.13 until a msgraph-core release
carries #1129; the lock is unchanged at 1.12.3.

tests/test_me_rewrite_reaches_the_wire.py builds the client exactly
as msgraph does, hands the factory an httpx client on a mock transport,
and asserts on the URL the real middleware pipeline sends. It runs
against whatever the environment resolved, which is the point. Verified
by mutation: under the lock it passes; against kiota 1.14.0 it fails on
`.../users/me-token-to-replace`. Both install jobs in ci.yml now run it
as a script after their version report. Note the published-install job
installs PyPI-latest, which IS broken, so that weekly job will be red
until the next release ships — that is the canary doing its job.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LparmojWQ3m9tcJhRGqZjP
Graph tolerates /users/<anything> one segment deep, so a bare /me health
check returns 200 with the placeholder still in the URL while every nested
path 404s. A canary that probed Graph with /me alone would stay green
(Nyaecho, #80). Asserting on the URL string catches both; the nested case
carries the explanation.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LparmojWQ3m9tcJhRGqZjP
@mpalermiti
mpalermiti merged commit d16bd30 into main Sep 30, 2026
12 checks passed
@mpalermiti
mpalermiti deleted the fix/cap-kiota-below-1.13 branch September 30, 2026 00:10
mpalermiti added a commit that referenced this pull request Sep 30, 2026
…K placeholder (#81)

* fix(deps): cap kiota below 1.13 — /me was reaching the wire as the SDK placeholder

A fresh `uv tool install outlook-graph-mcp` resolved microsoft-kiota-*
1.13+ and every /me call failed with "me-token-to-replace is invalid"
(#80). kiota 1.13.0 (2026-09-18) moved per-request options from a
monkey-patched `request.options` attribute to
`request.extensions["kiota_request_options"]`, and its UrlReplaceHandler
now reads only the new place. msgraph-core 1.5.1, the latest release,
still reads `request.options` in middleware/async_graph_transport.py, so
the rewrite it installs for `/users/me-token-to-replace` -> `/me` never
fires and Graph receives the literal placeholder. The upstream fix is
microsoftgraph/msgraph-sdk-python-core#1129, open and unreleased.

Nothing capped kiota; msgraph-core itself allows <2.0. The lock pinned
1.12.3, so `uv sync`, every CI job and every developer install were
green while every new user's install was broken — the fresh-install
and published-install canaries imported the package, counted the tools
and never sent a request. Same class as the five-week outage.

The kiota family is capped below 1.13 until a msgraph-core release
carries #1129; the lock is unchanged at 1.12.3.

tests/test_me_rewrite_reaches_the_wire.py builds the client exactly
as msgraph does, hands the factory an httpx client on a mock transport,
and asserts on the URL the real middleware pipeline sends. It runs
against whatever the environment resolved, which is the point. Verified
by mutation: under the lock it passes; against kiota 1.14.0 it fails on
`.../users/me-token-to-replace`.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LparmojWQ3m9tcJhRGqZjP

* test(wire): the nested /me path is rewritten too, and says why

Graph tolerates /users/<anything> one segment deep, so a bare /me health
check returns 200 with the placeholder still in the URL while every nested
path 404s. A canary that probed Graph with /me alone would stay green
(Nyaecho, #80). Asserting on the URL string catches both; the nested case
carries the explanation.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LparmojWQ3m9tcJhRGqZjP

(cherry picked from commit d16bd30 onto v1.22.0 for the
1.22.1 hotfix; CHANGELOG entry rewritten as a 1.22.1 section. The ci.yml step that runs
this test in the install jobs is not part of #81 as merged and is not included here.)

---------

Co-authored-by: Michael Palermiti <253352132+mpalermiti@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
mpalermiti added a commit that referenced this pull request Sep 30, 2026
Hotfix cut from v1.22.0 carrying only the kiota cap (#81), so a fresh
install stops sending /users/me-token-to-replace to Graph (#80). Version
bumped in pyproject.toml, both server.json fields and the lock. Tool
count unchanged at 62, so the published-install assert in ci.yml stays
correct.

Co-Authored-By: Claude <noreply@anthropic.com>
mpalermiti added a commit that referenced this pull request Sep 30, 2026
)

#81's entry said the fresh-install and published-install jobs assert the
resolved kiota version. That ci.yml step was never pushed (it needs a
token with the workflow scope), so main made a claim its CI doesn't back.
The entry moves out of [Unreleased] into a 1.22.1 section matching the
hotfix branch (release/1.22.x), with the wording describing the test that
does exist.

Merge after v1.22.1 is published.

Co-authored-by: Michael Palermiti <253352132+mpalermiti@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.

me-token-to-replace is invalid on fresh install — microsoft-kiota >=1.13.0 breaks /me calls

1 participant