dashboard v2#3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 960061f6ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| # Create a dummy graph to host the dashboard if none is provided | ||
| # It will still serve the /ui/sessions etc. from the global memory store | ||
| dummy_graph = Graph(checkpoint_db="flowk_memory.db") |
There was a problem hiding this comment.
Let
flowk ui open the user's checkpoint database
flowk ui now always boots a dummy Graph(checkpoint_db="flowk_memory.db"), so any runs saved under another SQLite filename or a Redis URL are invisible to the dashboard. In practice this makes the new CLI observability flow work only for the hard-coded file instead of the database the user actually ran their graph against.
Useful? React with 👍 / 👎.
| if os.path.exists(ui_dist): | ||
| app.mount("/assets", StaticFiles(directory=os.path.join(ui_dist, "assets")), name="assets") |
There was a problem hiding this comment.
Ship a built frontend bundle before serving the v2 dashboard
create_app() only mounts the UI when flowk/ui/v2/dist exists, but this change only adds the Vite sources and .gitignore explicitly excludes dist. In a source checkout or sdist install, flowk ui will still start Uvicorn but there is no / page or static asset bundle to serve, so users get an API-only server instead of the advertised dashboard.
Useful? React with 👍 / 👎.
| // Picking the latest run for this session | ||
| const runId = runs[runs.length - 1]; |
There was a problem hiding this comment.
Stop treating the last run id as the newest run
selectSession() assumes runs[runs.length - 1] is the latest execution, but /ui/session/{id}/runs is backed by StorageRegistry.list_runs(), which returns Redis set members and SQLite rows without any ordering guarantee. For sessions with multiple runs, the dashboard can silently open an older trace and state diff while presenting it as the most recent run.
Useful? React with 👍 / 👎.
| for val, tgt in mapping.items(): | ||
| edges.append({"source": src, "target": tgt, "type": "route", "label": str(val)}) | ||
|
|
||
| StorageRegistry.save_graph("default", {"nodes": nodes, "edges": edges}) |
There was a problem hiding this comment.
Persist graph topology under a non-global key
Each compile() now overwrites the graph snapshot under the constant id default, and /ui/graph always reads that same record back. If one checkpoint database contains multiple graphs or successive versions of a graph, the dashboard will render whichever topology compiled last rather than the topology that produced the selected historical run.
Useful? React with 👍 / 👎.
No description provided.