Skip to content

feat(coglet): restore GET / root discovery endpoint#2846

Merged
michaeldwan merged 1 commit intomainfrom
md/restore-root-discovery-endpoint
Mar 17, 2026
Merged

feat(coglet): restore GET / root discovery endpoint#2846
michaeldwan merged 1 commit intomainfrom
md/restore-root-discovery-endpoint

Conversation

@michaeldwan
Copy link
Copy Markdown
Member

Summary

  • Restores the GET / root discovery endpoint that existed in cog <= 0.16.x and was dropped when the Python HTTP server was replaced by coglet in v0.17.0
  • Returns a JSON document listing all available API endpoints for service discovery
  • Training URLs (/trainings, /trainings/{training_id}, /trainings/{training_id}/cancel) are conditionally included only when the model's OpenAPI schema contains a TrainingInput component
  • cog_version reports the Python SDK version when available, falling back to the coglet runtime version

Example response

{
  "cog_version": "0.14.0",
  "docs_url": "/docs",
  "openapi_url": "/openapi.json",
  "shutdown_url": "/shutdown",
  "healthcheck_url": "/health-check",
  "predictions_url": "/predictions",
  "predictions_idempotent_url": "/predictions/{prediction_id}",
  "predictions_cancel_url": "/predictions/{prediction_id}/cancel",
  "trainings_url": "/trainings",
  "trainings_idempotent_url": "/trainings/{training_id}",
  "trainings_cancel_url": "/trainings/{training_id}/cancel"
}

Testing

  • 3 new unit tests covering base discovery fields, conditional training URLs, and cog_version preference logic
  • All 168 Rust tests pass, clippy clean, fmt clean

@michaeldwan michaeldwan marked this pull request as ready for review March 17, 2026 18:17
@michaeldwan michaeldwan requested a review from a team as a code owner March 17, 2026 18:17
@michaeldwan michaeldwan added this to the 0.17.0 Release milestone Mar 17, 2026
@michaeldwan michaeldwan merged commit da6f756 into main Mar 17, 2026
34 checks passed
@michaeldwan michaeldwan deleted the md/restore-root-discovery-endpoint branch March 17, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants