Skip to content

feat(agent_server): add /api/epic-poem/name endpoint (test-only, do not merge) - #7220

Open
juanmichelini wants to merge 1 commit into
mainfrom
epic-poem-command
Open

juanmichelini wants to merge 1 commit into
mainfrom
epic-poem-command

Conversation

@juanmichelini

@juanmichelini juanmichelini commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

This PR was created by an AI agent (OpenHands) on behalf of the user.

In plain words

Adds a demo agent-server endpoint GET /api/epic-poem/name that returns the poem name used by the /epic-poem slash command, sourced from the EPIC_POEM_NAME env var (default The OpenHands Epic).

Why

This is one of four PRs across enterprise, software-agent-sdk, OpenHands/OpenHands, and extensions that together form a single cross-repo feature (/epic-poem). The four PRs must be deployed together for the feature to work end-to-end. The bundle is used to test the verify-this preview-verification automation with a multi-PR, multi-repo bundle — the prior examples only bundled one or two image-pinned PRs.

This PR is the software-agent-sdk leg (the agent-server endpoint). The /epic-poem command itself is delivered by the extensions skill (via EXTENSIONS_REF); this endpoint is the backend piece the agent server contributes to the demo.

Summary

+ openhands-agent-server/openhands/agent_server/epic_poem_router.py  (new — GET /api/epic-poem/name → {name})
  openhands-agent-server/openhands/agent_server/api.py               (register the router under /api)
+ tests/agent_server/test_epic_poem_router.py                        (new — default, env-override, blank-env fallback)

The endpoint reads EPIC_POEM_NAME at request time (default The OpenHands Epic); a blank value falls back to the default. This lets a preview deployment set the poem name via env without rebuilding the image.

Cross-repo bundle

This feature is split across four PRs that must deploy together:

Repo PR Role Artifact pinned by verify-this
OpenHands/enterprise OpenHands/enterprise#1608 backend endpoint ghcr.io/openhands/enterprise-server image SHA
OpenHands/software-agent-sdk this PR /epic-poem agent-server endpoint ghcr.io/openhands/agent-server image SHA
OpenHands/OpenHands OpenHands/OpenHands#20195 UI button in the composer ghcr.io/openhands/agent-canvas image SHA
OpenHands/extensions OpenHands/extensions#1014 the skill content (the prompt) git SHA via EXTENSIONS_REF

EXTENSIONS_REF=OpenHands/extensions@<merge-sha> must be set on the preview for the /epic-poem command to resolve; the other three legs are pinned by image SHA.

How to Test

pytest tests/agent_server/test_epic_poem_router.py — covers the default name, an EPIC_POEM_NAME override, and the blank-env fallback.

Type

  • Feature
  • Bug fix
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Test-only. Part of a cross-repo /epic-poem demo bundle. Do not merge.


🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)

• 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-slim amd64, arm64 python-node-runtime Link
python-minimal amd64, arm64 python-node-runtime Link
python amd64, arm64 python-node-runtime 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:3106486-python

Run

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

All tags pushed for this build

ghcr.io/openhands/agent-server:3106486-golang-amd64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-golang-amd64
ghcr.io/openhands/agent-server:epic-poem-command-golang-amd64
ghcr.io/openhands/agent-server:3106486-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:3106486-golang-arm64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-golang-arm64
ghcr.io/openhands/agent-server:epic-poem-command-golang-arm64
ghcr.io/openhands/agent-server:3106486-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:3106486-java-amd64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-java-amd64
ghcr.io/openhands/agent-server:epic-poem-command-java-amd64
ghcr.io/openhands/agent-server:3106486-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:3106486-java-arm64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-java-arm64
ghcr.io/openhands/agent-server:epic-poem-command-java-arm64
ghcr.io/openhands/agent-server:3106486-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:3106486-python-amd64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python-amd64
ghcr.io/openhands/agent-server:epic-poem-command-python-amd64
ghcr.io/openhands/agent-server:3106486-python-node-runtime-amd64
ghcr.io/openhands/agent-server:3106486-python-arm64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python-arm64
ghcr.io/openhands/agent-server:epic-poem-command-python-arm64
ghcr.io/openhands/agent-server:3106486-python-node-runtime-arm64
ghcr.io/openhands/agent-server:3106486-python-minimal-amd64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python-minimal-amd64
ghcr.io/openhands/agent-server:epic-poem-command-python-minimal-amd64
ghcr.io/openhands/agent-server:3106486-python-node-runtime-minimal-amd64
ghcr.io/openhands/agent-server:3106486-python-minimal-arm64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python-minimal-arm64
ghcr.io/openhands/agent-server:epic-poem-command-python-minimal-arm64
ghcr.io/openhands/agent-server:3106486-python-node-runtime-minimal-arm64
ghcr.io/openhands/agent-server:3106486-python-slim-amd64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python-slim-amd64
ghcr.io/openhands/agent-server:epic-poem-command-python-slim-amd64
ghcr.io/openhands/agent-server:3106486-python-node-runtime-slim-amd64
ghcr.io/openhands/agent-server:3106486-python-slim-arm64
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python-slim-arm64
ghcr.io/openhands/agent-server:epic-poem-command-python-slim-arm64
ghcr.io/openhands/agent-server:3106486-python-node-runtime-slim-arm64
ghcr.io/openhands/agent-server:3106486-golang
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-golang
ghcr.io/openhands/agent-server:epic-poem-command-golang
ghcr.io/openhands/agent-server:3106486-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:3106486-java
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-java
ghcr.io/openhands/agent-server:epic-poem-command-java
ghcr.io/openhands/agent-server:3106486-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:3106486-python-minimal
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python-minimal
ghcr.io/openhands/agent-server:epic-poem-command-python-minimal
ghcr.io/openhands/agent-server:3106486-python-node-runtime-minimal
ghcr.io/openhands/agent-server:3106486-python-slim
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python-slim
ghcr.io/openhands/agent-server:epic-poem-command-python-slim
ghcr.io/openhands/agent-server:3106486-python-node-runtime-slim
ghcr.io/openhands/agent-server:3106486-python
ghcr.io/openhands/agent-server:310648612acb7fe5afedcdb8e4c4add4f86f5a90-python
ghcr.io/openhands/agent-server:epic-poem-command-python
ghcr.io/openhands/agent-server:3106486-python-node-runtime

