Skip to content

Server details - #362

Merged
xingyaoww merged 15 commits into
mainfrom
server-details
Sep 21, 2025
Merged

xingyaoww merged 15 commits into
mainfrom
server-details

Conversation

@tofarr

@tofarr tofarr commented Sep 19, 2025 •

Copy link
Copy Markdown
Collaborator

Overview

This PR adds server health monitoring and operational endpoints to the OpenHands Agent Server, along with improved API documentation and examples.

image

Changes Made

🏥 Server Health & Monitoring

  • New Router: Added server_details_router.py with health monitoring endpoints:
    • GET /alive - Simple alive check returning {"status": "ok"}
    • GET /health - Health check endpoint returning "OK"
    • GET /server_info - Detailed server information including uptime and idle time
  • Activity Tracking: Integrated activity tracking that updates last execution time when events occur
  • Server Metrics: Tracks server uptime and idle time since last agent activity

📚 API Documentation Improvements

  • Enhanced FastAPI Metadata: Updated API title to "OpenHands Agent Server" with comprehensive description
  • Endpoint Documentation: Added detailed docstrings to all conversation endpoints
  • Request Examples: Added comprehensive examples for StartConversationRequest including:
    • LLM configuration with model and API key
    • Tool specifications (BashTool, FileEditor, TaskTracker)
    • Sample initial message

🔧 API Enhancements

  • Improved Descriptions: Updated endpoint descriptions to be more user-friendly:
    • Removed "local" references for broader applicability
    • Added clear descriptions for pause/resume/delete operations
  • Better Request Handling: Enhanced request body handling with examples in OpenAPI documentation

Technical Details

Files Modified

  • openhands/agent_server/api.py - Added server details router and enhanced API metadata
  • openhands/agent_server/conversation_router.py - Added documentation, examples, and improved descriptions
  • openhands/agent_server/conversation_service.py - Integrated activity tracking
  • openhands/agent_server/server_details_router.py - New file with health monitoring endpoints

New Endpoints

GET /alive        - Basic alive check
GET /health       - Health status
GET /server_info  - Server uptime and idle time metrics

Benefits

  1. Operational Monitoring: Enables monitoring of server health and activity
  2. Better Documentation: Improved API documentation with examples makes integration easier
  3. Production Readiness: Health endpoints support deployment monitoring and load balancer health checks
  4. Developer Experience: Clear examples and documentation improve SDK usability

Testing

The changes maintain backward compatibility and add new functionality without breaking existing endpoints. The health endpoints provide simple, reliable monitoring capabilities for production deployments.

@github-actions

Copy link
Copy Markdown
Contributor

Agent Server image for this PR

Pull (multi-arch manifest):

docker pull ghcr.io/all-hands-ai/agent-server:ee1ad69

Run:

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-ee1ad69 \
  ghcr.io/all-hands-ai/agent-server:ee1ad69

This tag is a multi-arch manifest (amd64/arm64). Your client pulls the right arch automatically.

@xingyaoww xingyaoww left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still have a lot to change from tool serialization side (#350)

I think this PR should wait until we finalize those

Comment thread openhands/agent_server/conversation_router.py Outdated
Comment thread openhands/agent_server/conversation_router.py Outdated
@openhands-ai

openhands-ai Bot commented Sep 21, 2025

Copy link
Copy Markdown

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

  • GitHub Actions are failing:
    • Pre-commit checks
    • Agent Server

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

@OpenHands please fix the failing actions on PR #362 at branch `server-details`

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

You can manage your notification settings

@xingyaoww
xingyaoww enabled auto-merge (squash) September 21, 2025 22:08
@xingyaoww
xingyaoww merged commit dc65739 into main Sep 21, 2025
14 checks passed
@xingyaoww
xingyaoww deleted the server-details branch September 21, 2025 22:09
StressTestor pushed a commit to StressTestor/software-agent-sdk that referenced this pull request Jun 1, 2026
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
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