fix(setup): stop telling him the recovery key is wrong when the token is dead #141
No reviewers
Labels
No labels
blocked
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
waiting-on-julian
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jlxq0/matrix-mcp!141
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "setup-401-message"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
He was shown this, and re-entered a correct key twice, at an airport an hour before a flight:
M_UNKNOWN_TOKENcannot be caused by a wrong recovery key. The key is used client-side against Secret Storage and never reaches the homeserver as a token. The handler attributed every failure to the last thing typed, which is a check that cannot observe its subject and fails in the direction that costs the user time and tells them nothing.What it says now
The 401 is classified as an expired session, with a 401 status rather than a 400. Everything else says plainly that this page cannot tell which of two causes it is, quotes the server's own words, and suggests checking the key as the cheaper of the two without asserting that it is the cause. A confident wrong attribution sends someone to fix a thing that is not broken.
Which token died, which decides the wording
Not the browser session's.
recoverdeliberately reuses the cached matrix-sdk client, which holds the bearer from the MCP client's tool calls rather than/setup's own OAuth token, because routing its own token in panics matrix-sdk 0.17 withAlreadyInitializedError. So his browser session was probably fine and the MCP bearer had expired, which is why the message offers one tool call before a re-sign-in.The cause, recorded rather than fixed here
Both are larger than a message and are in
AGENTS.md:expires_inis parsed from the token response and used nowhere, so nothing tracks the lifetime MAS gave the token.react_to_auth_expiry, which is how the MCP path notices this exact condition, evicts and rebuilds the client.Mutations
The classifier disabled, and the lowercasing removed so only the shouty form matches. Each reddens the two classification tests, and the unclassified control stays green because it must pass either way.
Not in this repository
The consent screen reading
Continue to 00000000000000000MATR1XMCP?with(no client_uri provided)is MAS configuration, not ours. This server uses a pre-registered client id fromMATRIX_MCP_INTROSPECTION_CLIENT_IDand does no dynamic registration: there is noclient_name,client_uriorredirect_urisanywhere in the tree.client_nameandclient_uribelong in MAS's own client registry.Gates: fmt, clippy
-D warnings,301 passed; 0 failed, audit clean, deny ok.