fix: support Devin auth from the Devin - Next app#554
Conversation
probe stopped at the first app install that had a token, so a stale token in one install (e.g. stable Devin) masked a valid one in another (Devin - Next) and surfaced "Run devin auth login". Collect tokens from all installs and try each one the cloud hasn't already rejected, deduping by (apiKey, server) so a token is never replayed across the CLI and app sources.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR introduces multi-source app authentication for the Devin plugin, allowing it to attempt auth from multiple Devin install variants and deduplicate retry attempts by API key and server combination. The probe flow now accumulates attempted auth fingerprints to prevent stale tokens in one install from shadowing valid credentials in another. ChangesMulti-source Devin app authentication
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/devin/plugin.js (1)
140-146: ⚡ Quick winLoad app auth sources lazily in
probe().
loadAppAuths()queries every configured SQLite DB before the first app token is tried. That makes the success path do extra I/O and can surface noise from optional installs even when the earlier source would have succeeded. IteratingAPP_AUTH_SOURCESdirectly inprobe()keeps the fallback behavior but short-circuits sooner.♻️ Suggested shape
- function loadAppAuths(ctx) { - var auths = [] - for (var i = 0; i < APP_AUTH_SOURCES.length; i++) { - var auth = readAppAuth(ctx, APP_AUTH_SOURCES[i]) - if (auth) auths.push(auth) - } - return auths - } ... - var appAuths = loadAppAuths(ctx) - for (var i = 0; i < appAuths.length; i++) { - var appAuth = appAuths[i] + for (var i = 0; i < APP_AUTH_SOURCES.length; i++) { + var appAuth = readAppAuth(ctx, APP_AUTH_SOURCES[i]) + if (!appAuth) continue if (alreadyAttempted(attempts, appAuth)) continue sawApiKey = true attempts.push(authFingerprint(appAuth)) var appAttempt = tryAuth(ctx, appAuth)Also applies to: 313-318
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/devin/plugin.js` around lines 140 - 146, loadAppAuths eagerly reads every configured SQLite source which causes extra I/O and noise; instead, change probe() to iterate APP_AUTH_SOURCES and call readAppAuth(ctx, source) one-by-one, returning immediately when a truthy auth is found (short-circuiting) rather than preloading them all in loadAppAuths; update the other similar site (the code around readAppAuth usage at the second location referenced) to follow the same lazy, short-circuiting pattern so only necessary DBs are queried.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@plugins/devin/plugin.js`:
- Around line 140-146: loadAppAuths eagerly reads every configured SQLite source
which causes extra I/O and noise; instead, change probe() to iterate
APP_AUTH_SOURCES and call readAppAuth(ctx, source) one-by-one, returning
immediately when a truthy auth is found (short-circuiting) rather than
preloading them all in loadAppAuths; update the other similar site (the code
around readAppAuth usage at the second location referenced) to follow the same
lazy, short-circuiting pattern so only necessary DBs are queried.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c7a4a3fd-0d49-4f51-bc23-ab404dd3d886
📒 Files selected for processing (2)
plugins/devin/plugin.jsplugins/devin/plugin.test.js
Description
Devin showed "Run devin auth login or sign in to Devin and try again." for users on the Devin - Next pre-release channel. The
windsurf → devinmigration dropped the retired Windsurf plugin'swindsurf-nextvariant, so the Devin plugin only read the stable~/Library/Application Support/Devin/...auth DB. A user with only Devin - Next installed (no stable Devin app, nodevin auth loginCLI credentials) had no readable auth source.This branch:
Devinand theDevin - Nextapp state DBs, restoring parity with the oldwindsurf/windsurf-nextvariants.probenow attempts each token the cloud hasn't already rejected, deduped by(apiKey, server), so a stale token in one install can't mask a valid one in another.Verified live: confirmed working on a real Devin - Next account via
bun tauri dev: the call toserver.codeium.com(ideName: devin) succeeded for the migrated account. No new request/response fields are exposed (theapiKeywas already sent), so no host-API redaction changes were needed.Related Issue
Fixes #553.
Type of Change
Testing
bun run buildand it succeededbun run testand all tests passbun tauri devScreenshots
No UI/layout changes, behavior fix only.
Checklist
mainbranchSummary by CodeRabbit