Prompt ID in Hook
- Vorherrschende Sprache
- Shell
- Sterne
- 11.2k
- Forks
- 1.9k
- Ø Merge
- 14 Std. 16 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
### 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_
Beitragsleitfaden
Rechercherichtung
Beginne damit, zu ermitteln, wo Hook-Payloads zusammengestellt werden und wie Session-IDs sowie Ereignisse wie userPromptSubmitted, stopAgent, subAgentStart, subAgentStop, permissionRequest und notification dargestellt werden. Verfolge zuerst die promptbezogenen Ereignisse und definiere anschließend den Abschluss so, dass jeder relevante Hook eine Prompt-ID enthält, die Aktionen zuverlässig mit dem Prompt verknüpft, der sie ausgelöst hat.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- shell
- Bereich
- api
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100