Skip to content

Commit c8a3708

Browse files
rickstaaclaude
andauthored
fix(echo): fall back to the public url when internal_url is absent (#56)
internal_url is optional in the trickle channel response: the SDK types it NotRequired and go-livepeer tags it omitempty, so an orchestrator that is not configured to return one omits the key entirely. Indexing it raised KeyError and the runner answered /echo with a 500. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent bf7dfe7 commit c8a3708

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

echo/runner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,16 @@ async def _handle_echo(request: web.Request) -> web.Response:
177177
# for production apps, handle errors
178178
mode = _parse_mode(json.loads(await request.read()))
179179
# internal_url: runner-reachable address (same as the public url on a shared net).
180-
publisher = MediaPublish(by_name["out"]["internal_url"])
180+
publisher = MediaPublish(by_name["out"].get("internal_url", by_name["out"]["url"]))
181181

182182
async def _on_frame(decoded) -> None:
183183
frame = _transform_frame(decoded, mode)
184184
if frame is not None:
185185
await publisher.write_frame(frame)
186186

187-
output = MediaOutput(by_name["in"]["internal_url"], on_frame=_on_frame)
187+
output = MediaOutput(
188+
by_name["in"].get("internal_url", by_name["in"]["url"]), on_frame=_on_frame
189+
)
188190

189191
# Hand public channel urls to the client, so it can send/receive media.
190192
state = EchoSession(

0 commit comments

Comments
 (0)