[FEATURE]: Desktop (V2): optional per-session prompt history

Offen
#65,151 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript
Bereich
desktop

Rechercherichtung

Start with packages/app/src/composer/history/store.ts and packages/app/src/composer/model.ts, then trace the Desktop settings surface and how the active session reaches the composer. The issue describes the desired scope and default, but does not identify the settings files or tests. Done means an opt-in current-session setting scopes ↑/↓ and Shift+↑ while preserving global behavior by default, with the new-session behavior documented.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area/desktop platform/windows type/feature version/v2
Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
What I'd like

Add an opt-in setting in OpenCode Desktop so prompt recall can be limited to the current session. Keep the current global behavior as the default.

Current behavior

In Desktop, the composer's ↑/↓ history and the Shift+↑ "Prompt history" picker are global. In an empty composer, ↑ recalls the last prompt sent in any session, and the picker lists prompts from every session and project.

With several sessions open, this makes recall unreliable and can pull text from an unrelated conversation into the current one. The global list is also capped, so a busy session can evict prompts from the session I'm actually working in.

Steps to reproduce
  1. Open two sessions in Desktop.
  2. Send alpha in session A.
  3. Send beta in session B.
  4. Go back to session A, focus the empty composer, and press ↑.
  5. beta is recalled instead of alpha.
  6. Press Shift+↑: the picker shows prompts from both sessions, and from other projects as well.
Environment
  • OpenCode Desktop 2.3.2 (V2)
  • Windows 10 22H2 (19045)
  • Desktop app, not TUI
  • No relevant plugins
Expected behavior

A Desktop setting, for example Prompt history scope:

  • Global — current behavior, default.
  • Current session — ↑/↓ and Shift+↑ only show prompts sent in the active session.

Scoping recall is enough; I'm not asking to change where history is stored. The new-session/home composer can keep global history or start empty, as long as the behavior is documented.

Notes
  • This is the Desktop (packages/app) counterpart of #52154, which tracks the TUI. Desktop has its own composer and settings surface and does not use the TUI's cli.json, so a TUI-only prompt.history_scope setting would not cover it. I couldn't find an existing Desktop issue for this; if you'd rather track it in #52154, feel free to close this as a duplicate.
  • The current source stores this globally: packages/app/src/composer/history/store.ts uses Persist.global("prompt-history") and Persist.global("prompt-history-shell"); createComposerHistory() in packages/app/src/composer/model.ts is called without session context.
  • Global history may be intentional — the TUI shipped per-session history and later reverted it (#43977 / #44416). I'm not asking to change the default; an opt-in Desktop setting is enough.
  • Related: #52154 (open, TUI), #54505 / #63470 (closed duplicates), #55261 (closed TUI PR proposing an opt-in prompt.history_scope).
Vorherrschende Sprache
TypeScript
Sterne
227k
Forks
30.7k
Ø Merge
3 Std. 57 Min.
Gemergte PRs (30 T.)
484

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus anomalyco/opencode

Alle Issues in anomalyco/opencode

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.