Skip to content

Register droid-* handlers in unified hook system#6

Open
tanuj-corridor wants to merge 2 commits into
mainfrom
tan/register-droid-handlers
Open

Register droid-* handlers in unified hook system#6
tanuj-corridor wants to merge 2 commits into
mainfrom
tan/register-droid-handlers

Conversation

@tanuj-corridor

@tanuj-corridor tanuj-corridor commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Droid (Factory) hooks for stop, beforeExecution, afterFileEdit, and promptSubmit were silently failing because the unified handler system only registered claude-* and cursor-* subcommands — not droid-*
  • Adds PlatformDroid and PlatformCascade platform constants
  • Registers droid-stop, droid-pre-tool-use, droid-after-file-edit, and droid-user-prompt-submit handlers mirroring their claude-* counterparts (Droid uses the same hook API as Claude Code)
  • Updates ShouldSkip() to treat Droid the same as Claude for stop-loop prevention

Test plan

  • cd hookshot && go build ./... — library compiles
  • cd hookshot && go test ./... — all tests pass
  • cd vscode-extension/src/utils/hooks-src && go build ./... — consumer compiles
  • cd vscode-extension && npm run test:go — all Go hook tests pass
  • Manual: start a Factory/Droid session, make a file edit, check ~/.corridor/tmp/corridor-hooks.log for afterFileEdit entries

Open with Devin

Droid (Factory) hooks for stop, beforeExecution, afterFileEdit, and
promptSubmit were not firing because the unified handler system only
registered claude-* and cursor-* subcommands — not droid-*.

When Factory triggered a hook (e.g. `corridor-hooks droid-after-file-edit`),
RunCommand() found no match and exited with "Unknown command", causing the
hook to silently fail.

This adds:
- PlatformDroid and PlatformCascade constants
- droid-stop handler (mirrors claude-stop)
- droid-pre-tool-use handler (mirrors claude-pre-tool-use)
- droid-after-file-edit handler (mirrors claude-after-file-edit)
- droid-user-prompt-submit handler (mirrors claude-user-prompt-submit)

All droid handlers reuse claude.* input/output types since Droid's
hook API matches Claude Code's.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant