Repository navigation
Commit 1006f00
committed
fix(hooks): resolve sessionID for agents to support main thread recognition
Treat sessionID as the subagent signal in the runner envelope. Kilo and
OpenCode currently expose only {tool, sessionID, callID} on the
tool.execute.before input, with no parentID or agent name (verified by
the probe in /tmp/kilo-hook-probe.log, see community issue
anomalyco/opencode#15403 which proposed surfacing parentAgent and
closed as stale on 2026-07-03). On the kilo jetbrains surface every
delegated subagent has a populated sessionID, so the runner can pass
is_subagent: true for those and the gate's subagent delegation path
accepts them. The downside: the main thread also has a populated
sessionID, so main-thread file edits also pass. The gate's shell-level
Rule A still fires for sed/tee/redirect writes, so the protection is
partial, not absent. A proper fix needs upstream support for
parentAgent in the hook envelope.1 parent 3f2abe7 commit 1006f00
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| |||
0 commit comments