Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Rust: subagent lifecycle hooks are logged as unknown

Aperta Adatta ai principianti
#2,781 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
devtools

Direzione di ricerca

Inizia in rust/src/hooks.rs, presso dispatch_hook, e verifica come vengono confrontati i valori di HookType. Aggiungi la gestione pass-through per subagentStart e subagentStop, quindi aggiungi un test unitario mirato che copra entrambi i nomi. Il lavoro è completato quando questi hook del ciclo di vita validi restituiscono l'output vuoto standard senza avvisi, mentre i nomi realmente sconosciuti continuano a usare il percorso di avviso.

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

Descrizione

Bug

When Rust SDK hooks are enabled and the Copilot CLI starts or stops a task sub-agent, the CLI sends hooks.invoke requests with hookType values subagentStart and subagentStop. The Rust SDK logs both as unknown:

unknown hook type hook_type="subagentStart"
unknown hook type hook_type="subagentStop"

The generated HookType enum already declares both values, but rust/src/hooks.rs::dispatch_hook does not match them. The public SessionHooks API also has no dedicated callbacks for these lifecycle hooks.

Reproduction

  1. Create a Rust SDK session with hooks enabled.
  2. Invoke the built-in task tool so a sub-agent starts and completes.
  3. Observe the warnings from github_copilot_sdk::hooks.

Expected behavior

The SDK recognizes these valid callback-only lifecycle hook names and returns the standard empty output when no public callback is registered. Truly unknown hook names must continue to use the warning path.

Proposed fix

Handle subagentStart and subagentStop as pass-through hooks in dispatch_hook, with a focused unit test covering both names.

Lingua principale
Java
Stelle
10.5k
Fork
1.5k
Merge medio
1g 8h
PR unite (30g)
111

Preparare l'ambiente

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.

Altre issue di github/copilot-sdk

Tutte le issue di github/copilot-sdk

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.