feat(http): label CLI requests with User-Agent#10
Merged
Conversation
Without a UA the platform's session list could only see reqwest's default placeholder, which the web-account /me/security page rendered as "Unknown browser on Unknown OS". Now every outbound request from the CLI carries: mirrorstack-cli/0.1.0 (macos; aarch64) Centralized in a new src/http.rs module so login + whoami (and future authed commands) all use the same Client builder. Companion change in web-account parses this prefix and renders "MirrorStack CLI on macOS" instead of falling through to the browser-UA branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to web-account's CLI session-label PR (incoming).
Why
Without a UA, the platform's session list shows the CLI as "Unknown browser on Unknown OS" (web-account's `parseUserAgent` only knows browser strings). Now every outbound request labels itself:
```
mirrorstack-cli/0.1.0 (macos; aarch64)
```
Same shape as curl, gh, brew. The web side (separate PR) detects the `mirrorstack-cli/` prefix and renders "MirrorStack CLI on macOS" in the sessions list.
What changed
Test plan
🤖 Generated with Claude Code