Repository navigation
NickAkhmetov/Update Say & See to udi-yac 0.9.0, fix chart field changes - #4111
Conversation
|
set to draft pending merge of hms-dbmi/udi-yac#230 and updated release; revisions in that stack fix some of the code duplication/dependency on private functions that is currently necessary when integrating into a monolith. |
A host that serves the chat from its own backend had to copy the reference server's vis_instantiate handler, importing two private helpers from udiagent.vis_generate, because the logic lived inside the FastAPI route and importing udiagent.server.app starts a whole server. The HuBMAP portal's Flask app did exactly that (hubmapconsortium/portal-ui#4111), and its copy had already drifted: a malformed body got 400 there and 422 here. udiagent.api now holds the endpoint's logic. vis_instantiate takes the parsed JSON body and returns the response body. A failure raises EndpointError, which carries the status and the {code, error, errors} body the chat reads. The FastAPI route is now a single call to it, so a host and the reference server give the same answers. The private helpers stay private: the public API is the endpoint, not its parts. The request and response models move from udiagent.server.models to udiagent.models, so a host can validate with them without the [server] extra. They need only pydantic, now declared directly (openai already installs it). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Looks like the only real lockfile change is udi-yac 0.5.0 → 0.9.0. The removed libc: lines make me think it was regenerated with a different pnpm than the pinned pnpm@10.27.0. Could you regenerate it via corepack so the next install doesn't add them back?
There was a problem hiding this comment.
Turns out the pinned pnpm 10.27.0 is what drops those lines. The libc: entries came in with dependabot's vite bump (#4105), which runs a newer pnpm, and 10.27.0 removes them on any re-resolve. I rebuilt the lock as main's plus only the udi-yac change (now 0.5.0 → 0.10.0), so the libc lines are back. It passes --frozen-lockfile with 10.27.0 and pnpm install --lockfile-only leaves it unchanged. This will recur between dependabot and 10.27.0 until we bump packageManager; I'll do that separately.
…r user The /v1/yac/vis_instantiate route now calls udiagent's public vis_instantiate API (udi-yac#228) instead of porting its private helpers and handler, so the portal and the reference server can't drift. A malformed body now returns 422 with per-field errors, as upstream does; 5xx errors are still logged with their traceback. Saved Say & See sessions are stored per signed-in user, so people sharing a browser don't see each other's consortium sessions. pnpm-lock.yaml is main's lock plus only the udi-yac change, keeping the libc entries that pnpm 10.27.0 would otherwise drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Upgrades the Say & See chat from
udi-yac0.5.0 to 0.9.0 and the agent fromudiagent0.6.0 to 0.9.0. It also updates the Flask integration inroutes_udi.pyto support what the new client sends and calls.Backend
udi-yac0.9 sends its active filters (chat, chart brush and host) with every/v1/yac/completionsrequest.Orchestrator.run()now takes them as context, so the agent can answer "which filters are on?" and build on them. Flask previously dropped the field. udiagent ignores malformed entries and treats a missing field as "no active filters", so older clients keep working.POST /v1/yac/vis_instantiateto rebuild a template-generated chart with a different field. Flask has had no such route since 0.5.0, so every field change failed. The new route is a port of udiagent's reference server handler. It makes no LLM call and needs no OpenAI key. Its errors use udiagent's{code, error, errors}shape, because the chat readscodeand removes a chart's tweak controls onunknown_template.udiagent.vis_generate, so a future udiagent refactor could break it. A test exercises the real helpers to catch that. The alternative was installingudiagent[server], which pulls in FastAPI.Frontend
/browse/<type>/<uuid>). Aggregated rows have nouuidand get no link. The panel description said results "do not link to individual … pages", so it has been updated.localStorage. The public and consortium data packages use separate stores.Not adopted:
udi-yac0.9's issue reporting (issueReportingprop andPOST /v1/yac/issue_report). It stays off.Dependencies:
udiagent0.9 requiresopenai>=3.33, so the lock movesopenaifrom 2.32.0 to 3.39.0. Only udiagent uses it.Design Documentation/Original Tickets
N/A
Testing
Tests added in
context/app/test_routes_udi.py:vis_instantiateround trip against udiagent's bar-chart template;bad_request, 404unknown_template, 400bad_schema, 422missing_bindingsand 422invalid_bindings.A test in
SaySeePanel.spec.tsxcovers the record links, including the aggregated-row case.uv run pytest context/apppnpm testpnpm tscpnpm lintuv run ruff check context/ruff format --checkManual, against a local Flask server:
vis_instantiatewith the real HuBMAPdatapackage.json: returns 200 with CORS headers, and 422invalid_bindingsfor an unknown field.udi-yac0.9.0 with the portal's styling intact.Not yet tested by hand, because they need an OpenAI key and an LLM round trip:
Screenshots/Video
To be added.
Checklist
CHANGELOG-udi-yac-0.9.mdis present in the root directory, describing the change(s) in full sentences.Additional Notes
udi-yacemits its own events, and they reach Matomo/GA through the existingonEventmapping, so no new analytics code was needed. Field changes emitvisualization_tweakedorvisualization_tweak_failed. Loading a saved session emitssession_importedwithsource: "browser".udi-yacemits no event when a session is saved.🤖 Generated with Claude Code