Skip to content

Conversation

@neubig
Copy link
Contributor

@neubig neubig commented Dec 23, 2025

Summary

This PR adds a new example (33_remind_tool.py) that demonstrates how to create a custom "remind" tool that sends deferred messages to the conversation.

What this example shows

The remind tool demonstrates async/deferred tool behavior:

  1. Accepts parameters: A message and delay in seconds
  2. Schedules a future action: The message is sent back to the conversation after the specified delay
  3. Returns immediately: The tool returns a confirmation observation without blocking, allowing the agent to continue working

Use case

This addresses the question about deferred/async tool calls (ActionEvent) without waiting on a tool response (ObservationEvent). The primary use case is Human-in-the-loop as a Tool Call, where the tool can inject messages into the conversation at a later time without blocking the agent.

Key implementation details

  • The RemindExecutor receives the conversation parameter in its __call__ method
  • It spawns a background thread that sleeps for the specified delay, then calls conversation.send_message() to inject the reminder
  • The tool returns immediately with a RemindObservation confirming the reminder was scheduled

Files added

  • examples/01_standalone_sdk/33_remind_tool.py - The example demonstrating the remind tool
  • tests/sdk/tool/test_remind_tool.py - Unit tests for the remind tool components

Testing

All tests pass:

tests/sdk/tool/test_remind_tool.py::test_remind_tool_name PASSED
tests/sdk/tool/test_remind_tool.py::test_remind_action_validation PASSED
tests/sdk/tool/test_remind_tool.py::test_remind_observation_to_llm_content PASSED
tests/sdk/tool/test_remind_tool.py::test_remind_executor_without_conversation PASSED
tests/sdk/tool/test_remind_tool.py::test_remind_executor_with_conversation PASSED
tests/sdk/tool/test_remind_tool.py::test_remind_tool_create PASSED
tests/sdk/tool/test_remind_tool.py::test_remind_tool_registration PASSED
tests/sdk/tool/test_remind_tool.py::test_remind_tool_execution PASSED

@neubig can click here to continue refining the PR


Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:6ea715d-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-6ea715d-python \
  ghcr.io/openhands/agent-server:6ea715d-python

All tags pushed for this build

ghcr.io/openhands/agent-server:6ea715d-golang-amd64
ghcr.io/openhands/agent-server:6ea715d-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:6ea715d-golang-arm64
ghcr.io/openhands/agent-server:6ea715d-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:6ea715d-java-amd64
ghcr.io/openhands/agent-server:6ea715d-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:6ea715d-java-arm64
ghcr.io/openhands/agent-server:6ea715d-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:6ea715d-python-amd64
ghcr.io/openhands/agent-server:6ea715d-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:6ea715d-python-arm64
ghcr.io/openhands/agent-server:6ea715d-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:6ea715d-golang
ghcr.io/openhands/agent-server:6ea715d-java
ghcr.io/openhands/agent-server:6ea715d-python

About Multi-Architecture Support

  • Each variant tag (e.g., 6ea715d-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 6ea715d-python-amd64) are also available if needed

This example shows how to create a custom tool that:
- Accepts a message and delay in seconds
- Schedules the message to be sent back to the conversation after the delay
- Returns immediately, allowing the agent to continue working

The tool demonstrates async/deferred tool behavior where the tool returns
immediately with a confirmation, but schedules a future action (sending a
message) that will be processed by the agent later.

Use case: Human-in-the-loop as a tool call, where the tool can inject
messages into the conversation at a later time without blocking the agent.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 2025

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL14453682952% 
report-only-changed-files is enabled. No files were changed during this commit :)

@openhands-ai
Copy link

openhands-ai bot commented Jan 2, 2026

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • [Optional] Docs example

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #1493 at branch `remind-tool-example`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

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.

3 participants