[FEATURE]: Session pinning in the Desktop app (TUI parity)
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Note on prior requests
- #28813 scoped exactly this (Desktop/Web session pinning, incl. two design options) and was assigned to @kitlangton at triage; it was auto-closed after 60 days of inactivity, not rejected.
- #55195 (open) is message/selected-text pinning in the Desktop chat — explicitly not session pinning.
- #36193 (open,
2.0) is the TUI equivalent (fast overview + pinned session quick slots) and has an internal tracking issue; Desktop has none.
Describe the enhancement you want to request
The TUI can pin sessions (session.pin.toggle / ctrl+f, jump with <leader>1..9). Desktop and Web
have no way to pin a session, so long-running or important ones are only findable by scrolling back
through the date-grouped list.
I'd like a Pinned group at the top of the Desktop home session list, plus pin/unpin in a session's row menu, persisted across restarts.
I'm a user, not a developer, so I can't implement this myself — filing it so it's tracked. #28813
already worked out the two possible approaches (backend pinned_at + API for TUI/Desktop/Web
parity, or a client-side store in packages/app for Desktop/Web only) if that helps whoever picks
it up.
Is Desktop session pinning planned or tracked internally? #36193 shows the TUI side got an internal issue, so I'm wondering whether a Desktop equivalent exists and I just couldn't find it.
Scope
- In: pin/unpin a session, Pinned group above today/yesterday/older, persists across restarts.
- Out: message/text pinning (#55195), pinning session tabs, cross-device sync.
Thanks for the detailed write-up and for checking earlier requests! You're asking for session pinning in the Desktop app: pin/unpin from a session's row menu, a Pinned group above today/yesterday/older on the home session list, kept across restarts, like the TUI's session.pin.toggle.
I couldn't find an open Desktop-side issue for this, so this one can track it. Maintainers will consider it.
Related issues:
- #28813: the earlier Desktop/Web session pinning request, with the shared-backend vs client-side design options (auto-closed as inactive)
- #36193: the TUI-side session overview and pinned session shortcuts
- #44736: pinned sessions can be lost when several TUI instances run at once (TUI pins are stored only on the client, which matters for the design choice)
- #55195 / #55221: pinning messages and selected text in the Desktop chat (separate feature)
- #52478: no supported way for plugins to pin sessions
This can't be done as a Desktop extension today, because extensions have no way to add to the session list or a session's row menu.
I'd like to take this on. For a bounded first version, I propose keeping pins as a local UI preference using the existing packages/app/src/runtime/persistence/storage.ts persistence layer, scoped to the stable server identity and keyed by session ID. This preserves pins across Desktop restarts without a database/API migration or changing TUI pins. Because this is shared app code, Web would get the same behavior within its own local storage; pins would not sync between clients/devices.
On current dev (41cb349):
- Add Pin/Unpin to the existing row menu in
home/sessions/view.tsx, and derive a Pinned group before the date groups inhome/sessions/controller.tsx. Pinned rows appear once, keep the existing updated-time ordering, and obey the selected project/worktree filter. Unpinning returns a row to its date group without modifying the session's timestamp. - Keep pinned sessions outside the current 64-row recent-list trimming. On restart, resolve saved IDs through the existing
session.getAPI, then merge/deduplicate before grouping; otherwise older pins would disappear when absent from the recent index. Hide archived/deleted sessions, remove confirmed missing IDs, and retain pins on transient connection errors. - Start the new persisted schema empty; do not import or rewrite TUI's
session.json. This chooses the client-local direction discussed in #28813, rather than its broader shared-backend/TUI migration.
I would cover pin/unpin grouping, old-pin restoration beyond the recent limit, project/server isolation, missing/archived sessions, persistence reload, and the existing row interactions with focused tests and UI verification.
Could a maintainer approve this scope and persistence direction before implementation, or indicate whether a shared-backend design is required instead?
+1 from a long-running Windows desktop user (Desktop 2.1.0, Windows 10.0.26200).
My sessions are not chats — they are month-long project threads (urban planning indicators, GIS/Excel/PPT pipelines). A few must stay reachable for months; today the only way back is scrolling a date-grouped list that degrades as it grows.
Scope I actually need:
- Pinned group above Today/Yesterday/Older, independent of last-activity, so a pinned session never sinks because a newer one ran.
- Pin/unpin from the row menu AND from the open session header.
- Persisted across restarts and project switches — a pinned session from project A stays visible from project B with its project name shown. This is the real gap vs TUI quick-slots.
- Stable order inside Pinned (manual, or
pinned_atdesc).
Not asking for: message/text pinning (#55195), tab pinning, cross-device sync.
The client-side store in packages/app that #28813 outlined is acceptable if backend pinned_at + API is too large for 2.0 — the feature matters more than where the flag lives.
بالعربية: أحتاج تثبيت المحادثات المهمة للرجوع السريع بدل التمرير في قائمة طويلة.
Adding shipped-build evidence for the persistence question, from Desktop 2.2.5 (macOS arm64, bundled CLI opencode v2.2.5).
1. Desktop has no pin code path at all. The packaged renderer bundle (/Applications/OpenCode.app/Contents/Resources/app.asar) contains zero occurrences of session.pin, session.pin.toggle, or togglePin. The TUI binary from the same release does contain them, and session.pin.toggle is dispatched only from the session-list dialog action list ({command: "session.pin.toggle", title: "pin/unpin", onTrigger: (row) => session.togglePin(row.value)}), which matches the TUI docs wording "Pin or unpin session in the session list".
2. Nothing on the server side. Session.Info in the OpenAPI schema has id, parentID, fork, projectID, agent, model, cost, tokens, outcome, time, title, subpath, metadata, permissions, revert, location — no pin/star/favorite field. Of the 138 documented paths, none match pin, star, favorite, bookmark, or archive; there is no pin endpoint to call and no field to set.
3. Pins are client-local in the TUI already. The TUI keeps the pin list in its own state file (session.json, next to model.json), not in the session record, so a client-local store in packages/app is consistent with existing behavior rather than a new compromise.
4. cli.json cannot help. session.pin.toggle in cli.json does not reach the Desktop UI: the app keeps its own keybind map in its own settings store (keybinds: {}), and cli.json is only read for TUI plugin enablement.
Practical consequence: right now a Desktop user cannot pin a session by any supported route — no keybind, no row action, and no pinned field to sort on. A client-side store keyed by stable server identity (as proposed above) is the only option that does not require a schema and API change.
This one bites me daily on Windows. I keep a few long-running sessions open, and there's simply no way to make one stay at the top. Right-clicking a tab gives me Rename / Close tab / Delete session, that's it. Since the list is ordered by recency, the session I care about keeps sinking as I open new ones, and dragging it back up only helps until I close it.
Pin / Unpin in the tab menu, with pinned sessions staying above the rest and surviving a restart, would end the scrolling entirely. Sharing the pin with the TUI's session.pin.toggle would be ideal so both surfaces agree, but a desktop-only pin would already fix my workflow.
Not sure if this is planned. #60236 and #59906 read like the same ask on other surfaces, and #52794 suggests pinning isn't showing up in the TUI on Windows either right now.
+1 would be really helpful
Plugin-author data point for the API side of this.
A GUI plugin can persist pinned session IDs today with Store.global / Store.session, but it cannot surface them: there is no contribution point for a pin/unpin action on a session's row menu, and no slot or grouping API for a Pinned section above the date groups on Home. #52478 already notes that there is no supported way for plugins to pin sessions, and #61385 shows the analogous gap for per-message actions (it proposes a MessageAction registry plus ctx.sessions.reveal(...)).
For a plugin to implement Desktop pinning without patching session-ui, it would need roughly:
- a
SessionAction/ row-menu contribution point, orctx.layout.pin(session, pinned)plus a pinned-state store; and - a Home/session-list slot or grouping API that can list pinned sessions.
Alternatively, if pins are meant to be shared with the TUI, a server-side pinned field/API would let both clients read the same state — with the caveat from #44736 that TUI pins are currently client-local.
Desktop is the priority here; TUI parity through the existing session.pin.toggle would be the follow-up.