Repository navigation
feat(app_server): add /api/v1/epic-poem/name endpoint (test-only, do not merge) - #1608
juanmichelini wants to merge 2 commits into
Conversation
Add a demo endpoint that returns the title used by the /epic-poem slash command. The Canvas UI calls this before invoking the command so the agent receives a poem name from the enterprise backend. 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.
🔍 Preview Verification — FAILTarget: saas-deploy PR #2646 App: https://pr-2646.staging.all-hands.dev Result: FAILOne check failed. The PR description says the endpoint is unauthenticated, like Baseline smoke
Feature test — Epic Poem endpoint + composer button
Key screenshotsWhat was tested
Skipped / manual review
EvidenceFull log: evidence/run-log.json Generated by an AI agent (OpenHands). Components under test
|
Review posted for
|
The Canvas /epic-poem slash command looks the poem name up before a conversation exists, so the request carries no app session. The auth middleware treated it like any other /api/v1 route and answered 401 NoCredentialsError (found by the preview-verification run of #1608). Allowlist it next to /api/v1/web-client/config, which the endpoint is modeled on. Also mount the route through v1_router in its test so the test hits the path the middleware allowlists, and cover the allowlist entry in test_auth_middleware.py. Co-authored-by: openhands <openhands@all-hands.dev>
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Scope: This is a small, self-contained backend leg of a four-repo demo bundle explicitly marked test-only/do-not-merge, used to exercise the verify-this preview-verification automation. The pattern (a real FastAPI router + middleware bypass entry + unit tests, deployed via a real enterprise-server image) matches this repo's own documented cross-repo-testing workflow, so this belongs here and needs no separate architecture decision.
Correctness: epic_poem_router.py is a minimal, deterministic GET /epic-poem/name endpoint, correctly mounted under /api/v1 via v1_router.py (confirmed against openhands/app_server/app.py). The exact-match entry added to SetAuthCookieMiddleware._should_attach's ignore_paths tuple in server/middleware.py is consistent with the existing /api/v1/web-client/config pattern and does not use prefix/startswith matching, so it can't be abused to bypass auth on unintended sub-paths.
History check: The PR's prior commit (51496a7e9) was preview-verified and failed — the endpoint answered 401 NoCredentialsError without a session, contradicting the "unauthenticated like /web-client/config" description. The current head (f8984aca5, pushed after that failure) adds exactly the middleware bypass entry needed to fix that, plus a new unit test (test_middleware_ignores_epic_poem_name_path) that asserts the middleware no longer raises NoCredentialsError for this path — directly covering the reported regression.
Tests/CI: Unit tests for both the router (test_epic_poem_router.py) and the middleware bypass are included and scoped correctly. GitHub Actions checks on this head are green (lint, CodeQL, Docker builds, most Python test shards); two shards were still in progress at review time with no failures reported.
Non-blocking note: The only live preview-verification evidence on this PR (posted 2026-12-01) targeted the earlier, failing commit. No fresh preview-verification run has been posted against this fixed head yet. The unit test gives good confidence the fix is correct, but re-running the verify-this automation against f8984aca5 before relying on this leg to validate the rest of the cross-repo bundle would close that gap.
✅ APPROVED
LLM profile: unknown · Model: openhands/claude-sonnet-5







This PR was created by an AI agent (OpenHands) on behalf of the user.
In plain words
Adds a demo backend endpoint
GET /api/v1/epic-poem/namethat returns the title used by the/epic-poemslash command.Why
This is one of four PRs across
enterprise,software-agent-sdk,OpenHands/OpenHands, andextensionsthat 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 theverify-thispreview-verification automation with a multi-PR, multi-repo bundle — the prior examples only bundled one or two image-pinned PRs.This PR is the enterprise leg (the backend endpoint). It is the PR that carries the
verify-thislabel that triggers the automation.Summary
The endpoint is unauthenticated (like
/web-client/config) because the Canvas UI calls it pre-conversation, before a user message exists. It returns a fixed, deterministic value so the demo is screenshot-able.Cross-repo bundle — deploy together
This feature is split across four PRs. The three non-enterprise legs are linked here so the preview-verification automation pins their images alongside this PR's
enterprise-serverimage.feat(agent_server): add /api/epic-poem/name endpoint):ghcr.io/openhands/agent-server:sha-<head>. Deployed with it because: the agent server contributes its own/api/epic-poem/nameendpoint that the demo exercise hits as a second leg; without it the bundle only covers one backend image and the multi-PR pin is not exercised.feat(chat): add Epic Poem button to composer):ghcr.io/openhands/agent-canvas:sha-<head>. Deployed with it because: the Canvas composer button is the user-visible entry point that calls this PR's/api/v1/epic-poem/nameendpoint and inserts the/epic-poemcommand; without it there is nothing to screenshot on the Canvas side.feat: add epic-poem skill): the/epic-poemslash command and its prompt. Not an image — pinned viaEXTENSIONS_REF=OpenHands/extensions@<merge-sha>on the preview. Deployed with it because: the command the Canvas button inserts does not resolve without this skill loaded, so the demo cannot run end-to-end without it.EXTENSIONS_REF=OpenHands/extensions@<merge-sha>must be set on the preview for the/epic-poemcommand to resolve; the other three legs are pinned by image SHA.How to Test
pytest tests/unit/app_server/test_epic_poem_router.py— assertsGET /namereturns{"name": "The OpenHands Epic"}.Type
Notes
Test-only. Part of a cross-repo
/epic-poemdemo bundle. Do not merge.Enterprise server image for this PR: