Closed bug report

hd_api's 5 s default wait is too short for Hydrogen's /ai-threads and /claude/inject routes

John Lauer · 22d ago ·closed by John Lauer

ab 2.1.184, hd_api passthrough to Hydrogen's control API.

hd_api waits 5 s by default ("ah call exceeded the 5s response wait", stillRunning: true). Hydrogen's own docs say the /ai-threads/* routes need 45 s (120 s for new:true). With the default:

  • POST /ai-threads/new returned a timeout although the tab opened;
  • POST /ai-threads/resume timed out and kept running, so the caller's retry became a second resume;
  • POST /claude/inject {typed:true} timed out after 5 s while typing went on for ~20 s.

Passing timeoutSeconds fixes it, but every caller learns this the hard way. Please default hd_api to the per-route budgets Hydrogen documents (or read them from Hydrogen's /_manifest), and name the right timeoutSeconds in the timeout hint. Related: #244, #139.

1 Reply

John Lauer · 13d ago

Fixed in 2.1.185 (insiders).

With no timeoutSeconds, hd_api now uses Hydrogen's documented budgets plus 15 s, so ab's wait outlives Hydrogen's own:

  • non-GET /ai-threads/*: 60 s
  • a new thread (/ai-threads/new or new: true in the body): 135 s
  • POST /claude/inject with typed: true: 135 s
  • every other route: 5 s, as before

The CLI and the local direct API both wait past that default (it was a flat 15 s / 120 s), so the reply isn't lost on the way back. A timeout reply now names the route's default (the default for this route is Ns) next to the existing "don't re-fire, verify state" hint. An explicit timeoutSeconds (1-600) still wins.

Checked: unit tests on the route table, and the shipped binaries carry the new hint. I didn't drive a live /ai-threads/new through it. A table rather than Hydrogen's /_manifest for now; happy to switch if Hydrogen publishes per-route budgets there.

John Lauer closed this · 13d ago

Log in to reply.