fix(demo): share seed storage key between PlayView and useAgentSession#159
Merged
Luis85 merged 1 commit intoApr 27, 2026
Merged
Conversation
#155 d9b4b85.1) PlayView used a hardcoded `'demo.v2.session.lastSeed.petCare'` literal that duplicated `${SEED_STORAGE_KEY_PREFIX}${scenarioId}` in the store. If either constant drifted, the read silently missed the persisted seed and a fresh seed was generated on every load. Export `readPersistedSeed(scenarioId)` and `DEFAULT_SCENARIO_ID` from `useAgentSession.ts`; PlayView calls them instead of carrying its own copy. Adds a regression test that mounts PlayView with a seed pre-persisted under the store-owned key and asserts the session adopts it. Refs #155 finding:d9b4b85.1 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ 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". |
Coverage report
Floors live in |
size-limit report 📦
|
4 tasks
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
readPersistedSeed(scenarioId)+DEFAULT_SCENARIO_IDfromuseAgentSession.tsand drop PlayView's hardcoded'demo.v2.session.lastSeed.petCare'duplicate.PlayView.test.tsthat pre-persists a seed under the store-owned key and asserts the mounted session adopts it.Why
PlayView.vuecarried its ownSEED_PERSIST_KEYliteral that mirrored${SEED_STORAGE_KEY_PREFIX}${scenarioId}inside the store. If either side drifted, the read silently missed the persisted seed and a fresh seed was generated on every mount — review-bot findingd9b4b85.1from #155.Test plan
npm run verify(format:check + lint + lint:demo + typecheck + test + build) — all green, 674 tests passPlayView.test.tscase asserts persisted seed is honouredRefs #155 finding:d9b4b85.1
@codex review