mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 10:05:18 +00:00
Implements sandbox-agent-managed hooks that work universally across all agents (Claude, Codex, OpenCode, Amp, Mock). Hooks are shell commands executed at specific lifecycle points in a session. ## Hook Types - on_session_start - Executed when a session is created - on_session_end - Executed when a session terminates - on_message_start - Executed before processing each message - on_message_end - Executed after each message is fully processed ## Features - Hooks are configured via the API when creating sessions - Environment variables provide context (SANDBOX_SESSION_ID, SANDBOX_AGENT, etc.) - Configurable timeout per hook - continue_on_failure option to control execution flow - Working directory support for hook execution ## API Changes - CreateSessionRequest now accepts optional 'hooks' and 'workingDir' fields - HooksConfig and HookDefinition schemas added to OpenAPI spec ## Testing - 8 unit tests for hook execution - 9 integration tests using mock agent with snapshot testing - Tests cover all lifecycle hooks, multiple hooks, failure handling, and env vars |
||
|---|---|---|
| .. | ||
| packages | ||
| AGENTS.md | ||
| ARCHITECTURE.md | ||
| CLAUDE.md | ||