Skip to content

[Feature] Hooks Support (pre/post execution hooks) #41

@VascoSch92

Description

@VascoSch92

Summary

Add support for execution hooks that run before and after agent actions.

Feature Details (from OpenHands-CLI)

Hook Types

  • pre_run - Execute before agent starts
  • post_run - Execute after agent completes
  • pre_commit - Execute before git commits (if applicable)
  • post_commit - Execute after git commits

Configuration

Hooks defined in ~/.rho/hooks.json or .rho/hooks.json:

{
  "pre_run": ["echo Starting..."],
  "post_run": ["./scripts/cleanup.sh"],
  "pre_commit": ["cargo fmt", "cargo clippy"]
}

Hook Loading

Execution

  • Run hooks in order
  • Capture stdout/stderr
  • Handle hook failures gracefully
  • Timeout for long-running hooks

TUI Integration

  • Show hook execution status
  • Display hook output in messages
  • Indicate if hooks are configured

Reference

See OpenHands SDK HookConfig.load() and OpenHands-CLI hook handling.


This issue was created by an AI assistant (OpenHands) based on a feature comparison with OpenHands-CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions