Skip to content

refactor(BA-5961): introduce AppProxyClientRegistry for app-proxy domain clients#11491

Draft
jopemachine wants to merge 8 commits intomainfrom
refactor/BA-5961-app-proxy-client-registry
Draft

refactor(BA-5961): introduce AppProxyClientRegistry for app-proxy domain clients#11491
jopemachine wants to merge 8 commits intomainfrom
refactor/BA-5961-app-proxy-client-registry

Conversation

@jopemachine
Copy link
Copy Markdown
Member

Summary

  • Add BaseAppProxyDomainClient mirroring BaseDomainClient, and refactor DeploymentChatClient from a BackendAIAppProxyClient subclass to a domain client composed over one.
  • Introduce AppProxyClientRegistry (client/v2/approxy_registry.py) with the same shape as BackendAIClientRegistry / V2ClientRegistry: create() / close() lifecycle and @cached_property accessors (currently deployment_chat).
  • Add create_appproxy_registry CLI helper alongside create_v2_registry, and switch ./bai deployment chat to consume the registry instead of instantiating DeploymentChatClient directly.
  • Update the unit test fixture to inject a BackendAIAppProxyClient into DeploymentChatClient via the new constructor.

Resolves BA-5961.

…ain clients

Apply the BackendAIClientRegistry / V2ClientRegistry pattern to app-proxy
clients. DeploymentChatClient was previously a direct subclass of
BackendAIAppProxyClient, instantiated by the CLI with a raw ClientConfig;
this divergence from the manager-side SDK shape (where domain clients are
lazy-loaded via a registry) does not scale once more app-proxy domain
clients are added (custom containers, /generate, etc.).

- Add BaseAppProxyDomainClient mirroring BaseDomainClient.
- Compose DeploymentChatClient via BaseAppProxyDomainClient instead of
  subclassing BackendAIAppProxyClient.
- Add AppProxyClientRegistry in client/v2/approxy_registry.py with the
  same lifecycle as BackendAIClientRegistry (create / close /
  @cached_property accessors).
- Add create_appproxy_registry helper alongside create_v2_registry.
- Switch ./bai deployment chat to consume the registry.
- Update tests for the new DeploymentChatClient constructor.

Resolves BA-5961.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jopemachine jopemachine added the skip:changelog Make the action workflow to skip towncrier check label May 6, 2026
@github-actions github-actions Bot added size:L 100~500 LoC comp:client Related to Client component comp:cli Related to CLI component labels May 6, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jopemachine jopemachine removed the skip:changelog Make the action workflow to skip towncrier check label May 6, 2026
jopemachine and others added 6 commits May 6, 2026 17:19
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirror the test_registry.py pattern used by BackendAIClientRegistry:
factory creation, domain client type/inheritance, cached_property
identity, and close() delegation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the runtime list and the "domain clients add X / Y / Z" enumeration —
that's downstream-specific filler that does not belong on the base class.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
App-proxy fronts more than deployment runtimes (e.g. health checks);
drop the "deployment-specific" framing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:cli Related to CLI component comp:client Related to Client component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant