Skip to content

fix(session): unbrick MCP under Plaud 30-day tokens; add plaud refresh (v0.5.0)#135

Merged
massive-value merged 1 commit into
mainfrom
fix/token-expiry-30day-and-refresh
Jun 22, 2026
Merged

fix(session): unbrick MCP under Plaud 30-day tokens; add plaud refresh (v0.5.0)#135
massive-value merged 1 commit into
mainfrom
fix/token-expiry-30day-and-refresh

Conversation

@massive-value

Copy link
Copy Markdown
Owner

Why

Plaud shortened token lifetimes from ~291 days to 30 days. SessionManager.require() hard-rejects any token within TOKEN_REFRESH_BUFFER_SECONDS of expiry, and that buffer was 30 days — so every freshly-issued token was already inside the buffer and require() raised PlaudSessionExpiredError on every call. The MCP returned session_expired for everything, even right after signing in.

Changes

  • session.pyTOKEN_REFRESH_BUFFER_SECONDS 30 days → 3 days. This is the load-bearing fix that unbricks the MCP.
  • tray/app.py — "expiring soon" warning threshold 30 → 3 days (otherwise the tray shows it permanently on a healthy fresh token).
  • cli.py — new plaud refresh command: re-auths the stored session, reusing saved email/region; only prompts for the password (--email/--region/--password override). Plaud has no refresh-token grant, so this is a full credential re-auth. No MCP equivalent by design — avoids routing a password through an AI client's context.

Tests

Full suite green (812 passed, 2 skipped). New refresh flow exercised against a fake auth/store (reuse + region override).

🤖 Generated with Claude Code

…sh` (v0.5.0)

Plaud shortened token lifetimes from ~291 days to 30 days. require()'s
TOKEN_REFRESH_BUFFER_SECONDS hard-rejects any token within the buffer of
expiry, and that buffer was 30 days — so every freshly-issued token tripped
it and the MCP returned session_expired on every call. Drop the buffer to
3 days; move the tray "expiring" warning threshold from 30 to 3 days to match.

Also add a `plaud refresh` CLI command that re-auths the stored session,
reusing saved email/region (Plaud has no refresh-token grant, so it is a full
credential re-auth). No MCP equivalent by design — avoids routing a password
through an AI client's context.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@massive-value massive-value merged commit 9f729c5 into main Jun 22, 2026
14 checks passed
@massive-value massive-value deleted the fix/token-expiry-30day-and-refresh branch June 22, 2026 04:25
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