Repository navigation
fix(py): write Dev UI runtime files at the project root and bring reflection v1/v2 to parity - #53
Merged
Merged
Conversation
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 9, 2026 19:08
5d5d513 to
6272f6f
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 9, 2026 19:58
6272f6f to
8a1c997
Compare
huangjeff5
changed the base branch from
main
to
fix/py-1.0-pr6-middleware-sandbox
November 9, 2026 19:58
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 9, 2026 20:02
c23d2da to
6843c66
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 9, 2026 20:02
8a1c997 to
4cc0b5b
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 9, 2026 20:21
6843c66 to
3eccbe6
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 9, 2026 20:21
4cc0b5b to
5d97da9
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 9, 2026 21:23
3eccbe6 to
597b801
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 9, 2026 21:23
5d97da9 to
0969d89
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 9, 2026 21:28
597b801 to
ef6c441
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 9, 2026 21:28
0969d89 to
e323e58
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 9, 2026 21:53
ef6c441 to
2b13e02
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
2 times, most recently
from
November 9, 2026 22:03
306937a to
929a635
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
2 times, most recently
from
November 9, 2026 23:19
3c47f6b to
a211f0f
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 9, 2026 23:34
7d48dd9 to
5d35f82
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 10, 2026 07:44
a211f0f to
048d352
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 10, 2026 07:44
5d35f82 to
0db5e13
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 10, 2026 18:37
048d352 to
e7b93f7
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 10, 2026 18:37
0db5e13 to
8d08a6e
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 11, 2026 06:22
65ba206 to
aba2bcd
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 11, 2026 06:22
6da52b6 to
b158d03
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 11, 2026 16:21
aba2bcd to
d7b803f
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 11, 2026 16:21
b158d03 to
4415b04
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-middleware-sandbox
branch
from
November 11, 2026 17:31
d7b803f to
a3d8c7b
Compare
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 11, 2026 17:31
4415b04 to
d4713c2
Compare
huangjeff5
changed the base branch from
fix/py-1.0-pr6-middleware-sandbox
to
fix/py-1.0-pr5-web-serving
November 11, 2026 18:06
RuntimeManager wrote .genkit/runtimes to cwd while the CLI reads it from findProjectRoot(). From a subdirectory the Dev UI showed 0 actions. Walk ancestors with the CLI's marker list; fall back to cwd.
- /api/runAction awaits flush_instrumentations() before answering, as v2 and JS do, so the root span is exported when the response lands. - Error details.stack carries the Python traceback when empty, so genkit flow:run prints Python frames (matches v2). - /api/notify also enables log export and warns on spec-version mismatch; /api/__health?id= answers 503 for another runtime; a missing runAction key is 400, not a KeyError 500.
websockets defaults max_size to 1 MiB; a runAction with one screenshot closed the socket with 1009. Match the CLI's 100 MiB. register now sends pid and reflectionApiSpecVersion as integers.
structlog's default factory printed to stdout, breaking `python cli.py | jq .`. Default to stderr unless the app set a factory. define_value / define_schema now overwrite on re-registration, like flows, tools, and prompts, so re-running a Jupyter cell works.
…untime dirs - ai.run_main() under Jupyter/IPython raises a RuntimeError that points to `await main()` and closes the coroutine (no unawaited warning). - The reflection port-range error was unreachable; instance #101 got a bare EADDRINUSE. Name the cause and the fix. - RuntimeManager removes .genkit/runtimes and .genkit when it leaves them empty.
genkit start creates and watches .genkit/runtimes before it spawns the app. Removing that directory on exit and recreating it on the next start leaves the CLI's chokidar 4 watcher blind to the new runtime file, so a restarted app never shows up in the Dev UI. Track which directory levels RuntimeManager created and remove only those.
huangjeff5
force-pushed
the
fix/py-1.0-pr6-devui-middleware-mcp
branch
from
November 11, 2026 18:38
d4713c2 to
2f69a27
Compare
apascal07
reviewed
Nov 11, 2026
apascal07
approved these changes
Nov 11, 2026
- Keep duplicate checks on Registry.register_value by default and opt in from define_value only, so duplicate middleware or format names still raise ValueError. - Flush flush_developer_ui_collector instead of flush_instrumentations in reflection v1 outside the action try/except, isolating remote OTel exporters and preventing collector errors from failing completed runs. - Route Genkit's unconfigured console logs to dynamic sys.stderr on ExportTee without mutating structlog's global logger_factory.
Merged
3 of 4 tasks
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.
Four things broke the local dev loop. An app started with
genkit startfrom a subdirectory never showed up in the Dev UI. Large payloads such as screenshots dropped the reflection v2 connection. Re-running a notebook cell failed on duplicate value/schema registration and onrun_main()inside Jupyter. Default logs went tostdout, which corrupted output piped from the CLI.Changes
RuntimeManagerwrote tocwd/.genkit/runtimes, so an app launched from a subdirectory was invisible to the CLI. It now walks up to the nearest project marker (pyproject.toml,package.json,go.mod,requirements.txt, and others), the same way the CLI does. On exit it removes only directories this process created, and only if empty, sogenkit startkeeps watching the directory across restarts./api/runAction, so the trace is complete when the Dev UI fetches it, puts the Python traceback inerror.details.stack, returns503on/api/__health?id=for a stale runtime file, enables log export and CLI version warnings on/api/notify, and returns400whenkeyis missing instead of a 500. v2 raises the WebSocket message cap from 1 MiB to 100 MiB and sendspidandreflectionApiSpecVersionas integers.define_valueanddefine_schemaraisedValueErrorwhen a cell ran twice. Re-registering now replaces the entry, like@ai.flowand@ai.toolalready do.stderr: When the app hasn't configuredstructlog, Genkit's logs now go tosys.stderr, so pipedstdoutstays clean. An app that configuresstructlogitself keeps its own setup.run_main()and port exhaustion:run_main()inside a running loop closes the coroutine and points toawait main(). Running out of reflection ports (each dev-modeGenkit()holds one) says so and suggests reusing one instance, instead of a bareno available porterror.Breaking changes
None.
Cross-SDK
Reflection responses now match what the Genkit CLI already expects. The CLI, JS, Go, and Dart owners need no changes.