latent.serve.deployed¶
Deployed self-registration for latent serve (ADR-011 D3, ADR-007 D2, T13).
The container entrypoint runs latent serve <agent> --version <v>; with a version
set, the pod self-registers origin="deployed" against Studio, advertising its
stable ingress URL (LATENT_SERVE_PUBLIC_URL) + version so Studio routes to it and
v1/v2 coexist (ADR-011 D3). /readyz stays 503 until the first successful
registration, so Kubernetes holds traffic until Studio knows the pod. SIGTERM/SIGINT
cancel the heartbeat; the pod does not de-register, since its row is shared with the
version's other replicas and the pod replacing it; a lapsed lease drops it from routing.
Functions¶
configure_pod_logging¶
Install a stdout INFO handler on the root logger for a pod entrypoint.
Public because agent-studio's extension server (studio_extension) calls
it too, before it listens.
The pod runs uvicorn with log_config=None and installs no root handler, so
without this kubectl logs shows nothing but crash tracebacks — no
registration or per-turn lines. Idempotent: a second call is a no-op once a
StreamHandler is present.
serve_deployed¶
serve_deployed(make_agent: AgentFactory, name: str, version: str, host: str = '0.0.0.0', port: int = 8080, secret: str, public_url: str | None = None, manifest: AgentManifest | None = None) -> None
Serve make_agent in-cluster and self-register it with Studio as deployed.
When AGENT_KNOWLEDGE_DIGEST is set, the pinned bundle is fetched before
the server listens and its digest is reported at registration
(:mod:latent.serve.knowledge_fetch); a refused bundle raises.