Repository navigation
Fix Agents sidebar crash in plain-HTTP Remote Web - #18102
JasonJarvan wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe AI vault session refresh now uses Merge Risk: ⚪ Minimal · up to AI Vault session refresh now uses browser-compatible UUID generation, preventing the Agents sidebar crash in supported plain-HTTP Remote Web contexts. Regression coverage includes environments without crypto.randomUUID, and no merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
requestTokenminted viacreateBrowserUuid—useAiVaultSessionRefreshnow generates its cancellation token with the renderer's browser-UUID helper instead ofcrypto.randomUUID(), which is hidden in non-secure (plain-HTTP) contexts and caused the sidebar to throw during render.- Non-secure-context regression test — a new test stubs
cryptodown togetRandomValuesonly and asserts the fallback still produces a valid UUID, which fails against the oldcrypto.randomUUID()call. - Global teardown —
vi.unstubAllGlobals()added toafterEachso the stubbedcryptodoes not leak into other tests.
createBrowserUuid already covers the secure-native, getRandomValues, and Math.random fallback paths, so the fix reuses existing machinery with no remote wire change — the token remains an opaque string validated only for type/length by ai-vault.ts.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
d7fcb73 to
6ccdbff
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Rebased the token minting onto main's lazy
??=init —useAiVaultSessionRefreshnow swapscrypto.randomUUID()forcreateBrowserUuid()inside therequestTokenRef.current ??= ...pattern that main introduced since the prior review, instead of the earlieruseRef(createBrowserUuid()). This also stops the UUID from being regenerated on every render, matching the file's existingpublicationGateReflazy-init idiom.
The fix's substance is unchanged: the token remains an opaque string (validated only for type/length by ai-vault.ts), and the non-secure-context regression test still passes (35/35).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Flagging overlap rather than closing: #22516 now covers this bug end to end — every The AI Vault request-token test from #20465 has been ported into #22516, so that coverage is not lost. A maintainer should close this in favour of #22516 unless it covers something #22516 misses — if it does, please say so on #22516. |
|
Closing as superseded by #22516, which is merged and present on I checked this PR's scope and discussion against the merged implementation. The replacement explicitly supersedes this PR and covers its requested behavior. Thanks for the contribution; the branch is preserved. |

ELI5
The Agents sidebar asked the browser for a UUID API that plain-HTTP pages do not expose. It now uses the renderer UUID helper that already handles those pages safely.
What Changed
createBrowserUuid.getRandomValuesexists butrandomUUIDdoes not.Why
Remote Web can be opened from a LAN address over plain HTTP. In that non-secure context,
crypto.randomUUIDis unavailable, so initializing the AiVault refresh hook threw during render and the Agents right-sidebar ErrorBoundary reappeared on every tab switch.Reusing
createBrowserUuidkeeps native UUID generation in secure contexts and uses the existing browser fallback elsewhere, without changing the remote wire contract.Linked Issue
Fixes #18096
Visual Proof
N/A — this prevents a render crash and does not change layout or visuals.
Testing
Commands run:
pnpm test src/renderer/src/components/right-sidebar/ai-vault-session-refresh.test.ts— 35 passedpnpm run check:code-quality:changed— passed with 0 new ordinary, type-aware, or React Doctor findings across 2 filesTested on macOS. The change is browser-only, uses no platform-specific paths or shortcuts, preserves SSH/folder workspace behavior, and makes no remote wire change.
AI Disclosure
OpenAI Codex was used to implement and verify this focused fix.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
No security boundary, persistence, process-management, mobile, Git provider, or performance behavior changed. The request token remains a local cancellation identity and is not an authentication credential.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)