Repository navigation
feat(hooks): anchor devin-plugin hook commands to DEVIN_PLUGIN_ROOT - #3982
Merged
Merged
Conversation
Devin CLI v3000.5.20+ sets DEVIN_PLUGIN_ROOT for hooks contributed by a plugin, so ./-relative commands in a plugin hooks.json are now written as "$DEVIN_PLUGIN_ROOT"/... and resolve against the plugin install directory instead of the consumer's workspace. Import converts DEVIN_PLUGIN_ROOT, PLUGIN_ROOT and CLAUDE_PLUGIN_ROOT back to ./. Refs #3413 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…vin-plugin-root # Conflicts: # src/generated/docs-content.ts
This was referenced Nov 26, 2026
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.
Summary
Follow-up to #3413 (Gap 4): hook commands in a
devin-pluginbundle'shooks.jsonwere written verbatim, so a./scripts/x.shcommand resolved against the consumer's workspace instead of the plugin install directory. Devin now documents a plugin-root variable, so./-relative commands are anchored to it.Primary sources (https://docs.devin.ai/cli/changelog/stable):
DEVIN_PLUGIN_ROOT."PLUGIN_ROOTfor bundled files".commandis a shell command, so"$VAR"/...expands.Changes
DevinHooksgets a protected staticgetConverterConfig()hook;DevinPluginHooksoverrides it withDEVIN_PLUGIN_CONVERTER_CONFIG(projectDirVar: "$DEVIN_PLUGIN_ROOT",prefixDotRelativeCommandsOnly: true, import aliases$PLUGIN_ROOT/$CLAUDE_PLUGIN_ROOT), mirroringaugmentcode-plugin-hooks.ts../scripts/check.sh->"$DEVIN_PLUGIN_ROOT"/scripts/check.sh; later./script words are anchored too; bare commands (npx prettier --write ./src) stay as written. Thedevintarget is unchanged."$DEVIN_PLUGIN_ROOT"/,$DEVIN_PLUGIN_ROOT/,${DEVIN_PLUGIN_ROOT}/, and the same forms ofPLUGIN_ROOT/CLAUDE_PLUGIN_ROOTconvert back to./.file-formats.md; regenerateddocs-content.ts.e2e-hooks.spec.tsande2e-plugins.spec.tsupdated.Design decisions
DEVIN_PLUGIN_ROOToverPLUGIN_ROOT: it is the Devin-native name and has existed since v3000.5.20, so it works on more CLI versions thanPLUGIN_ROOT(v3000.11.92)."$DEVIN_PLUGIN_ROOT"/...), same as the AugmentCode plugin, so plugin paths containing spaces are not word-split. Devin hooks have no exec form (args), so no braced placeholder variant is needed.CLAUDE_PLUGIN_ROOTis accepted on import because Devin also sets it for hooks (v3000.5.20 changelog), so hand-written plugins using it round-trip to./.prefixDotRelativeCommandsOnly), matching the other plugin targets.Skipped
matcherimport): the hooks overview / lifecycle docs still describematcheras a regex string; only changelog v3000.11.205 mentions a list, with an ambiguous shape. Waiting for docs.ContextInputhook event: only in changelog v3000.12.17, not in the documented event list yet.Local
pnpm cicheck: all green except timing-dependent tests under heavy machine load (load avg ~70);shell-command-categories,orphan-sweep,globpass when rerun alone.opencode-hooks.test.ts"evicts sessionStart contexts in completion order" (real Bun runtime, unrelated code) still timed out locally under load.Refs #3413
🤖 Generated with Claude Code
https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4