~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Disconnecting an assistant can get its client deleted, so reconnecting fails

Closed
Closed chadtmiller.com opened this issue 0 comments

What happened

whenever anyone registers a client, the sweep deletes every client over a day old whose id has no assistant_grant row. The comment says it removes "one never connected", but it also removes a client the member connected and then disconnected, because disconnect_assistant deletes the rows. - A day later, the assistant reconnects with its stored client_id. - /mcp/authorize answers with a plain 400, "no client by that client_id", which is not an OAuth redirect the assistant can act on. - The member has to remove the assistant and add it again. It also works the other way: lapsed assistant_grant rows are never deleted (only on put-out, group deletion or disconnect), so a client whose connection lapsed is kept forever. The test forgets_a_client_that_never_connected covers only a client that never connected.

How to see it

Read against docs/fresh at 4636e6d, the code at: crates/group-host/src/assistants.rs:124-126 (and :201-224, :789-805). Paths are under crates/group-host/src unless they say otherwise. Severity: medium.

What you expected

Sweep only clients that never had a grant, for example by marking a client when it first connects. Delete assistant_grant rows once expires_at has passed.

Where

The host, as built from 4636e6d. Found while checking the docs against the code.