github / github/copilot-cli

sessionStart  prompt hooks don't fire on  /new , and  /clear  seems to skip sessionStart entirely — naming/behavior mismatch

Aperta
#4,365 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

area:configuration area:sessions
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

Describe the feature or problem you'd like to solve

Invoke a skill foreach new session

Proposed solution

The  sessionStart  hook name strongly implies it fires whenever a new "session" (conversation) begins — including via  /new  and  /clear . In practice:

  1. Hook entries of  "type": "prompt"  only fire on true CLI process startup ( source: "startup" ), not on  /new  ( source: "new" ) or  /clear , per the docs note: "Prompt hooks fire only for new interactive sessions... They do not fire on resume." This is confusing because  /new  is documented as "Start a new conversation" and intuitively should count as a "new interactive session."
  2.  /clear  ("Abandon this session and start fresh") doesn't appear to trigger  sessionStart  at all — it's not listed among the  source  values ( "startup" | "resume" | "new" ).

This creates a real usability gap: a user-level hook meant to re-apply a session-scoped customization (e.g., auto-running a skill/mode via a prompt hook) silently stops working after  /new  or  /clear , with no indication in  /env  that anything is "missing" — the hook config is loaded, it just never fires again for these transitions.

Suggestions:
• Either make  "type": "prompt"  hooks fire for  source: "new"  (matching user expectation and documented  /new  behavior), or rename the event/restrict the docs wording so it's unambiguous that  sessionStart  (for prompt hooks) really means "process startup only."
• Clarify/confirm whether  /clear  fires  sessionStart  at all, and add it explicitly to the  source  enum if so.
• Consider a distinct event (e.g.,  conversationStart ) for  /new / /clear  transitions, separate from true process-level  sessionStart , so hook authors can target the semantics they actually need.

Example prompts or workflows

No response

Additional context

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dalla documentazione dell'hook sessionStart e segui il modo in cui i comandi /new e /clear gestiscono le origini degli hook. Conferma il comportamento attuale degli hook di prompt e definisci se queste transizioni debbano usare sessionStart o un evento distinto. Il lavoro è completo quando la semantica degli eventi, i valori delle origini e la documentazione sono coerenti e le transizioni interessate sono coperte dai test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
shell
Ambito
cli, developer-experience
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.