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 +``` +