hooks: the edit gate counts a failed lookup and an unrun command as a check
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 72/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- node.js, typescript
Piste de recherche
Start with .intent/hooks/intent-claude-gate.mjs, focusing on main() and the SessionStart and PreToolUse paths described in the issue. Trace createSessionCatalogContext, appendObservation, and parseIntentInvocation, then check the hook’s available PostToolUse handling. Done means failed or unrun lookups do not unlock edits, while a successful catalog shown at session start or a successful command run does.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Which version
@tanstack/intent 0.5.6. The hook was written by pnpm exec intent hooks install --scope project --agents claude, and the file is .intent/hooks/intent-claude-gate.mjs.
What happens
The gate lets edit tools through once the session's state file holds a list or a load (hasIntentCheck). Two paths write that record without the skills ever having been looked up.
1. A failed lookup at session start still counts as a check.
In main(), on SessionStart:
const additionalContext = await createSessionCatalogContext(rootForEvent(event))
appendObservation(stateFile, { action: 'list', raw: CATALOG_COMMAND })
if (additionalContext) {
process.stdout.write(JSON.stringify(sessionStartOutput(additionalContext)))
}
createSessionCatalogContext catches every error and returns ''. So when the lookup fails (Intent not installed, the local CLI not found, the list command failing), no catalog is shown to the agent, but list is recorded anyway, and every edit is allowed from then on.
2. A proposed command is recorded before it has run.
The observation is taken in PreToolUse from the text of the Bash command (parseIntentInvocation), before the command runs and whatever it does. So these are recorded as a check, and unlock edits:
false && pnpm exec intent list(Intent never runs)pnpm exec intent listwhen it then exits non-zero- a Bash call the user declines at the permission prompt
What I expected
- On
SessionStart,listis recorded only when the catalog was produced and handed to the agent. - A
listorloadtyped by the agent is recorded once it has run and succeeded, for example fromPostToolUsewith the tool's result, not from the command text inPreToolUse.
Why it matters
The gate's promise is "the agent looked the skills up before its first edit". Both paths let a session edit with no skill list ever shown, and nothing tells the user that the lookup did not happen.
Happy to test a fix.
- Langage dominant
- TypeScript
- Étoiles
- 360
- Forks
- 27
- Merge moyen
- 23 h 3 min
- PR mergées (30 j)
- 15
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
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 TanStack/intent
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 45/100
TanStack/intent#238 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Avoid parsing skill metadata rejected by effective policyPeut-être à nouveau libre @itsfaqih l’a pris il y a 32 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
TanStack/intent#237 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 45/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TanStack/intent
Issues similaires
-
inference/go type/feature
Difficulté 1/5 1-3 heures Accessibilité débutants 72/100
anomalyco/opencode#65148 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
truapi-release
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
paritytech/product-sdk#529 ·
Les mainteneurs répondent en général sous 1 jour
-
Add: Mansudae TVOuverteapproved check:passed streams:add
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
Les mainteneurs répondent en général sous 1 jour
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
devlikeapro/waha#2369 ·
Les mainteneurs répondent en général sous 5 jours