github / github/copilot-cli

Prompt ID in Hook

Open
#2,815 0 comments 0 reactions 0 assignees View on GitHub
area:plugins
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

### Describe the feature or problem you'd like to solve

Add a Prompt ID to the payload sent for the hooks

### Proposed solution

When a hook is fired, there is a session id field, which can be used to track all events for a given session. However, there are some actions that take place in the context of a prompt. For example a stopAgent, or subAgentStart, subAgentStop, permissionRequest, notification, etc. all happen as a result of a prompt that was submitted. Without a prompt id, it's difficult to accurate relate an event to the prompt which caused the event.

My use case is for a dashboard I've built to monitor the activity of my sessions. I run multiple sessions on multiple machines, all working on different things. I built a centralized dashboard to track the status of all of them. I can drill into a session and see all the prompts that have been submitted and their state. I can then drill into a prompt and see the details of the prompt and the actions related to the prompt.

Because we don't have a prompt id, I'm having to guess by tying each notification to the last prompt that was submitted. This mostly works, but is error prone. If my system missed a "userPromptSubmitted" event, then it would tie the event to the previous prompt, incorrectly.

### Example prompts or workflows

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.