Skip to content

fix(onboarding): prevent replay after switching to BYOK - #343

Merged
hijzy merged 1 commit into
MemTensor:mainfrom
syzsunshine219:codex/fix-onboarding-replay-after-byok
Sep 2, 2026
Merged

fix(onboarding): prevent replay after switching to BYOK#343
hijzy merged 1 commit into
MemTensor:mainfrom
syzsunshine219:codex/fix-onboarding-replay-after-byok

Conversation

@syzsunshine219

@syzsunshine219 syzsunshine219 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • persist completed account onboarding into the explicit local BYOK scope before logout awaits cloud work
  • keep installation-scoped scan/report state unchanged and avoid copying account improvement-program consent
  • keep completed BYOK sessions on API Key setup until an Agent model is actually configured

Root cause

Account logout cleared the active account UUID before the later BYOK mode update tried to inherit onboarding. The renderer kept the old account completion in memory, so the first transition reached Home, but a new renderer bootstrap read the still-incomplete local BYOK row and replayed onboarding.

The supplied log proves two onboarding UI lifecycles; it does not prove the report-generation backend ran twice.

Regression coverage

The new SQLite-backed regression failed before the fix with local BYOK completed=false, currentStep=scan_permission_required, and completedAt=null. It now covers persistence across close/reopen, source-account isolation, idempotence, incomplete-account no-op, cloud logout failure, and delayed logout concurrency. Full and pet renderer routes cover BYOK with and without an Agent model.

Verification

  • Project Harness Full: 12/12 required evidence passed
  • backend tests: 830 passed
  • frontend tests: 1526 passed under Node 22
  • backend/frontend typecheck and backend lint passed
  • exact evidence fingerprint: 3844c53bf59d62c9e2690960b455f2e60766769d0307c32bf01ce0459173cf0f
  • v1.1.2 unsigned package manual verification: pending

Backport

Git three-way verification confirms this commit applies to release/v1.1.2 without conflicts. The release backport should be created after this main change is reviewed, using the required Backport-of provenance.

@syzsunshine219

Copy link
Copy Markdown
Collaborator Author

Project Harness review handoff marker. Only reviews submitted strictly after this GitHub timestamp qualify.

@syzsunshine219
syzsunshine219 marked this pull request as ready for review September 2, 2026 11:17
@hijzy
hijzy merged commit e679cf9 into MemTensor:main Sep 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants