Conversation
Remote endpoint dispatch via _route_to_endpoint was missing a User-Agent header. Reuses get_user_agent() from runpod_flash core for consistent identification across all flash HTTP traffic.
There was a problem hiding this comment.
Pull request overview
This PR ensures that cross-endpoint HTTP routing performed by RemoteExecutor._route_to_endpoint includes a User-Agent header identifying the client as Runpod Flash, aligning remote dispatch behavior with expected request metadata.
Changes:
- Add
User-Agent: <Runpod Flash/...>to headers for cross-endpointaiohttprequests viaget_user_agent(). - Add a unit test asserting the
User-Agentheader is present on remote endpoint calls.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/remote_executor.py |
Adds User-Agent header to cross-endpoint routed HTTP requests. |
tests/unit/test_remote_executor.py |
Adds a unit test verifying the User-Agent header is included during cross-endpoint routing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
runpod-Henrik
left a comment
There was a problem hiding this comment.
1. Change — clean
One-liner addition of "User-Agent": get_user_agent() to the headers dict in _route_to_endpoint. The test verifies presence and format. Nothing to object to architecturally.
2. Nit: headers extraction in test is fragile
headers = call_args.kwargs.get("headers") or call_args[1].get("headers")call_args[1] accesses kwargs by numeric index — works today but breaks silently if the call signature changes to positional args. call_args.kwargs.get("headers", {}) is sufficient since post is always called with keyword headers=.
3. Nit: test doesn't verify version is non-empty
The test checks "Runpod Flash/" in headers["User-Agent"] but not that a version follows. get_user_agent() returning "Runpod Flash/" would pass. Worth asserting re.match(r"Runpod Flash/\d+\.\d+", ...) or similar.
Verdict: PASS WITH NITS
Change is correct and minimal. Both nits are low-priority test quality items.
🤖 Reviewed by Henrik's AI-Powered Bug Finder
Summary
_route_to_endpointwas missing aUser-AgentheaderRunpod Flash/<version>User-Agent viaget_user_agent()fromrunpod_flash.core.utils.user_agentTest plan
test_cross_endpoint_routing_includes_user_agent_headerverifiesUser-AgentcontainsRunpod Flash/