Skip to content

feat: add User-Agent header with version, OS, and arch#202

Merged
deanq merged 3 commits intomainfrom
deanq/ae-2106-flash-user-agent
Feb 14, 2026
Merged

feat: add User-Agent header with version, OS, and arch#202
deanq merged 3 commits intomainfrom
deanq/ae-2106-flash-user-agent

Conversation

@deanq
Copy link
Member

@deanq deanq commented Feb 14, 2026

Summary

Add comprehensive User-Agent header to all HTTP transmissions in the flash library for better API analytics, debugging, and deployment environment visibility.

Changes

  • New module: user_agent.py - Centralized User-Agent string generation
  • Updated centralized HTTP utilities: Modified get_authenticated_httpx_client() and get_authenticated_requests_session() to include User-Agent
  • Updated aiohttp clients: Added User-Agent to both RunPodApi and RunPodClient session creation
  • Updated direct requests calls: Added User-Agent to file upload/download operations in app.py
  • Comprehensive test coverage: Added 11 new tests (8 for user_agent module, 4 for HTTP utilities)

User-Agent Format

Runpod Flash/<version> (Python <python_version>; <OS> <OS_version>; <arch>)

Example: Runpod Flash/1.1.1 (Python 3.11.12; Darwin 25.2.0; arm64)

Components

  • Flash version: Package version from metadata
  • Python version: Runtime Python version
  • OS: Operating system name (Darwin, Linux, Windows)
  • OS version: Operating system version/release
  • Architecture: CPU architecture (arm64, x86_64, amd64, etc.)

Test Results

  • All 23 User-Agent tests pass (8 user_agent + 15 http utility tests)
  • Coverage: 69.17% (above 65% threshold)
  • Linting and formatting checks pass

Impact

  • Non-breaking: User-Agent is informational and doesn't affect API functionality
  • Backward compatible: All existing functionality preserved
  • Performance: Negligible overhead (string concatenation)
  • Value: Provides deployment environment insights for debugging and analytics

Benefits

  1. API Analytics: Track flash adoption, version distribution, and platform usage
  2. Debugging: Identify client environment in server logs for troubleshooting
  3. Compliance: Follows HTTP best practices for client identification
  4. Platform Insights: Understand deployment patterns across OS/architecture combinations

@deanq deanq changed the title feat: add User-Agent header to all HTTP requests (AE-2106) feat: add User-Agent header to all HTTP requests Feb 14, 2026
@deanq deanq changed the title feat: add User-Agent header to all HTTP requests feat: add User-Agent header with version, OS, and architecture (AE-2106) Feb 14, 2026
@deanq deanq force-pushed the deanq/ae-2106-flash-user-agent branch from fe688a8 to 0c023c4 Compare February 14, 2026 03:57
@deanq deanq changed the title feat: add User-Agent header with version, OS, and architecture (AE-2106) feat: add User-Agent header with version, OS, and arch Feb 14, 2026
Add User-Agent header to all HTTP transmissions for better API analytics,
debugging, and compliance with HTTP best practices.

Changes:
- Add user_agent.py module with get_user_agent() function
- Update centralized HTTP utilities (httpx and requests)
- Update direct aiohttp usage in RunPod API clients
- Update direct requests usage in app.py for uploads/downloads
- Add comprehensive test coverage for User-Agent functionality

User-Agent format: Runpod Flash/<version> (Python <py_version>; <OS>)
Example: Runpod Flash/1.1.1 (Python 3.11.12; Darwin)
Enhance User-Agent header to include:
- OS version (e.g., Darwin 25.2.0)
- CPU architecture (e.g., arm64, x86_64)

New format: Runpod Flash/<version> (Python <py_version>; <OS> <OS_version>; <arch>)
Example: Runpod Flash/1.1.1 (Python 3.11.12; Darwin 25.2.0; arm64)

This provides better insights into deployment environments for debugging
and analytics purposes.
@deanq deanq force-pushed the deanq/ae-2106-flash-user-agent branch from 0c023c4 to e28bb8d Compare February 14, 2026 04:08
@deanq deanq merged commit 5632907 into main Feb 14, 2026
6 checks passed
@deanq deanq deleted the deanq/ae-2106-flash-user-agent branch February 14, 2026 04:53
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.

2 participants