Add is_alive liveness-probe API across SDKs (decouple liveness from typed ping deserialization)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Área
- api, backend-api-design, documentation
Línea de trabajo
Comienza con los puntos de entrada de ping de Client indicados en rust/src/lib.rs:1676, nodejs/src/client.ts:1032, go/client.go:1317, dotnet/src/Client.cs:874 y el cliente Python equivalente; después, inspecciona @github/copilot/schemas/api.schema.json. Ejecuta las pruebas del SDK y añade cobertura para una respuesta JSON-RPC válida cuyo cuerpo de ping falle durante la deserialización estricta. Se considera terminado cuando cada Client tiene un método de liveness apropiado para el lenguaje, las APIs de ping tipadas existentes permanecen sin cambios y cada SDK documenta la distinción.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The Copilot CLI host (github/github-app) had to work around a deserialization failure in our SDK's typed ping() API on the session-resume / warm-CLI-pool / liveness-probe paths. See github/github-app#5461 for the workaround.
Their fix introduces a ping_cli_compat(&client) helper that drops to the raw client.call("ping", json!({})) so the result body is never deserialized — they only care whether the JSON-RPC round trip succeeded.
We should give them (and everyone doing liveness checks) a first-class primitive instead of forcing them to bypass our typed API.
Root cause
Across all five SDKs, ping() deserializes the response into a typed body:
- Rust:
Client::ping(&self) -> Result<PingResponse, Error>(rust/src/lib.rs:1676) - Node:
client.ping()returning{message, timestamp, protocolVersion?}(nodejs/src/client.ts:1032) - Go:
client.Ping(ctx, msg) (*PingResponse, error)(go/client.go:1317) - .NET:
client.PingAsync(...) : Task<PingResponse>(dotnet/src/Client.cs:874) - Python: equivalent typed return
The authoritative PingResult schema (@github/copilot/schemas/api.schema.json) requires message, timestamp (date-time string), and protocolVersion (integer > 0). The Rust hand-written PingResponse softens this with #[serde(default)] and Option<u32>, but that only helps for missing fields — wrong types (e.g. null timestamp, integer-shape drift) still fail. Same brittleness exists across the other SDKs.
ping is used by hosts as a liveness check (warm-pool reuse, resumed-session aliveness, retrier "is the cached client still alive" probes). These paths straddle CLI version boundaries — a resumed older CLI process can answer with a slightly different ping body shape, and the entire liveness check fails even though the RPC itself succeeded.
This is exactly the wrong failure mode for a health check: the consumer asked "is the CLI reachable?" and we answered "no" because of a body-shape mismatch.
Proposed fix
Add a dedicated liveness-probe API to every SDK Client:
- Sends the
pingJSON-RPC call. - Returns success based solely on JSON-RPC success — never deserializes the result body.
- Composable with caller-supplied timeouts — no baked-in timeout, so each host (startup probe, warm-pool, resume probe, background keepalive) sets its own budget.
ping()and generatedrpc.ping()stay strict and schema-faithful. Callers who actually want the typed data keep getting it; schema drift continues to surface there as a real error.
Per-language names:
| SDK | API |
|---|---|
| Rust | Client::is_alive(&self) -> bool |
| Node | client.isAlive(): Promise<boolean> |
| Python | client.is_alive() -> bool |
| Go | client.IsAlive(ctx context.Context) bool |
| .NET | client.IsAliveAsync(ct) : Task<bool> |
After this lands, the github/github-app workaround helper goes away and call sites become e.g. existing.is_alive().await.
Rejected alternatives
- Loosen
ping()itself. Considered and rejected.ping()is a typed schema-backed API; if it silently swallows malformed bodies, the contract becomes ambiguous (did the caller want liveness, or the ping data?). It also masks real CLI/schema drift in the API most likely to catch it. - Loosen the generated
rpc.ping(PingRequest). Same reasoning, more so — generated APIs must remain schema-faithful.is_aliveis the explicit escape hatch. - "Fix it only in the CLI." The CLI should still honor the schema, and we should investigate any drift. But liveness checks fundamentally straddle version boundaries, so the SDK needs a body-agnostic primitive regardless.
Acceptance criteria
- New
is_alive/IsAlive/isAlivemethod on the Rust, Node, Python, Go, and .NETClienttypes. - Method calls the
pingJSON-RPC method and returns success purely on RPC success, ignoring the response body. - Existing
ping()/rpc.ping()typed APIs unchanged. - Docs in each SDK clearly distinguish "use
is_alivefor liveness/warm-pool/resume checks" from "useping()when you want the typed response." - Tests cover the case where the CLI returns a
pingbody that fails strict deserialization but is otherwise a valid JSON-RPC success —is_alivereturnstrue,ping()returns an error. - Once shipped, the workaround in github/github-app#5461 is removed.
Design review
Reviewed and agreed with GPT-5.5; consensus on:
- Separate
is_aliveAPI (not looseningping). - Keep generated
rpc.pingstrict. - No baked-in timeout; caller composes timeouts.
- Name
is_aliveclearly communicates intent ("RPC round trip succeeded") and beatsping_raw/ping_check.
- Lenguaje dominante
- Java
- Estrellas
- 10.5k
- Forks
- 1.5k
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 130
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/copilot-sdk
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
github/copilot-sdk#2760 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
github/copilot-sdk#2759 ·
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/copilot-sdk#2709 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
github/copilot-sdk#2673 ·
Todos los issues de github/copilot-sdk
Issues similares
-
certification
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Abiertobug ecr
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Needs: Triage Type: Feature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
AntennaPod/AntennaPod#8794 ·
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100