hooks: the edit gate counts a failed lookup and an unrun command as a check
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 360
- フォーク
- 27
- 平均マージ
- 23時間 3分
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/intent のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
TanStack/intent#238 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Avoid parsing skill metadata rejected by effective policy再び着手できるかも @itsfaqih が 32 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
TanStack/intent#237 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
TanStack/intent の issue をすべて見る
似ている issue
-
inference/go type/feature
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#65148 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
truapi-release
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
paritytech/product-sdk#529 ·
メンテナーはふだん 1 日以内に返信
-
Add: Mansudae TVオープンapproved check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
devlikeapro/waha#2369 ·
メンテナーはふだん 5 日以内に返信