Repository navigation
Commit 1e2281f
feat(buzz-agent): send User-Agent on LLM requests (#8116)
## Summary
`buzz-agent` builds its LLM `reqwest::Client` without a User-Agent, and
reqwest sends none by default, so OpenAI-compatible providers that
identify clients by product token see buzz-agent as an anonymous caller.
This sets `User-Agent: buzz-agent/<crate version>` on the shared LLM
client in `crates/buzz-agent/src/llm.rs`. The version is
`CARGO_PKG_VERSION`, the same value `agentInfo` reports over ACP. No
request body or endpoint changes.
Open point: the crate version is the workspace version (`0.1.0`), so
every build reports the same version. A per-build version would need the
desktop to pass one through at spawn time; this PR does not do that.
### Related issue
None found.
### Testing
- The test stub now captures the `User-Agent` request header; new
`llm_requests_carry_buzz_agent_user_agent` asserts
`buzz-agent/<version>` on a Chat Completions POST.
- Verified red without the `.user_agent(...)` line (`left: None`), green
with it.
- `cargo test -p buzz-agent --lib llm::tests`: 194 passed. `cargo fmt`
clean; the one clippy warning is pre-existing (`hints.rs:33`).
- Not exercised in a built desktop app.
Signed-off-by: Tom Bedor <[email protected]>
Co-authored-by: Tom Bedor <[email protected]>1 parent af5bb0a commit 1e2281f
1 file changed
Lines changed: 36 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
2654 | 2661 | | |
2655 | 2662 | | |
2656 | 2663 | | |
| 2664 | + | |
2657 | 2665 | | |
2658 | 2666 | | |
2659 | 2667 | | |
| |||
2728 | 2736 | | |
2729 | 2737 | | |
2730 | 2738 | | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
2731 | 2744 | | |
2732 | 2745 | | |
2733 | 2746 | | |
| |||
2736 | 2749 | | |
2737 | 2750 | | |
2738 | 2751 | | |
2739 | | - | |
2740 | | - | |
2741 | | - | |
2742 | | - | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
2743 | 2758 | | |
2744 | 2759 | | |
2745 | 2760 | | |
| |||
2800 | 2815 | | |
2801 | 2816 | | |
2802 | 2817 | | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
2803 | 2835 | | |
2804 | 2836 | | |
2805 | 2837 | | |
| |||
0 commit comments