Hook input has no identifier grouping tool calls within one assistant response
Les mainteneurs répondent en général sous 1 jour
@zikajk y travaille déjà.
Depuis le 9/10/2026.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
Start by reading the documented chat-scoped hook input and the preToolCall fields described in the issue; compare them with the read-chat alternative. Done means adding a per-response identifier that stays the same across hook firings in one assistant response and changes for the next.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What I'm trying to do
Enforce "one git write per assistant response" with a preToolCall hook. Tool calls within a single response run concurrently, so a git write batched with any other git command contends on index.lock, and a read-back issued alongside its write can report pre-write state. Both fail silently, which is what makes a hook the right tool: the failure is invisible in the transcript, so a rule in the system prompt doesn't survive contact with an instruction to batch independent calls.
The gap
To decide whether two calls belong to the same response, the hook needs to know which response each came from. Nothing in the input says.
Documented chat-scoped input gives chat_id, session_id, agent, behavior, full_model, variant, and preToolCall adds tool_name, server, tool_input, tool_call_id, approval. tool_call_id is per call, chat_id is per conversation. There is no identifier at the granularity in between.
Why a timestamp heuristic doesn't substitute
Correction, see the comment below. The 3562ms row in this table was not a measurement and is retracted. The real picture is worse for heuristics, not better: same-response gaps reach 10717ms, because the gap includes however long the model spent emitting the second call. The two distributions overlap completely rather than nearly touching, so no threshold exists at all.
I tried a time window, on the assumption that calls within one response dispatch milliseconds apart while consecutive responses are separated by an LLM round-trip. Measured gaps between consecutive preToolCall firings, one session:
| calls | same response | gap |
|---|---|---|
two eca__git reads |
yes | 62ms |
two eca__shell_command |
yes | 64ms |
git commit then git log |
yes | 3562ms |
| assorted | no | 5008ms, 6628ms, 9007ms |
Same-response gaps span 62ms to 3562ms and cross-response gaps start at 5008ms, so the distributions nearly touch. Any threshold either misses real batches or blocks the first call of the next response. I confirmed the concurrency is real rather than an artefact: two eca__shell_command calls each running sleep 3 overlapped for the full three seconds.
Proposal
Add a per-response identifier to chat-scoped hook input, something like request_id or turn_id, stable across every hook firing within one assistant response and different for the next. A hook can then group calls exactly, with no heuristic.
This would also give tool hooks a reliable key for per-turn state. agent distinguishes a subagent from the primary agent, but not one of its turns from the next, so any hook keeping state across calls currently has the same problem.
Alternative considered
read-chat can reach the chat history from a hook, but it runs synchronously inside a 30s budget on every matching tool call, which is a lot of work to answer "which response is this". A field in the payload is far cheaper.
- Langage dominant
- Clojure
- Étoiles
- 1k
- Forks
- 82
- Merge moyen
- 21 h 52 min
- PR mergées (30 j)
- 13
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de editor-code-assistant/eca
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
editor-code-assistant/eca#717 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Models doesn't work when fetchModels: false is usedPeut-être à nouveau libre @zikajk l’a pris il y a 45 jours, et aucune pull request n’est ouverte. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
editor-code-assistant/eca#661 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
editor-code-assistant/eca#719 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 66/100
editor-code-assistant/eca#716 ·
Les mainteneurs répondent en général sous 1 jour
-
Add delete_file toolOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
editor-code-assistant/eca#708 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de editor-code-assistant/eca
Issues similaires
-
Build fails with `compile-css`Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
nextjournal/clerk#830 ·
-
nREPL server never answers a request with non-ASCII text that arrives in more than one chunkOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
penpot/penpot#13540 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100