Description
I'm an AI agent based on Opus 5.5, helping Engel Nyst (@enyst) with project maintenance.
Is there an existing issue for the same bug?
- I have searched existing issues and this is not a duplicate.
Bug Description
GET /api/canvas-extensions/installed/{name}/backend probes a ready backend's health path with a 1 s timeout. A single slow answer sets the state to unhealthy and it stays there: later status calls never probe again, even though the process is alive and /health answers at once. The app backend bridge only forwards to ready backends, so one slow probe takes a Canvas App's backend offline until someone runs stop and then start.
Expected Behavior
Once /health answers in time again, the next GET .../backend returns state: "ready" (whether or not the slow probe was reported), and the bridge forwards to the backend again.
Actual Behavior
- Every later
GET .../backendreturnsstate: "unhealthy",detail: "Backend health probe failed", with the samepid. POST .../backend/startwith the same revision returns that status without restarting anything. The bridge answers 503 "Canvas App backend is not ready". A forced install still gets 409 because the process is still running.- Only
stopfollowed bystartgets back toready.
Steps to Reproduce
uv run agent-server --port 8000- Create an app whose
/healthtakes 2 s afterGET /slow, untilGET /fast:
mkdir -p slowhealth/dist slowhealth/backend slowhealth/b && cd slowhealth
echo 'export default {}' > dist/index.js
cat > b/run.py <<'PY'
#!/usr/bin/env python3
import http.server, sys, time
slow = False
class H(http.server.BaseHTTPRequestHandler):
def do_GET(self):
global slow
slow = {"/slow": True, "/fast": False}.get(self.path, slow)
if self.path == "/health" and slow: time.sleep(2)
self.send_response(200); self.end_headers(); self.wfile.write(b"ok")
http.server.ThreadingHTTPServer(("127.0.0.1", int(sys.argv[1])), H).serve_forever()
PY
chmod +x b/run.py && tar -czf backend/linux.tar.gz -C b run.py
A="{\"path\":\"backend/linux.tar.gz\",\"sha256\":\"$(sha256sum backend/linux.tar.gz | cut -d' ' -f1)\"}"
cat > canvas-extension.json <<EOF2
{"schema_version":1,"name":"slowhealth","display_name":"slowhealth","version":"0.1.0","entrypoint":"dist/index.js",
"backend":{"schema_version":1,"argv":["{artifact_dir}/run.py","{port}"],"inherit_environment":["PATH"],
"artifacts":{"linux-amd64":$A,"linux-arm64":$A},"health":{"path":"/health","timeout_seconds":30,"interval_seconds":0.2}}}
EOF2
cd ..- Start it, make one probe slow, then make
/healthfast again:
S=http://127.0.0.1:8000/api/canvas-extensions; B=$S/installed/slowhealth/backend; J='content-type: application/json'
curl -s -XPOST $S/install -H "$J" -d "{\"source\":\"$PWD/slowhealth\"}"
REV=$(curl -s $B | jq -r .revision); R="{\"revision\":\"$REV\"}"
curl -s -XPOST $B/prepare -H "$J" -d "$R"
PORT=$(curl -s -XPOST $B/start -H "$J" -d "$R" | jq .port) # "ready"
curl -s 127.0.0.1:$PORT/slow; curl -s $B # "unhealthy"
curl -s 127.0.0.1:$PORT/fast; curl -s -m 3 127.0.0.1:$PORT/health # ok, at once
curl -s $B # still "unhealthy", same pid; expected "ready"With the verify-agent-server skill (#5621): control-agent-server map run --file F28 --only F28.status-probe-latch --fresh reports the known-bug bullet as an expected failure while the bug lasts.
Acceptance Criteria
- A live backend whose health path answers in time again is
readyon the nextGET .../backend. - A backend that keeps failing probes, or whose process exited, is still
unhealthy. - A test with a real subprocess covers one slow probe followed by recovery.
- The
F28.status-probe-latchmap bullet passes and its known-bug marker is removed.
Installation Method
uv sync in a checkout of main
Version
main at 2804c12
Additional Context
In openhands-agent-server/openhands/agent_server/canvas_extensions/backend.py:
status()probes only whenruntime.state == "ready"(line 454). One failed_probe(1 s timeout, lines 540-545) setsunhealthy(lines 465-466), and later calls skip the probe.start()returns the current status when the same revision's process is alive (lines 596-602).ready_endpoint()requiresready(lines 779-783), so_ready_endpointincanvas_extensions/bridge.py:345-356answers 503.
Suggested fix: in status(), also probe a live process that a failed probe marked unhealthy (not one that exited or failed to start), and set ready when the probe succeeds. Alternatively, mark unhealthy only after a few consecutive failures.
Activity
enyst commentedon Oct 13, 2026
I'm an AI agent (Claude Code) helping Engel Nyst (@enyst) with project maintenance.
Proposed fix: #5759. This issue has no triage questions or comments yet, so this note only records how the fix handles the two options the issue suggests:
status()now probes again a live process that isunhealthyonly because a probe failed, and sets it back toreadywhen the probe succeeds. A process that exited or failed to start staysunhealthy.start()with the same revision on a live process returns that re-probed status instead of the cached one.unhealthyonly after N consecutive failures. That would hide one slow probe completely, but it would add a threshold to choose and would still need re-probing to recover after N misses. Re-probing alone meets every acceptance criterion, so no maintainer decision is needed here.F28.status-probe-latchmap bullet is updated in the same PR (Add verify-agent-server: an executable feature map and control CLI for the Agent Server API #5621 is merged). Its known-bug marker is removed. The run givesxfailtwice on main andxpasstwice with the fix.Generated by Claude Code