About Multi-Architecture Support

  • Each variant tag (e.g., 3106486-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., 3106486-python-amd64) are also available if needed

Add a demo endpoint on the agent server that returns the poem name used by
the /epic-poem slash command. The value is sourced from the EPIC_POEM_NAME
environment variable (default 'The OpenHands Epic') so a preview
deployment can override it.

This is one of four PRs (enterprise + sdk + openhands + extensions) that
form the /epic-poem cross-repo demo used to test the verify-this
preview-verification automation with a multi-PR bundle.

Test-only; do not merge.
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Agent-server conversation start benchmark

Base main@7b954a3e9f27e806ca97c7e8901daf891f526096 vs this PR merge 458024935f, measured in the same job on the same runner, interleaved: 5 server starts per side and scenario. Medians with 95% bootstrap CIs. The LLM is a mock that answers instantly, so this is agent-server overhead only.

base this PR change
Create conversation (warm) 0.096 s [0.088, 0.115] 0.101 s [0.089, 0.111] +5% ≈ same
↳ first agent event 0.136 s [0.123, 0.151] 0.141 s [0.127, 0.155] +3% ≈ same
First create right after server start 0.288 s [0.102, 0.363] 0.284 s [0.147, 0.390] -1% ≈ same
↳ first agent event 0.439 s [0.257, 0.609] 0.481 s [0.353, 0.653] +10% ≈ same
First create 3 s after server start 0.154 s [0.097, 0.207] 0.120 s [0.108, 0.147] -22% ≈ same
↳ first agent event 0.282 s [0.267, 0.541] 0.314 s [0.289, 0.337] +12% ≈ same
Create in a new git worktree (warm, 0.5 s git fetch) 0.636 s [0.621, 0.660] 0.630 s [0.617, 0.669] -1% ≈ same
↳ first agent event 0.676 s [0.659, 0.709] 0.670 s [0.652, 0.714] -1% ≈ same
Worktree creates that stalled the server > 20 ms 0/20 (0%) 1/20 (5%) +5 pts ≈ same
Create with one stdio MCP server (warm, 3 s startup) 1.094 s [1.088, 1.100] 1.085 s [1.079, 1.099] -1% ≈ same
↳ first agent event 3.593 s [3.575, 3.607] 3.587 s [3.552, 3.599] -0% ≈ same
Creates that stalled the server > 20 ms 1/35 (3%) 0/35 (0%) -3 pts ≈ same
Server startup (/alive) 4.164 s [3.663, 4.557] 3.850 s [3.636, 4.326] -8% ≈ same
How this is measured

Each create is a Canvas-shaped POST /api/conversations (agent profile, worktree: true, first message included, so the request waits for agent startup). A side task polls /alive every 20 ms to catch event-loop stalls. Scenarios, each on its own server starts:

  • default: a fresh directory per create, 8 creates per start.
  • pause: the first create waits 3 s after startup, as a user opening the UI would.
  • worktree: every create branches a new worktree from a local repository whose origin answers fetches after 0.5 s.
  • mcp: the agent profile enables one stdio MCP server that starts after 3 s, like an npx/uvx launch.

A timing is flagged when the 95% CIs do not overlap and the medians differ by at least 50 ms, or when a row with at least 8 samples per side moves by at least 150 ms and 25%. A create stalled the server when its slowest /alive took over 20 ms; stall rows are flagged when the share of stalled creates moves by at least 20 points with a Fisher exact p below 0.01. The first-create rows have one sample per server start, so they are flagged only on a clear change. A "↳ first agent event" row times the create above it until the agent's first event arrives on a socket opened after the create returns, as Agent Canvas does, so it includes the connect and replay. Runner: blacksmith-2vcpu-ubuntu-2404-cv6adc7ajv6rfv2m, 178 environment variables. Run it locally with python scripts/agent_server_benchmarks/conversation_start.py --help.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-agent-server/openhands/agent_server
   api.py4653493%152, 206–207, 216–217, 219, 222–223, 230–231, 245–246, 263, 269, 272–273, 370, 384, 390, 459, 464, 477–479, 512, 541, 547, 551, 572–573, 884, 887, 889, 895
TOTAL605602209964% 

@all-hands-bot

Copy link
Copy Markdown
Collaborator

⚠️ Review paused: current-head checks did not pass

The current head 310648612acb has checks that did not pass, so no review conversation was started:

  • pre-commit

Fix the checks above and push. The scheduled scan then starts the review on the updated head.

This is an automated check - no AI was used to generate this comment.

@juanmichelini juanmichelini added the verify-this Triggers Preview Verification on https://app.beta.staging.all-hands-testing.dev/canvas/automations/ label Dec 2, 2026
@all-hands-bot all-hands-bot removed the verify-this Triggers Preview Verification on https://app.beta.staging.all-hands-testing.dev/canvas/automations/ label Dec 2, 2026
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