github / github/copilot-cli

userPromptTransformed hook is skipped for steering messages

Aberta
#4,640 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

triage
Linguagem predominante
Shell
Estrelas
11.2k
Forks
1.9k
Merge médio
14h 16min
PRs com merge (30d)
6

Descrição

[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.

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece rastreando addImmediateMessagesIfProcessing() e runImmediatePromptPreRequest() e, em seguida, compare esse caminho com o caminho comum de construção do turno que invoca userPromptTransformed. Reproduza o cenário de steering-message da Issue e verifique se o hook é executado, emite um evento e coloca o marcador no contexto do modelo antes de a mensagem ser adicionada à requisição.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
shell
Domínio
cli
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Ativa
Clareza
Razoavelmente clara
Facilidade para iniciantes
65/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.