hooks: the edit gate counts a failed lookup and an unrun command as a check
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- node.js, typescript
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 360
- Forks
- 27
- Merge médio
- 23h 3min
- PRs com merge (30d)
- 15
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/intent
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 45/100
TanStack/intent#238 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Avoid parsing skill metadata rejected by effective policyTalvez livre de novo @itsfaqih assumiu há 32 dias e não há nenhum pull request aberto. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
TanStack/intent#237 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 45/100
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
Todas as issues de TanStack/intent
Issues semelhantes
-
inference/go type/feature
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 72/100
anomalyco/opencode#65148 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
truapi-release
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
paritytech/product-sdk#529 ·
Mantenedores costumam responder em até 1 dia
-
Add: Mansudae TVAbertaapproved check:passed streams:add
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
Mantenedores costumam responder em até 1 dia
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
devlikeapro/waha#2369 ·
Mantenedores costumam responder em até 5 dias