Repository navigation
fix(runtime): a service without src/openapi.py starts without one - #112
Merged
Merged
Conversation
Init ran `uv run python src/openapi.py` whenever src/main.py changed, so a
service whose API is on its gRPC and Connect faces alone, and which ships no
OpenAPI generator, failed Init on a fresh checkout ("cannot generate Open API
document"). The model gateway deleted the generator with its REST API.
Init now runs the generator only when the project ships it: the scaffold
does, and its document describes the app's REST routes. Without it the HTTP
endpoint publishes no OpenAPI document, and nothing is run.
TestInitWithoutAnOpenAPIGeneratorRunsNone (gRPC + Connect service, no
generator: Init READY, only `uv sync` runs) fails on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a defect found in a live run. A python-fastapi service that ships no
src/openapi.pycould not start from a fresh checkout. Init failed with "cannot generate Open API document" because it ranuv run python src/openapi.pywheneversrc/main.pychanged.The model gateway hits this. It deleted its generator with its REST API (module-model-gateway 4d07bb7), under the decision that each module exposes one Connect face. Its HTTP endpoint (
api: rest) now serves only the probes.Fix
Init now runs the OpenAPI generator only when the project ships
src/openapi.py.src/main.pycache that skips regeneration when nothing changed.Classification: fix, in the agent that owns the startup step.
Why the condition is the generator's presence, not the REST endpoint: the agent requires an HTTP (
api: rest) endpoint on every service, because it maps uvicorn's port and the probes from it. The model gateway still declares one. What is optional is the OpenAPI contract on that endpoint, and the generator is how a project declares it has one.Why the OpenAPI path is not deleted: REST is not gone. New scaffolds are REST FastAPI services that ship the generator.
Test
TestInitWithoutAnOpenAPIGeneratorRunsNone: a service with gRPC and the Connect face enabled, a probes-only HTTP endpoint and no generator. Init reaches READY and runs onlyuv sync. The test fails on main.The existing Init test now gives its probe project a generator, so it still checks that a REST service runs it.
Checks
go build,go vet,go mod tidy -diffandgo test ./...pass locally.codefly runof the model gateway with this agent. That needs the gateway's full composition (authority, hop, installation values).🤖 Generated with Claude Code