Provider login gets lost sometimes #245
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck#245
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
For the second time now, the Claude login just dropped and I had to log in again.
Ideally this is fixed, but if not the Forgejo scheduler should be made capable to both notify the user but also delay triggers until the login is back to avoid the user having to chase all the aborted ones
Triage
Two separable problems in one issue, and I'd keep them separable:
AuthStorageownsauth.db), so the fix may well be upstream or environmental.Related issues
No duplicate of the login-loss bug itself exists.
What the code does today
auth-singleton.tsmemoizesdiscoverAuthStorage()from the SDK;routes-auth-oauth.tsonly drivesAuthStorage.login()and aDELETE /providers/:providerthat callscredentials.remove(). Everything else — token refresh, rotation, expiry — happens inside the SDK against~/.omp/agent/auth.db, which is also what theompCLI uses.deriveAuthStateinroutes-auth-oauth.tscollapses a credential tooauth | api-key | unconfiguredwith no expiry, no last-refresh, no probe. So a dead-but-present credential looks identical to a healthy one, and a credential that vanished is only noticed when a turn fails.looksLikeAuthError+maybeSuggestSubscriptionFallbackinbridge/in-process.tsemit a notification if the same model id is reachable through an authenticated subscription provider. For the case "the subscription provider itself lost its login" that hint can't fire — so you get a bare inline error.forgejo/dispatcher.tsheader). That design is right for crashes but wrong for "the turn never started because we had no credential" — in that case nothing was posted and deferring is safe.Clarifying questions
auth.db), or still connected but every turn 401'd? That distinguishes "something deleted the row" from "refresh failed / refresh token revoked".~/.omp/agent/shared with anything else — anompCLI you use in a terminal, a second deck process/container, a mounted volume? Concurrent refreshes with rotating refresh tokens are the classic way an OAuth credential dies: the process that refreshes second presents an already-rotated token and getsinvalid_grant.oauth-routes,auth-singletonand the session error around the first failing turn would say a lot. If not, worth adding logging now so occurrence #3 is diagnosable.actionKind: "prompt"viaroutines-runner.ts) and manually started sessions too, or only Forgejo triggers? A routine firing into a dead login burns silently in exactly the same way.Initial feedback
gatedset already holds rows back for the checkbox settle window, so "hold a claimed row, don't finish it, re-pump on a wake signal" is an existing pattern rather than new machinery. The natural wake signal for this condition is themodels_changedbroadcast thatroutes-auth-oauth.tsalready emits after a successful login.registry.hasConfiguredAuth/isUsingOAuthfor the session's configured model — not a live API probe per trigger. That catches "credential gone" immediately; it does not catch "credential present but rejected". For the second case the honest approach is reactive: classify the first turn failure withlooksLikeAuthError, and if it matches, flip the gate closed and re-queue that trigger instead of posting a failure comment.AuthStoragecredential transition the deck can observe (login, remove, and the auth state seen at each session start) with provider and timestamp. Today there is no record at all of when the credential went away, which is why two occurrences have produced no evidence.I have not reproduced anything here — this is a read of the current code plus the issue text. Happy to go deeper on either half once you've answered 1–3.