From a9b04e5cc0d920af2e3c468d0677ea09d10d984e Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 13 Jan 2026 18:33:21 +0000 Subject: [PATCH 1/2] docs: document .openhands/agent_finish.sh hook Co-authored-by: openhands --- openhands/usage/customization/repository.mdx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/openhands/usage/customization/repository.mdx b/openhands/usage/customization/repository.mdx index 26b863b2..16e39933 100644 --- a/openhands/usage/customization/repository.mdx +++ b/openhands/usage/customization/repository.mdx @@ -45,3 +45,23 @@ fi exit 0 ``` + + +## Agent Finish Script + +You can add a `.openhands/agent_finish.sh` file, which will run every time the agent finishes a task (i.e., when the agent emits an `AgentFinishAction` / transitions to the `FINISHED` state). + +- Runs inside the sandbox/runtime environment +- Runs from the repository root (best-effort via `git rev-parse --show-toplevel`) +- Times out after 10 minutes + +For example: + +```bash +#!/bin/bash + +# Example: write a simple summary marker for downstream automation + +echo "OpenHands finished at $(date -Iseconds)" >> .openhands/finish.log +``` + From 340eebf30826f7af935fbd0bb49dcac556609732 Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 2 Feb 2026 13:21:41 +0000 Subject: [PATCH 2/2] docs: rename agent_finish.sh to stop.sh Update documentation to use stop.sh instead of agent_finish.sh, following the standard event-based naming convention. Co-authored-by: openhands --- openhands/usage/customization/repository.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openhands/usage/customization/repository.mdx b/openhands/usage/customization/repository.mdx index 16e39933..f7f5d40f 100644 --- a/openhands/usage/customization/repository.mdx +++ b/openhands/usage/customization/repository.mdx @@ -47,9 +47,9 @@ exit 0 ``` -## Agent Finish Script +## Stop Script -You can add a `.openhands/agent_finish.sh` file, which will run every time the agent finishes a task (i.e., when the agent emits an `AgentFinishAction` / transitions to the `FINISHED` state). +You can add a `.openhands/stop.sh` file, which will run every time the agent finishes a task (i.e., when the agent emits an `AgentFinishAction` / transitions to the `FINISHED` state). - Runs inside the sandbox/runtime environment - Runs from the repository root (best-effort via `git rev-parse --show-toplevel`)