Repository navigation
feat(auth): list and disconnect omp's stored provider accounts - #222
Conversation
…ession can follow
The pruning that bounds the job store deletes a `gone` tombstone with no client-visible signal, so a browser that adopted another browser's recording could get a 404 and raise an error toast for a job that had in fact been delivered elsewhere. Only the browser that recorded (or retried) a job holds the audio to fall back on, so only it may report it as a failure; a follower that is locked out of the transcript is standing down by design. The attached-messages toast also blamed the agent for a rule that has nothing to do with it: `sendQueued` refuses attachments whether or not a run is active, and `followUp` is dispatched immediately when the agent is idle. The rule and its explanation are now one predicate, `queueAllowsAttachments`, used by both `sendQueued` and the dictation branch, so they cannot drift apart.
Stop withdrew queued messages one by one from this client's queue snapshot before aborting. A steer missing from that snapshot (promoted after the last queue_update) or claimed by the run but not yet recorded was never withdrawn, and omp drained it into a new turn right after the abort: the user pressed Stop and the steer ran anyway. Stop now sends abort_and_restore_queue, omp's Esc in one step (clearQueue forInterrupt, then abort), and restores the returned texts to the draft. omp without the command falls back to the per-entry withdrawal.
Review of the atomic Stop: - Capture the run fence at the click; a failed request is retried once and only while that run is current, so it can never abort a newer run. - Fall back to per-entry withdrawal only on "Unknown command" (omp without abort_and_restore_queue); any other failure retries the same command, and warns (new localized queueRestoreUncertain) when nothing came back. - Narrow the try to the request; drop an image-only "[Image]" label. - Tests: retry restores, lost response warns, no retry into a newer run, overlapping Stops share one request; tidy the server abort branch.
Prepare ompweb for publisher-default Auto effort in can1357/oh-my-pi#14114. Persist the choice through native config, preserve provider settings, and show the control and search result only when Reasoning is auto.
…in browser code Older browsers lack these APIs: Settings crashed on open, session catch-up stalled, and transcription polling failed. Use AbortController timers and plain promises, keeping the same timeouts and cancellation. Fixes kahme247#196.
Reuse the workspace refresh control and success checkmark. Bypass the server usage cache only for manual refreshes while retaining the existing five-minute automatic polling schedule.
Keep background polling silent, preserve refresh queries on older browsers, and ensure manual refresh is not satisfied by a concurrent background fetch. Cover persisted caching and hook behavior with regression checks.
A manual refresh must attempt cache invalidation even when the automatic fetch it waited behind rejects. Extend the CLI-backed regression to cover this failure path.
The reasoning trigger shows the terminal status line's level glyph instead of the level name (chevron hidden in narrow toolbars), so the model name keeps the room on phones. The menu pairs each glyph with its name. Slow was wired only for saved sessions, so a new session never showed it even after Fast had spawned omp. Offer it in new sessions too, and refresh live state after a new-session model change so support follows the model.
Without live omp state (new or idle session), predict omp's slowModeTarget from the catalog: /api/models marks supportsSlowMode by provider and reports providers.anthropic.slowMode, read fresh outside the models cache. Claude shows the shared setting (global scope); flex starts off (session). Live get_state wins as soon as omp runs, and clicking the toggle spawns omp like Fast does.
…t code Older mobile browsers lack these APIs, so calling them crashed the whole tree into the unexpected-error screen. Use browser-safe helpers. Fixes kahme247#196 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RZdyVoycH4WVVDWJNctDR
… again Handle the session-persistence notice: re-read identity, keep the run state, re-key the registry (old id stays as an alias) and reuse a live wrapper that already reports the requested session file. Fixes kahme247#202 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RZdyVoycH4WVVDWJNctDR
- auto-name asks omp (generate_title, else /rename) and only falls back to the derived title when omp cannot (Fixes kahme247#203) - provider detail lists the accounts omp reports for the provider (Refs kahme247#197) - tests and AGENTS.md notes Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RZdyVoycH4WVVDWJNctDR
fix(queue): take the queue back on Stop through omp's atomic Esc
feat: add a Slow toggle and provider-neutral usage-limit badge
…urce feat(settings): add Auto thinking source selector
…efresh feat(usage): add manual provider usage refresh
…-compatibility fix(client): avoid AbortSignal.timeout/any and Promise.withResolvers
Take main's kahme247#199 client fix instead of the duplicate abort-signal helper. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RZdyVoycH4WVVDWJNctDR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011RZdyVoycH4WVVDWJNctDR
…edes-297gxo Support omp session moves and native title generation
Show the branch below the workspace name, keep the activity indicator beside the name, and preserve space for rename and branch controls.
Use OMP live resolution instead of duplicating discovery. Keep the native notice preference and never resume stopped sessions for inspection.
Add an icon-only dismiss button that hides the current report until its diagnostics change, and shorten the disable action to "Turn this off" so the notice text keeps its width on phones.
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # components/AppShell.tsx # components/ChatInput.tsx # components/SessionSidebar.tsx
# Conflicts: # README.md # hooks/useAgentSession.ts
…edes-297gxo Integrate open contributor PRs (kahme247#198, kahme247#200, kahme247#204, kahme247#206, kahme247#208, kahme247#210–kahme247#214)
…247#197) Use omp's get_logout_accounts/logout RPC to list every stored credential for a subscription provider, mark the active one, and remove a single account. omp without those commands keeps the read-only usage-based list. Rename the connected provider's sign-in button to Add account.
Drop a disconnected row immediately, report listing failures instead of claiming an old omp, reject unsafe credential ids, and cover the route.
omp computes 'active' against the settings utility process's throwaway session, so it does not say which account any chat uses.
One email can hold accounts in several orgs; the bare-email usage row cannot tell them apart.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
…r accounts Squashed from origin/feat/197-provider-accounts (711ad9e) onto upstream/main.
kahme247
left a comment
There was a problem hiding this comment.
Review — approve (SHIP)
Verified by independent review with live route-handler probes against fake credentials.
Provider accounts (#222). No credential leak: a fixture with fake keys in every plausible omp field returns only allow-listed {credentialId, label, detail, type}. Disconnect is real server-side revocation (omp's shared logoutCredential helper — authStorage.credentials.removeById — plus invalidateModelsCache()), not UI hiding. Hostile provider strings inert (JSON-over-stdio, no shell/file sink). Old-omp degradation graceful (supported:false/501 with usage-list fallback, test-covered). Both redaction and validation mutations killed. Two optional non-blocking notes: redact key-like patterns from 500 passthroughs, and surface remainingSource when env-var auth keeps a provider connected.
3f1dbea to
42b3c29
Compare
Closes #197.
Summary
Settings → API Keys & Providers → a subscription provider now lists every account omp stores for it, using omp's new
get_logout_accounts/logoutRPC commands (can1357/oh-my-pi#14588):omp usagewhen that email identifies exactly one account, and an API key marker for stored keys.omp stays responsible for credentials, selection and rotation. omp-web never touches
agent.db. omp's per-accountactiveflag is not shown: omp computes it against the settings utility process's throwaway session, so it does not say which account any chat uses.Compatibility
This needs omp 18.7.0 or later, the first release with can1357/oh-my-pi#14588. With older omp,
GET /api/auth/accounts/[provider]returnssupported: false, so the panel keeps the read-only list fromomp usageand explains how to disconnect from a terminal.DELETEreturns 501logout_unsupported.Changes
app/api/auth/accounts/[provider]/route.ts:GETlists accounts, re-projecting only the known fields.DELETE ?credentialId=removes one account and invalidates the models cache.app/api/auth/logout/[provider]501 stub and the provider-wide Disconnect button.components/ProviderAccounts.tsxrenders the RPC list, falling back to the usage list on older omp.planForStoredAccountinlib/provider-accounts.tsjoins usage plans to stored accounts.Verification
tsc --noEmit,npm run lint(no new warnings), fullnpm testlocally (0 failures), CI green on ubuntu and windows. New tests:lib/auth-accounts-route.test.mjs: field allowlist, old-omp fallback, exact credential removal, unsafe id rejection, and error mapping.lib/provider-accounts.test.mjs: a plan is matched only when one account has that email.can1357/oh-my-pimain, using a disposable copy of the agent database with a second Anthropic account added: both accounts listed, and Disconnect on the second removed only that credential. The real database was untouched.DELETEreturns 501.