follow-ups from #1302 review (non-critical)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start in packages/tui/src/context/local.tsx around lines 802 and 834, then inspect the listed changes in altimate-onboarding.tsx, history.tsx, local.tsx, and dialog.tsx; use test/context/cycle-stability.test.tsx as the named regression-test entry point. Done means independently verifying the committed fixes and resolving the two still-unfixed persisted() and migrateLegacyDefault() findings.
Written by the indexing model from the issue text.
Description
Anand asked to scope PR #1302 down to just the critical finding (the prompt-history write race, comment 3981939207) plus the two test-isolation fixes (3982134223/3982134283). This issue tracks the remaining, non-critical bot findings from that PR's review so they aren't lost.
Note: fixes for all of these were already written, committed, and pushed to fix/free-default-altimate-base (commit 9af9ab4be9) before this scope change landed. Per instruction they are being left in place as-is (not reverted), but no further work is being done on them under #1302 — this issue is the record for any follow-up review/verification.
-
Migration telemetry recorded on a bare quit — 3981939224 (cursor[bot]), 3982012198 (coderabbitai[bot]), 3982134266 (cubic[bot]) —
packages/tui/src/component/altimate-onboarding.tsxaround line 493-495.onCleanupunconditionally calledrecordChoice("cancel"); a bare process exit / top-level quit leftlastCloseReasonundefined, which the old check treated as a genuine decline and emittedaltimate_base_choicetelemetry that never happened. Fix already in commit9af9ab4be9: added an explicitchosenflag set only insideno()/yes(). -
— 3982134204 (cubic[bot]). SUPERSEDED, not just pending re-verification: the original fix here (cycle()doesn't persist the launch defaultfallbackModel()preferring a persistedexplicitDefaultoverrecent) turned out to introduce a WORSE cross-surface bug — headless/ACP default resolution never readexplicitDefault, so the TUI and server could disagree on the launch default after a cycle (see cursor 3986044810/3986264141, cubic 3986055633/3986055646, kilo 3986171198). That branch was reverted andcycle()now reordersrecentinstead ({ explicit: true, recent: true }), landed directly on PR #1302 in a later commit — done there, not tracked here. -
Startup history merge doesn't enforce dedupe/cap invariants — 3982134235 (cubic[bot]) —
packages/tui/src/prompt/history.tsxaround line 117. Fix already in commit9af9ab4be9: addedmergeStartupHistory()enforcing no-consecutive-duplicate andMAX_HISTORY_ENTRIES. -
launchDefaultDisplayreads a live memo, not a snapshot — 3982134252 (cubic[bot]) —packages/tui/src/context/local.tsxaround line 700. The migration disclosure copy could rename itself mid-dialog once registration moved the livefallbackModel(). Fix already in commit9af9ab4be9: snapshotlaunchDefaultDisplayalongsidelaunchDefaultat mount. -
Stale "same as Escape/Ctrl+C" comment — 3982134275 (cubic[bot]) —
packages/tui/src/ui/dialog.tsxaround line 271. Comment predates Ctrl+C's own "interrupt" close reason. Fix already in commit9af9ab4be9: comments updated to distinguish "dismiss" (Escape/backdrop) from "interrupt" (Ctrl+C). -
migrateLegacyDefault({ from })'s re-check judges explicitness against the live default, not the capturedfrom— 3986171207 (kilo-bot) —packages/tui/src/context/local.tsxaround line 834.hasExplicitDefault()comparesfallbackModel()(which may have moved by the timeyes()re-checks, e.g. aftersync.bootstrap()makes a previously-invalidexplicitDefaultvalid again) againstmodelStore.explicitDefault, instead of comparing against the capturedfrom— the model actually being migrated. Concrete corner case in the finding: a user whose persistedexplicitDefaultalready IS Base can get bounced to the welcome picker instead of accepted. Not yet fixed anywhere. -
persisted()doesn't cover asave()issued beforemodelStore.ready— 3986171211 (kilo-bot) —packages/tui/src/context/local.tsxaround line 802. Asave()called while!modelStore.readyonly sets astate.pendingflag (deferred into thereadJson.finally()) and never enterspendingWrites, sopersisted()— which awaits only[...pendingWrites]— can resolve before that deferred write has even started. No current caller hits this window (dialog only opens afterlocal.model.ready; the test harness declines post-mount), but thepersisted()API's contract is silently violated for it. Not yet fixed anywhere. -
— 3986532221 (cubic[bot]). This was a genuine regression THIS PR introduced (not a pre-existing follow-up), so it was fixed directly rather than tracked here. AddedsetupComplete()is a global flag, not scoped to "this launch's first-run/impatient-picker case"firstRunOpenedThisLaunch— a one-way latch inaltimate-onboarding.tsxset only when the first-run picker actually opens this launch (app.tsx's own fallthrough, or the prompt gate's equivalent, which now also callsmarkFirstRunActive()) — and app.tsx'sshouldSkipOnboardingAtStartupcall site now passessetupComplete() && firstRunOpenedThisLaunch()instead of the bare global flag. -
— 3986917361 (cubic[bot]). Fixed directly (repo rule: tests must not touch real global state). Root cause was deeper than the test file itself:test/context/cycle-stability.test.tsxwrites KV lock artifacts to the real global state directorykv.tsx'sFlock.withLocklock root is derived fromGlobal.Path.stateinpackages/core/src/global.ts, which had NO test-isolation override at all (onlyGlobal.Path.homedid), andFlock.setGlobal({ state })snapshotted that value once at module-import time. Added anOPENCODE_TEST_STATE_HOMEoverride toGlobal.Path.state(mirroringGlobal.Path.home's existing pattern) and changedFlock.setGlobalto take a getter overPath.stateinstead of a frozen value, so it re-resolves on every lock acquisition. The test now sets/restores that env var around its mount. Verified empirically: the real~/.local/state/altimate-code/locksdirectory's mtime changed when the fix was temporarily reverted, and stayed untouched with it applied. -
— 3987174885 (cubic[bot]). Fixed directly (repo rule: no order-dependent tests). Folded the three sequentialtest/context/cycle-stability.test.tsx's three tests are no longer independently runnabletest.serialblocks into ONEtest()over a single local mount, with five labelled phases (aphase()helper names which stage failed in any assertion-failure message) covering the same scenarios as before.
Follow-up: independently re-verify these fixes (code review + the relevant test suites) outside the pressure of the #1302 merge, since they landed as part of a broader batch rather than being reviewed in isolation. Items 3986171207 and 3986171211 still need an actual fix, not just verification.
- Dominant language
- TypeScript
- Stars
- 813
- Forks
- 134
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 62
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AltimateAI/altimate-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AltimateAI/altimate-code#1323 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
AltimateAI/altimate-code#1288 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
AltimateAI/altimate-code#1284 ·
-
Difficulty 2/5 Under an hour Newbie friendliness 72/100
AltimateAI/altimate-code#1283 ·
All issues in AltimateAI/altimate-code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·