[Improve] Show Zoo Code in outbound provider activity logs#219
Conversation
|
2 issues outstanding. Action required. See task
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
5849da5 to
bbc7d19
Compare
bbc7d19 to
23fbb96
Compare
|
Wait for #123 to be merged, as it integrates the final Roo and Zoo renaming changes. |
proyectoauraorg
left a comment
There was a problem hiding this comment.
Thanks for finishing this off, @edelauna — this is a clean superset of what I had in #273, and the regression coverage for the Codex / Unbound / Bedrock custom paths is great to see. Two things worth a look before merge:
1. originator change on the Codex / OpenAI-native paths (possible auth impact).
This flips originator: "roo-code" → "zoo-code" in openai-codex.ts and openai-native.ts. Unlike User-Agent / HTTP-Referer / X-Title (free-form, safe to rebrand), originator on the Codex OAuth path can be a registered client identifier the ChatGPT/Codex backend recognizes. If roo-code is allowlisted server-side, switching it could get Codex auth/requests rejected. I deliberately kept it as roo-code in #273 for this reason. Could we confirm the backend accepts zoo-code as an originator before merging — or hold that one value back if it's uncertain?
2. One outbound path still identifies as Roo: qdrant-client.ts.
src/services/code-index/vector-store/qdrant-client.ts still sends "User-Agent": "Roo-Code" (2 spots) and isn't included here. If the goal is consistent outbound identity, worth folding it in too.
Everything else looks consistent and well-tested. Happy to help with either if useful. 🦘
23fbb96 to
7eda7e6
Compare
7eda7e6 to
c77e436
Compare
c77e436 to
339e832
Compare
Brings in: - chore: prepare v3.56.0 release (Zoo-Code-Org#398) - fix: API requests hang indefinitely on VS Code 1.122.0+ (Zoo-Code-Org#383) - feat: add Claude Opus 4.8 support across Anthropic, Bedrock, and Vertex (Zoo-Code-Org#386) - Show Zoo Code in outbound provider activity logs (Zoo-Code-Org#219) Conflict resolutions and adjustments below. Anthropic Opus 4.8 (packages/types/src/providers/anthropic.ts) -------------------------------------------------------------- Kept our effort-array shape from 64fc5fc (supportsReasoningEffort: [low, medium, high, xhigh, max], default "high", requiredReasoningEffort: true). Discarded upstream's binary supportsReasoningBudget + supportsReasoningBinary shape -- the local fork uses effort-based reasoning across all Anthropic Opus 4.x models (foundation: fd93c5b). Vertex Opus 4.8 (packages/types/src/providers/vertex.ts) -------------------------------------------------------- Upstream's verbatim Vertex 4.8 entry would emit a 400 in our codebase: unlike Bedrock, Vertex has no provider-side adaptive-thinking guard, so the registry shape alone decides the request payload. With supportsReasoningBudget: true, our getAnthropicReasoning() would emit { thinking: { type: "enabled", budget_tokens } } -- which Opus 4.8 rejects. Converted Vertex 4.8 to the same effort-array shape as our Anthropic 4.8 so the helper hits the adaptive/effort branch and emits { thinking: { type: "adaptive" }, output_config: { effort: "high" } }. The pre-existing Vertex Opus 4.7 entry still uses the legacy budget shape (also broken on the API). That's a known follow-up from fd93c5b and intentionally out of scope for this merge. Vertex provider (src/api/providers/anthropic-vertex.ts) ------------------------------------------------------- Dropped upstream's explicit getAnthropicProviderReasoning() call in getModel() and the associated import. Our getModelParams({format: "anthropic"}) already returns params.reasoning via the unified getAnthropicReasoning helper (post-fd93c5bde), so the explicit call would duplicate the wiring and lose user-chosen efforts (upstream's call site omits reasoningEffort). Bedrock (src/api/providers/bedrock.ts, packages/types/src/providers/bedrock.ts) ------------------------------------------------------------------------------ Took upstream verbatim. The Bedrock provider has its own isAdaptiveThinkingModel guard that overrides the request payload regardless of registry shape, so the budget-shape registry entries are fine here. Tests (src/api/providers/__tests__/anthropic.spec.ts) ----------------------------------------------------- Rewrote four upstream-added Opus 4.8 tests that asserted the budget/binary shape to mirror our existing 4.7 effort-shape tests: - "should use adaptive thinking ..." -> assert output_config.effort: "high" - "should omit thinking when reasoning disabled" -> replaced with "should always emit adaptive thinking (reasoning is required)" - "should preserve custom maxTokens" -> replaced with "should honor user-chosen effort" (matching our 4.7 pattern) - "should handle Claude Opus 4.8 model correctly" -> assert supportsReasoningEffort array, default "high", requiredReasoningEffort Verification ------------ - pnpm -w check-types: 11/11 packages clean - pnpm -w test: 22 failures, all pre-existing in reasoning.spec.ts and model-params.spec.ts (matches MEMORY baseline from fd93c5b fixture drift). Zero new failures.
Related GitHub Issue
Closes: #203
Description
Some outbound requests from Zoo Code still identified themselves as Roo Code in provider-side activity and auth flows. The gaps were in paths that bypass the shared header helper or carry their own app metadata: OpenAI Codex, Unbound, Bedrock, the code-index embedders (Qdrant client), image generation requests, and the cloud auth/share package.
This PR updates all remaining hardcoded identity strings in those paths to use Zoo Code branding, adds regression coverage for each custom request path via focused unit tests, and adds e2e smoke tests that verify the correct identity headers reach the OpenRouter and Bedrock endpoints at the wire level.
Key implementation details:
openai-codex.ts/openai-native.ts: updatedoriginator,User-Agent, and related fields in all three request paths (SDK path, fetch fallback,completePrompt())unbound.ts: updated bothX-Unbound-Metadataandunbound_metadata.originAppqdrant-client.ts: updatedUser-Agentin both URL-based and host-based client construction pathsTest Procedure
Unit tests:
```
pnpm test -- --testPathPattern="openai-codex|unbound|qdrant"
```
E2e smoke tests (mock mode, no credentials required):
```
cd apps/vscode-e2e && pnpm test --grep "identity-smoke"
```
The OpenRouter smoke test intercepts
fetchat the origin level and assertsX-Title,HTTP-Referer, andUser-Agenton every captured request for the task. The Bedrock smoke test starts a local h2c server, runs a task against it, and asserts the AWS SDK wroteZooCode#into theuser-agentheader.Pre-Submission Checklist
Screenshots / Videos
N/A — no UI changes.
Documentation Updates
Additional Notes
The
originatorfield on the Codex/OpenAI-native OAuth path was flagged as a potential registered client identifier. We've updated it tozoo-codeconsistent with the rest of the rename; if the Codex backend allowlists by originator and rejectszoo-code, that field can be held back independently without affecting any other identity change in this PR.Get in Touch
Discord: edelauna