github / github/copilot-cli

userPromptTransformed hook is skipped for steering messages

Abierto
#4,640 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

triage
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

[Filed by Copilot on behalf of @bghgary]

Describe the bug

When a session receives a user message while the agent is already processing, the message is delivered to the model as steering, but the userPromptTransformed hook is not invoked. Hooks that inject standing instructions therefore apply to ordinary and queued turns but not to corrections or redirections delivered mid-turn.

Affected version

GitHub Copilot CLI 1.0.80

Steps to reproduce the behavior
  1. Configure a userPromptTransformed command hook that adds a unique marker to modifiedTransformedPrompt and logs each invocation.
  2. Start a session and send an ordinary prompt. Confirm that the hook runs and the marker reaches the model context.
  3. Start a long-running tool call, then send another user message before the tool call completes.
  4. Inspect the session events and hook log.

The second message is recorded with delivery: "steering", but it has no userPromptTransformed hook events, the hook log has no corresponding invocation, and the marker is absent from the model context.

Expected behavior

userPromptTransformed should run before every user message is added to a model request, including messages delivered while the session is processing.

Additional context

In a clean Windows x64 reproduction, the ordinary prompt invoked the hook while the in-flight steering prompt did not. In a larger sample of 984 user-message turns, the injected marker was present on 96.6% of idle deliveries and 100% of queued deliveries, but only 4.9% of steering deliveries; the hook's own 1,859-entry log contained no failures.

The installed implementation has separate paths: ordinary turn construction calls userPromptTransformed, while an in-flight send() queues the message through addImmediateMessagesIfProcessing() and runImmediatePromptPreRequest() later appends it directly to the model request without applying the hook.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza rastreando addImmediateMessagesIfProcessing() y runImmediatePromptPreRequest(), y después compara esa ruta con la ruta habitual de construcción del turno que invoca userPromptTransformed. Reproduce el escenario de steering-message del Issue y verifica que el hook se ejecuta, emite un evento y coloca el marcador en el contexto del modelo antes de añadir el mensaje a la solicitud.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
shell
Área
cli
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
65/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.