fix(happy-app): persist session model and effort selections locally#1151
fix(happy-app): persist session model and effort selections locally#1151nto2020 wants to merge 2 commits intoslopus:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd2d671314
ℹ️ 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".
| const started = await waitForDaemonReady() | ||
| if (!started) { | ||
| throw new Error('Happy daemon failed to become ready') |
There was a problem hiding this comment.
Remove hard 5s daemon startup cutoff
ensureDaemonRunning() now fails if waitForDaemonReady() does not succeed within its default 5 seconds, but daemon startup performs async setup before it can report readiness (notably startDaemon() awaits authAndSetupMachineIfNeeded() before writing daemon state and serving control endpoints). In slow environments (cold disk, delayed config I/O, machine setup latency), this can make normal CLI commands (happy, happy codex, etc.) throw Happy daemon failed to become ready even though the daemon finishes starting moments later.
Useful? React with 👍 / 👎.
Summary
This PR fixes a mobile session UI/state issue where model and effort selections could revert back to
default modelandxhighafter a session refresh or metadata update.Root cause
modelModeandeffortLevelwere only stored in the in-memory session object on the app side.Two things caused the visible regression:
applySessions()preserveddraftandpermissionMode, but did not preserve localmodelMode/effortLevelpermissionMode, session-levelmodelModeandeffortLevelwere not persisted locallyAdditionally, effort initialization in
SessionViewdid not considermetadata.currentThoughtLevelCode, so once local state was lost, the UI fell back to the default Codex effort (xhigh).Changes
modelModeandeffortLevelwhen merging refreshed sessionsmetadata.currentThoughtLevelCodein effort initialization priorityValidation
Manually confirmed that:
gpt-5.2-codexpersists in the session UImediumpersists in the session UIdefault model/xhighafter refresh/re-entryAlso ran:
pnpm vitest run sources/components/modelModeOptions.test.ts sources/sync/persistence.test.ts sources/sync/sessionLocalState.test.ts sources/sync/messageMeta.test.ts sources/sync/storageTypes.spec.tsScope
This PR only fixes UI/local persistence and merge behavior.
It does not change the CLI or message meta schema, and it does not make
effortLevelaffect the actual downstream Codex turn execution yet.