Repository navigation
Add OpenCode, Kilo Code, Cline and pi hook adapters; resolve shell paths against the agent's directory - #14
Merged
Merged
Conversation
OpenCode, Kilo Code and pi get a small plugin file (embedded from integrations/) that relays tool calls and finished turns to reflex hook <agent> <event> and applies the JSON verdict. Cline gets a PreToolUse script that calls reflex directly. Cline has no hook that can send the agent back, so it is guarded before tool calls only.
…cument the new agents Relative paths in OpenCode, Kilo Code, Cline and pi tool calls are made absolute against the agent's working directory before they are checked, so a write from a subdirectory is matched the way the agent resolves it. The patch header parser and path resolver from the Codex adapter are shared. Adds docs/agent-hooks.md sections for the four agents (what each can and cannot do, what was verified from source and what was not), the installer file table, the --agent help text and a changelog entry.
…i-hooks # Conflicts: # CHANGELOG.md
rustfuture
force-pushed
the
feat/opencode-cline-pi-hooks
branch
from
October 2, 2026 07:34
a9c3f88 to
dc646a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds hook adapters for four more agents and fixes three problems found while reviewing them.
Adapters
reflex, source inintegrations/) that relays tool calls and finished turns toreflex hook; Cline gets aPreToolUsescript. What each agent can block, ask or send back is listed indocs/agent-hooks.md.crates/reflex-hooks/tests/fixtures/), install/uninstall tests,and Node drivers that load the real plugin sources.
Fixes from review
including Claude Code, Codex and Cursor). With the agent in
app/,echo x > ../secrets/token.txtused to be allowed and
echo x > secrets/token.txt(reallyapp/secrets/token.txt) blocked.Relative targets are now resolved against the agent's directory, falling back to the project root
when the agent does not report one; absolute paths outside the project no longer match root-relative
patterns. A
cdinside the command is not followed (documented under the shell-check limits).reflexrun. A non-zero exit or timeout used to applywhatever JSON was already on stdout.
discarded, so a run that finished during the check went unchecked. It is now rechecked, unless the
running check already sent the agent back with a retry.
Testing
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace --all-targets(206 passed), the demo commands and the fixture check, locally.