You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tui: pinned sessions disappear from the session list once outside the newest 50 #64337
Pinned sessions silently disappear from the session list once they fall outside the newest 50 sessions. The pins are not lost: the state file still contains them and their pin state is unchanged. The "Pinned" group only renders pinned sessions that happen to be inside the page the dialog loads, so older pins become unreachable from the UI.
Steps to reproduce
Pin several sessions (ctrl+f in the session list).
Keep working until more than 50 newer root, non-archived sessions exist.
Open the session list (ctrl+o, or ctrl+x then l).
Expected behavior
Every pinned session appears under the "Pinned" group, regardless of how old it is or how many newer sessions exist.
Actual behavior
Only pinned sessions that are inside the newest 50 sessions are shown. The remaining pins are omitted from the list entirely, even though they are still pinned.
Additional context
The dialog requests session.list({ limit: 50, order: "desc", parentID: null, archived: false }) and builds the pinned group as pinned.filter(id => loadedIds.has(id)), so any pin outside that window is dropped.
Verified against a running 2.2.6 server:
$ opencode api get /api/session --param limit=50 --param order=desc --param parentID=null --param archived=false
returns 50 sessions, and only 2 of the 9 ids in ~/.local/state/opencode/session.json are present in that response. The other 7 pins rank 58-81 when ordered by time.updated.
All 9 pinned sessions still exist in the local database (session_v2 table), have parent_id IS NULL and are not archived, so this is display-only. The same request made by the dialog is confirmed to omit them, so it is not a data-loss or migration issue.
The quick slots also cap pinned entries at 9 (pinned.filter(...).slice(0, 9)), which is presumably intentional for session.quick_switch.1 through session.quick_switch.9.
Workaround: searching for the session title inside the session list makes the session reappear, and it is then correctly labeled "Pinned".
Thanks for the detailed report. I reproduced this on 2.2.6 with session tabs off:
I created 3 sessions and pinned each one with ctrl+f in the session list. They showed under "Pinned".
I created 55 newer root sessions.
I reopened the session list (ctrl+x l). The "Pinned" group was gone and the pinned sessions were missing.
Searching for one of the titles brought it back, labelled "Pinned", as you describe.
It still happens on the latest dev (62d06fa). The recording and screenshots below show it, and the script below reproduces it.
recording.mp4
Reproduction script (drive.ts)
// Reproduces anomalyco/opencode#64337: pinned sessions outside the newest 50// disappear from the TUI session list.import{Effect}from"effect"import{OpenCodeDriver}from"opencode-drive"constPINS=["OLD-PIN-ALPHA","OLD-PIN-BRAVO","OLD-PIN-CHARLIE"]exportdefaultOpenCodeDriver.use({
...(process.env.OC_DEV ? {opencode: {dev: process.env.OC_DEV}} : {}),tuiConfig: {tabs: {mode: "off"}},tui: {recording: true,keypressOverlay: true,viewport: {cols: 140,rows: 45}},}asany,({ ui, opencode })=>Effect.gen(function*(){// 1. Three old sessions, then pin each from the session list (ctrl+f).for(consttitleofPINS)yield*opencode.session.create({ title })yield*Effect.sleep(500)// Show sessions from all projects (the API-created sessions have no project location).yield*ui.press("x",{ctrl: true})yield*ui.press("l")yield*ui.waitFor("Sessions")yield*Effect.sleep(500)if(yield*ui.matches("Sessions for"))yield*ui.press("a",{ctrl: true})yield*ui.waitFor("OLD-PIN-ALPHA")yield*ui.screenshot("0-all-projects")yield*ui.press("escape")for(consttitleofPINS){yield*ui.press("x",{ctrl: true})yield*ui.press("l")yield*ui.waitFor("Sessions")yield*ui.type(title)yield*Effect.sleep(800)yield*ui.press("f",{ctrl: true})yield*Effect.sleep(300)yield*Effect.sleep(400)yield*ui.press("escape")yield*Effect.sleep(300)}yield*ui.press("x",{ctrl: true})yield*ui.press("l")yield*ui.waitFor("Pinned")yield*Effect.sleep(800)yield*ui.screenshot("1-pins-visible-with-3-sessions")constbefore=yield*ui.capture()yield*ui.press("escape")// 2. 55 newer root sessions push the pins out of the newest 50.for(leti=1;i<=55;i++)yield*opencode.session.create({title: `newer session ${i}`})yield*Effect.sleep(500)// 3. Reopen the session list: the Pinned group is gone.yield*ui.press("x",{ctrl: true})yield*ui.press("l")yield*ui.waitFor("newer session 55")yield*Effect.sleep(1000)yield*ui.screenshot("2-pins-missing-after-55-newer")constpinnedShown=yield*ui.matches("Pinned")constalphaShown=yield*ui.matches("OLD-PIN-ALPHA")yield*Effect.log(`after 55 newer sessions: "Pinned" visible=${pinnedShown}, OLD-PIN-ALPHA visible=${alphaShown}`)// 4. Workaround from the report: searching brings a pin back, labelled Pinned.yield*ui.type("OLD-PIN-ALPHA")yield*ui.waitFor("OLD-PIN-ALPHA")yield*Effect.sleep(1000)yield*ui.screenshot("3-search-brings-pin-back")yield*Effect.log(`after search: "Pinned" visible=${yield*ui.matches("Pinned")}`)voidbefore}),)
Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.
Closing as a duplicate of #60236: pins older than the newest 50 sessions disappear from the list, and #60237 is open to fix it. Please follow that issue for updates and add any extra details there.
Activity
opencodejr commentedon Nov 17, 2026
Thanks for the detailed report. I reproduced this on 2.2.6 with session tabs off:
ctrl+fin the session list. They showed under "Pinned".ctrl+x l). The "Pinned" group was gone and the pinned sessions were missing.It still happens on the latest
dev(62d06fa). The recording and screenshots below show it, and the script below reproduces it.recording.mp4
Reproduction script (drive.ts)
Run it with opencode-drive:
opencode-drive run ./drive.ts. It drivesopencodefrom yourPATH; setOC_DEVto the path of an OpenCode checkout to run that from source instead.neriousy commentedon Nov 23, 2026
Closing as a duplicate of #60236: pins older than the newest 50 sessions disappear from the list, and #60237 is open to fix it. Please follow that issue for updates and add any extra details there.