89bf7657a2
Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
2.0 KiB
2.0 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-read-teamclaude-pool-utilization | Add proxy usage resolver and TeamClaude pool adapter | done | 1 | plan.md |
|
|
|
Task 01: Read TeamClaude Pool Utilization
Summary
Add an ordered proxy-usage resolver layer, then register a TeamClaude status adapter for Claude ACP profiles that explicitly use a loopback TeamClaude upstream URL.
Acceptance
- Only explicit
USAGE_PROXY_VENDOR=teamclaudeplus a loopbackANTHROPIC_BASE_URLenables TeamClaude status discovery. - New proxy adapters can register a resolver without adding proxy-specific branching to the common usage adapter.
- The usage result contains only the best usable pool capacity per quota window and no account names or credentials.
- Invalid payloads, unavailable status endpoints, and no usable accounts fail without falling back to a direct Anthropic OAuth request.
Verification
cd apps/backend && go test -tags fts5 ./internal/agent/usage ./internal/backendapp
Files likely touched
apps/backend/internal/agent/usage/client_teamclaude.goapps/backend/internal/backendapp/{usage_adapter,teamclaude_usage}.go- Focused unit tests for parsing and loopback discovery.
Results
- Added the ordered
usageProxyResolverseam ahead of direct provider usage clients. A future proxy adds a resolver; the common usage adapter remains proxy-neutral. - TeamClaude is selected only when the profile sets
USAGE_PROXY_VENDOR=teamclaude. The resolver then derives the status URL from a loopbackANTHROPIC_BASE_URLand refuses remote or credential-bearing URLs. - Pool utilization reports the least-used currently usable account for each known quota window, without retaining account names or credentials.