Skip to content

feat(http): add Runpod Flash User-Agent to cross-endpoint requests#81

Merged
deanq merged 1 commit intomainfrom
deanq/ae-2575-flash-worker-http-user-agent
Mar 23, 2026
Merged

feat(http): add Runpod Flash User-Agent to cross-endpoint requests#81
deanq merged 1 commit intomainfrom
deanq/ae-2575-flash-worker-http-user-agent

Conversation

@deanq
Copy link
Contributor

@deanq deanq commented Mar 20, 2026

Summary

  • Cross-endpoint HTTP dispatch in _route_to_endpoint was missing a User-Agent header
  • Added Runpod Flash/<version> User-Agent via get_user_agent() from runpod_flash.core.utils.user_agent
  • Added test verifying header presence on remote endpoint calls

Test plan

  • New unit test test_cross_endpoint_routing_includes_user_agent_header verifies User-Agent contains Runpod Flash/
  • All 277 tests pass, 81% coverage
  • Pre-commit quality checks pass (format, lint, mypy, tests)

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.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-endpoint aiohttp requests via get_user_agent().
  • Add a unit test asserting the User-Agent header 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.

Copy link

@runpod-Henrik runpod-Henrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@deanq deanq merged commit 23782f8 into main Mar 23, 2026
15 checks passed
@deanq deanq deleted the deanq/ae-2575-flash-worker-http-user-agent branch March 23, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants