hooks migrate preserves regex SessionStart alternatives that native exact trigger matching never runs

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

I maintainer di solito rispondono entro 1 giorno

@ayam04 ci sta già lavorando.

Dal 29/11/2026.

  • #30523 di @ayam04 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
json, typescript
Ambito
cli

Direzione di ricerca

Riproduci il problema con il fixture sintetico .claude/settings.json, quindi esegui gemini hooks migrate --from-claude e ispeziona .gemini/settings.json. Leggi il percorso di migrazione e HookPlanner.matchesTrigger per capire perché startup|resume viene conservato come un unico matcher. Il lavoro è completo quando è stato verificato che le alternative letterali vengano migrate in gruppi di corrispondenza separati, che le alternative non supportate vengano segnalate e che il fixture nativo dell'hook headless ripristini il suo checkpoint.

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

Descrizione

status/need-triage

Gemini CLI 0.71.1 gemini hooks migrate --from-claude preserves a Claude SessionStart matcher such as startup|resume|clear|compact|fork verbatim. Gemini's native HookPlanner.matchesTrigger compares trigger matchers as exact strings, so the migrated startup hook never runs.

Reproduction with synthetic settings:

{"hooks":{"SessionStart":[{"matcher":"startup|resume","hooks":[{"type":"command","command":"echo checkpoint"}]}]}}
  1. Put this in a trusted disposable workspace's .claude/settings.json.
  2. Run gemini hooks migrate --from-claude.
  3. Inspect .gemini/settings.json: the matcher is still startup|resume.
  4. Start a fresh headless invocation. Actual source is startup, which does not equal that matcher.

Expected: migration preserves the source trigger semantics, for example by generating separate literal startup and resume groups. Unsupported trigger alternatives should be reported explicitly. Do not silently treat arbitrary regular expressions as literal values.

This is distinct from #14724's compact/compress naming mismatch. Native tool matchers are regular expressions; the issue is trigger matchers.

Downstream configuration-only correction splits verified simple literal alternatives. A real native headless fixture now restores its saved checkpoint and carries it in the next provider request. No runtime hook dispatcher or permission bypass is needed. Tested with the released 0.71.1 native migration command and HookPlanner implementation.

Downstream release: ruflo-source-patch v4.46.202, commit 833c9796dc67ad5ce5fa5dd13b523ade5872cf00. The immutable artifact is installed on macOS and Linux; all 385 packaged files match in three installations. Native command-hook configuration and applicable named patches are active. This is a downstream correction, not evidence of an upstream release fix.

Lingua principale
TypeScript
Stelle
109k
Fork
15k
Merge medio
1g 24m
PR unite (30g)
91

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 google-gemini/gemini-cli

Tutte le issue di google-gemini/gemini-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.