fix: read Windsurf Devin session from app origin#1579
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d15b576522
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| for entry in entries where Self.targetKeys.contains(entry.key) { | ||
| storage[entry.key] = self.decodedStorageValue(entry.value) | ||
| } | ||
| for entry in entries where storage[entry.key] == nil && Self.targetKeys.contains(entry.key) { |
There was a problem hiding this comment.
Keep each origin's session bundle separate
When the first origin has only some of the devin_* keys, this loop preserves those values and fills the missing keys from the next origin because storage is shared across origins and existing keys are skipped. In a profile with stale/incomplete app.devin.ai data but a complete legacy windsurf.com bundle, this constructs a mixed session that the API can reject, and the valid windsurf.com bundle from the same profile is never tried as its own candidate.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed June 18, 2026, 9:54 AM ET / 13:54 UTC. Summary Reproducibility: yes. from source inspection: the PR can produce multiple complete origin snapshots and then discard later same-token candidates before retry. I did not run live provider probes because AGENTS.md cautions against live account/browser-cookie validation unless explicitly requested. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the per-origin import approach, but preserve distinct full Windsurf auth bundles through retry ordering and add redacted app-origin real behavior proof before merge. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: the PR can produce multiple complete origin snapshots and then discard later same-token candidates before retry. I did not run live provider probes because AGENTS.md cautions against live account/browser-cookie validation unless explicitly requested. Is this the best way to solve the issue? No, not quite: app-origin-first import with isolated snapshots is the right direction, but token-only de-duplication should not remove a distinct full auth bundle that could recover from 401/403. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 016f3b9e1314. Label changesLabel justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
8503622 to
2ab9f41
Compare
|
@clawsweeper re-review Current fixed head 2ab9f41 now has all visible GitHub checks passing, including macOS lint-build-test, Linux x64 CLI, Linux ARM64 CLI, and GitGuardian. Requesting fresh review on the green fixed head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
037552c to
811e62e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 811e62ea25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| let sourceLabel = self.sourceLabel(candidate.label, suffix: snapshot.sourceSuffix) | ||
| guard let session = self.session(from: snapshot.storage, sourceLabel: sourceLabel) else { continue } | ||
| logger("Found Windsurf devin session in \(sourceLabel)") | ||
| sessions.append(session) |
There was a problem hiding this comment.
Preserve full per-origin session candidates
With the new per-origin snapshots, this loop can append both app.devin.ai and windsurf.com bundles, but the function still returns through deduplicateSessions, which keys only on sessionToken. If a stale app-origin bundle has the same devin_session_token as a valid legacy bundle but different auth1/account/org headers, the legacy candidate is discarded before WindsurfWebFetcher can retry it, so the intended legacy fallback still fails with 401/403. De-dupe on the full auth bundle or keep distinct source labels as separate retry candidates.
Useful? React with 👍 / 👎.
Co-authored-by: kiranmagic7 <[email protected]>
811e62e to
54e83c2
Compare
|
Landing proof for exact head
Public model identifier gate: N/A; no model-bearing content changed. |
Summary
https://app.devin.aibefore the legacyhttps://windsurf.comorigin.Proof
54e83c212e520682202f95e8e18cf89734a61d9aswift test --filter 'WindsurfDevinSessionImporterTests|WindsurfWebFetcherTests'(18 tests passed)make checkautoreview --mode uncommitted(clean, confidence 0.82)app.devin.ai, followed its Devin Desktop View usage SSO handoff, and confirmed all four required fields were present atwindsurf.comwithout reading their values.windsurf-web, plan present, daily and weekly windows present, no error.Scope note
The current live
app.devin.aiaccount had nodevin_session_token,devin_auth1_token,devin_account_id, ordevin_primary_org_idlocalStorage keys. The new-origin path is fixture-covered but could not be live-proved with this account. This PR is additive compatibility and references, but does not by itself close, #1564.Refs #1564