* chore(deps): upgrade Pydantic AI to 2.77.0
* test(agent): cover updated provider error handling
* test(assistant): locate tool results alongside availability updates
* feat: keep older OpenAI and Anthropic models in the picker
* fix: use SDK retry causes in Kuma evals and clarify model discovery
* feat: preserve historical AI provider model suggestions
* feat(agent): let agents open web pages with any model
Co-authored-by: Mohammad Al Amin <alamin.baserow@gmail.com>
* fix(agent): open web pages through Baserow's HTTP stack and report failures
Failed fetches ended the whole reply, showed as invalid input, and files were stored whole.
Pages now go through the integration HTTP limits, only text is opened, and a reply opens at most five.
* fix(agent): leave scripts out of opened pages and bound their titles
Script and style text made up most of what the model got from many pages.
* fix(agent): refuse internal addresses when opening pages
The model picks the URL and a page can steer it, so the setting that lets integrations reach internal services shouldn't apply.
* fix(agent): read opened pages more safely
A crafted page could still end the reply, files sent as text were read, and pages without a charset came out garbled.
---------
Co-authored-by: Mohammad Al Amin <alamin.baserow@gmail.com>
A PostgreSQL data sync connects to a user-supplied server, which controls the
RowDescription type OID psycopg2 uses to cast each value. A malicious server can
report a scalar column in information_schema while announcing it as an array
(e.g. int8[]), then send an overlong array element. In psycopg2 < 2.9.13
typecast_LONGINTEGER_cast copies that element into a 24-byte stack buffer
without a length check, so get_all_rows() crashes the worker in fetchall()
(SIGSEGV/SIGTRAP) instead of raising an error.
Bump psycopg2-binary 2.9.11 -> 2.9.13, which bounds the copy (#1847) and also
fixes a malformed-interval infinite loop (2.9.12, #1835) and malformed bytea
parsing (2.9.13).
The version is pinned exactly in the lockfile and installed with
`uv sync --frozen`, so the vulnerable version cannot come back silently.
* Add markdown to HTML renderer for runtime formulas
* Add markdown_to_html formula function
* Add markdownToHtml renderer for runtime formulas
* Add markdown_to_html runtime formula to the frontend
* Add changelog
* Enable advanced mode for smtp service's body input
* feat(mcp): add django-oauth-toolkit metadata and scopes for MCP OAuth POC
Adds the OAuth provider settings, endpoint scope validator and discovery URLs behind BASEROW_MCP_OAUTH_ENABLED.
* feat(mcp): redirect OAuth authorize to Baserow consent and issue endpoint-bound codes
The consent API validates the authorization query, binds the code to an MCP endpoint, and returns the client redirect URL.
* fix(mcp): reject non-S256 and foreign-resource OAuth requests and read consent client from credentials
Shared validation backs both authorize and consent; the token audience is pinned to the MCP resource.
* test(mcp): cover CIMD host allowlist for MCP OAuth
* feat(mcp): serve Streamable HTTP /mcp with OAuth or endpoint-key bearer auth
MCP clients doing OAuth need a single resource URL; endpoint keys keep working as bearers.
* feat(mcp): revoke OAuth tokens when their MCP endpoint is deleted
Scope is matched as a whole word so endpoint:1 never hits endpoint:12.
* feat(mcp): add title and read-only/destructive annotations to MCP tools
MCP directories require a title and readOnlyHint/destructiveHint on every tool.
* feat(mcp): add consent page for MCP OAuth sign-in
* fix(mcp): only issue OAuth tokens through the consent flow
Open DCR let a client register for the password grant and request an endpoint scope,
skipping consent. DCR and the token endpoint now allow only authorization_code and
refresh_token, and only the consent view can add an endpoint scope.
* fix(mcp): strip trailing slash from the OAuth issuer and resource URL
A PUBLIC_BACKEND_URL ending in / produced a //mcp audience and a mismatched issuer.
* fix(mcp): add iss to OAuth deny and error redirects
The metadata advertises RFC 9207 support, so every redirect back to the client carries iss.
* fix(mcp): pass the authorize query to /mcp-authorize as base64url
The login redirect re-encoded the plain query, so the consent request failed after
signing in. /mcp-authorize also stays clear of the backend /mcp/* route.
* feat(mcp): limit an endpoint to its allowed tools
Null keeps every enabled tool, so existing endpoints and keys are unchanged.
tools/call now also refuses disabled tools, which match_by_name let through.
* feat(mcp): consent picks a workspace and tools
Users never see the endpoint row behind an OAuth connection; consent creates
or reuses it per client and workspace and stores the chosen tools.
* feat(mcp): pick a workspace and tools on the consent page
Replaces the MCP endpoint picker; the backend manages the endpoint row now.
* fix(mcp): reuse a consent grant only for the same OAuth client
Keying on the client name let manual endpoints and same-named clients share a grant.
* feat(mcp): drop dynamic client registration, keep CIMD only
Clients without CIMD use the endpoint key in the Authorization header.
* feat(mcp): redesign the consent page
Card with client avatar pair, verified badge, database counts and tool badges.
* feat(mcp): list and disconnect OAuth connections, refuse grant keys
Endpoints created by OAuth consent only accept their OAuth tokens, so their key
is refused on SSE and as a bearer, and they move from the endpoint list to a
connected apps API.
* feat(mcp): connect URL and connected apps in MCP server settings
Shows the one OAuth URL with per-client setup steps and lets users disconnect
apps they granted. Endpoint keys stay below under their own title.
* fix(mcp): hide OAuth grants from endpoint routes and left workspaces
The legacy endpoint routes no longer return grant rows or their key, and the
connections list skips grants in workspaces the user left, which can't be used
or disconnected.
* fix(mcp): load consent on the client so tool checkboxes render ticked
Server-rendered checkboxes lacked the checked class, which hydration kept while the state was ticked.
* fix(mcp): define django-oauth-toolkit swappable model settings
migrate resolves them when checking for model changes on an already migrated DB, which broke CI.
* fix(mcp): reset the SSE endpoint key when the key is unknown
The early 401 left current_key set, leaking it into later work in the same context.
* feat(mcp): give OAuth grants no key and one row per client and workspace
* fix(mcp): resolve the /mcp endpoint once and drop the /mcp/ route
* feat(mcp): hash OAuth tokens, expire refresh tokens and accept offline_access
Resource metadata lists only mcp; the CIMD host allowlist is now BASEROW_MCP_OAUTH_CIMD_ALLOWED_HOSTS.
* test(mcp): assert offline_access reaches the token and add refresh expiry control
* feat(mcp): rate-limit the OAuth token endpoint per client IP
* fix(mcp): validate consent once and only keep a grant when a code is issued
* fix(mcp): roll back the grant when the library answers consent with an error
oauthlib re-validates while issuing and returns non-fatal errors as a redirect, which committed the grant.
* fix(mcp): revoke OAuth grants when a user leaves the workspace
* fix(mcp): count only usable tools on connected apps
* fix(mcp): start reconnects from the existing grant's tools on the consent page
* fix(mcp): give the connections section its own BEM elements
* feat(mcp): send mcp_connected for Streamable HTTP clients
* fix(mcp): route /mcp, /oauth and OAuth metadata to the backend
* fix(mcp): route /mcp-authorize to frontend before /mcp to prevent 404
* feat(mcp): let MCP clients without CIMD register with DCR
Registration is anonymous, limited to public code-grant clients with https or loopback redirects, and unused clients are removed after a day.
* fix(mcp): reject DCR redirect URIs containing whitespace
DOT splits stored redirect URIs on whitespace, so one URI could smuggle in a second.
* docs(mcp): document OAuth sign-in for MCP clients
* test(mcp): load the URLconf before tests turn OAuth off
The OAuth routes are only mounted if the flag is on at URLconf import, so a test
that turned it off first left later tests in the worker with 404s.
* feat(mcp): periodically clear expired OAuth tokens
Rotation and reuse protection leave revoked refresh tokens, used codes and
expired access tokens behind. DCR registration tokens now expire so they're cleared too.
* style(mcp): drop dead and invalid rules in the OAuth SCSS
* fix(mcp): keep unnamed library metadata routes instead of crashing
* refactor(mcp): remove unused MCPEndpointHandler.get_by_key
* fix(mcp): only accept an OAuth token for its own client's grant
* fix(mcp): leave resource_metadata out of the 401 when OAuth is off
The metadata route isn't mounted then, so the hint pointed at a 404.
* fix(mcp): rate-limit the OAuth authorize redirect per client IP
Each anonymous authorize request can fetch and store a CIMD client.
* fix(mcp): delete CIMD clients that have no grant
Anonymous authorize requests store CIMD clients and nothing removed them.
* fix(mcp): say a CIMD host published the client, not that it verified it
With the default * allowlist the host is not vouched for.
* fix(mcp): name a DCR client without client_name by its redirect host
The consent title read "Connect " and the grant had an empty name.
* fix(mcp): route MCP and OAuth paths to the backend in the no-caddy nginx config
* fix(mcp): reject an access token that has no application
It crashed the /mcp request instead of returning invalid_token.
* fix(mcp): return the 404 JSON for RFC 7592 PUT and DELETE
Django's CSRF check answered them with a 403 page first.
* refactor(mcp): move the shared client avatar placeholder out of mcp_authorize
The connections list extended a placeholder defined in another component.
* fix(mcp): issue a refresh token only for offline_access
ADR 009 decision 6 ties refresh tokens to the offline_access scope.
* fix(mcp): stop the consent page from being framed
The consent page grants a client access, so it is a clickjacking target.
* fix(mcp): make the consent page tool toggles keyboard reachable
* docs(mcp): say the CIMD host allowlist only covers CIMD clients
* docs(mcp): route MCP and OAuth paths in the k8s and AWS examples
/mcp is only served by the ASGI app, so the examples sent it to a 404.
* fix(mcp): refuse to show the consent form inside a frame
Logging in inside a frame reaches the consent page by client-side navigation, which skips the frame headers.
* fix(mcp): always issue OAuth refresh tokens
Users stay signed in until they disconnect or the app goes unused for 30 days,
whether or not the client asks for offline_access.
* fix(mcp): keep the endpoint scope when a refresh narrows scopes
A refresh asking for scope=mcp issued a token without endpoint:<id>, which
failed on /mcp and escaped revocation on Disconnect.
* fix(mcp): keep OAuth clients that are still in use after a disconnect
Cleanup deleted a disconnected client the next day while the app kept using
its client_id. Clients now go after 30 days without a token, and an unknown
client on authorize tells the user to re-add the server.
* fix(mcp): serve the SSE route with a trailing slash
Turning off redirect_slashes made /mcp/<key>/sse/ a 404 instead of a redirect.
* fix(mcp): drop the error code from the 401 when no token was sent
RFC 6750 section 3.1 says no error code when the request has no credentials.
* fix(mcp): delete grantless CIMD clients a day after creation
Any anonymous authorize re-fetch bumps a CIMD client's updated, so it can't
mark use. CIMD clients are fetched again on demand anyway.
* fix(mcp): mark the OAuth client as used after saving its tokens
Matches the cleanup's lock order, tokens before the application row.
* style(mcp): rewrap the OAuth validator docstring
* fix(mcp): describe offline_access as it now behaves
Refresh tokens are issued whether or not it is requested.
* feat(mcp): audit log MCP OAuth connect and disconnect
ADR 009 decision 6: connecting and disconnecting are recorded in the audit log.
* test(mcp): give the OAuth action tests a unique module name
test_actions.py clashed with other test modules of the same name and broke collection in CI.
* fix(mcp): let users disconnect their OAuth grants without endpoint permissions
Listing grants and using them only needs membership, so disconnecting must not need the MCP endpoint operations either.
* fix(mcp): require the mcp scope on OAuth tokens used at /mcp
A refresh asking only for offline_access issued a token without mcp that /mcp still accepted. Refreshes now keep mcp, and /mcp rejects tokens without it.
* fix(mcp): ignore the redirect URI's own query when checking for an issued code
A client registered with a redirect URI like https://app.example/cb?error=0 never got a code.
* fix(mcp): send the OAuth connect PostHog event only after consent commits
The consent transaction rolls back when no code is issued, and the event was already sent by then. The audit log entry stays in the transaction.
* fix(mcp): keep OAuth grants out of the key endpoint lookup
Callers had to remember to pass a key-only queryset; grants have their own lookup.
* fix(mcp): show a CIMD client's host in a neutral badge
Any host can publish a client metadata document, so a green check made lookalike hosts look trusted.
* fix(mcp): show the readable reason when the consent request is rejected
* style(mcp): tidy an import and an outdated comment
* fix(mcp): name every client on the consent page by its client name
Matches Settings, which shows the client name with the host as a badge. A nameless CIMD client falls back to the host that published its metadata.
* fix(mcp): show fatal authorize errors on the styled consent page
The authorize endpoint answered unknown clients and bad redirect URIs with a bare text 400.
* test(mcp): add an e2e spec for the OAuth connect and disconnect flow
Enables BASEROW_MCP_OAUTH_ENABLED on the e2e and CI backends so the spec runs.
* fix(mcp): send only an error code to the consent error page
Free text in the URL could be injected and came back double-encoded after login. The page now maps codes to its own text and shows errors without sign in.
* fix(mcp): keep a CIMD client's host in the consent title
Any host can publish metadata under any name, so the title reads "Connect {name} from {host}". The neutral badge only repeated the host and is dropped.
* test(mcp): check the MCP status before parsing the body in the e2e spec
* test(mcp): await the login redirect in the consent middleware spec
The unawaited navigation ran the settings middleware after the request mock was restored, making a real request.
* fix(mcp): address final review findings on the OAuth flow
Authorize errors no longer redirect to client-registered URIs, CIMD redirect URIs follow the DCR rule, consent is rate-limited per user, and deleting a grant any way revokes its tokens.
* fix(mcp): accept ChatGPT, Claude and VS Code CIMD documents
django-oauth-toolkit 3.4.1 ignores token_endpoint_auth_methods_supported and refuses extra grant types; fixed upstream in #1856 and #1858 but not released.
* fix(mcp): update ChatGPT connect steps to the Plugins page
* feat(mcp): split MCP server settings into OAuth and Endpoint tabs
* fix(mcp): route /mcp without a trailing slash on K8s
The OAuth resource is /mcp, which the /mcp/ prefix missed.
* fix(mcp): give the CIMD document download one deadline
The library's timeout applies per read, so a slow-drip document held a worker.
* fix(mcp): bound anonymous client registrations
Caps the body at 16 KB and redirect URIs at 10; unsupported URIs are dropped instead of failing the registration.
* fix(mcp): rate-limit token revocation, count only failed token calls
Revocation loads the client, which can fetch and store a CIMD client.
* fix(mcp): preselect the granted workspace when reconnecting
It picked the first workspace with databases, so one Allow could move the app with every tool ticked.
* fix(mcp): carry the consent request in the path so SSO keeps it
SSO sign-in only keeps the return path. The frame headers move to the page so every spelling of the path gets them.
* fix(mcp): canonicalize the resource URL, scrub OAuth fields from Sentry
SDK clients send the resource normalized; the Sentry denylist only matches exact keys.
* fix(mcp): lock the membership while granting an OAuth client
A member removed during consent could otherwise keep the new grant.
* chore(mcp): count databases through the registry, add missing translations
* test(mcp): check the OAuth routes follow the flag
* test(e2e): skip the MCP OAuth test only when the route is missing
Any other status hid a broken metadata endpoint.
* fix(mcp): explain rejected CIMD clients and load failures on the consent page
Both showed the invalid request message, which suggested re-adding the server.
* fix(mcp): answer a refresh that lost a race with invalid_grant
With hashed storage the library returned a blank token and the token view raised a 500.
* feat(mcp): mark connected apps whose sign-in has ended
Grants stay listed after their refresh token expires, but the app has to sign in again.
* docs(mcp): add a self-hosting note for MCP OAuth sign-in
Covers the public URL, routing, outbound HTTPS for CIMD, the client IP the limits use and what turning the flag off does.
* fix(mcp): sign OAuth apps out on password change or reset
Browser sessions already end then; grants stay so apps show as signed out.
* feat(mcp): tick only the read tools on a first connection
Changing data becomes opt-in; reconnecting still starts from the existing grant.
* fix(helm): keep the MCP consent page on the frontend on a shared domain
Caddy ingress turns Prefix /mcp into /mcp*, which also caught /mcp-authorize.
* chore(deps): bump drf-spectacular from 0.29.0 to 0.30.0 in /backend
Bumps [drf-spectacular](https://github.com/tfranzel/drf-spectacular) from 0.29.0 to 0.30.0.
- [Release notes](https://github.com/tfranzel/drf-spectacular/releases)
- [Changelog](https://github.com/tfranzel/drf-spectacular/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/tfranzel/drf-spectacular/compare/0.29.0...0.30.0)
---
updated-dependencies:
- dependency-name: drf-spectacular
dependency-version: 0.30.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* fix(api): keep pagination next/previous nullable in the OpenAPI schema
drf-spectacular 0.30 documents allow_blank URL fields as a oneOf of the URL and an empty string, and OpenAPI 3.0 ignores nullable next to oneOf, so the null returned on every last page no longer validated. The example pagination serializer is only used for the docs and next/previous are never blank, so drop allow_blank.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Davide Silvestri <silvestri.eng@gmail.com>
Upstream pysaml2 7.5.5 ships IdentityPython/pysaml2#1021, the fix we
cherry-picked into baserow/pysaml2 in #5663 to unblock the
CVE-2026-26007 cryptography upgrade. Install it from PyPI again.
The only code difference from the fork is a refactor of
OpenSSLWrapper.verify in saml2/cert.py, reached only through
verify_ssl_cert or generate_cert_info, which Baserow never sets.
git is removed from the Dockerfile builder-prod-base and dev stages: it
was only needed for uv to fetch the git-sourced fork.
* chore(deps): upgrade pydantic-ai to 2.50.0
- Bump pydantic-ai-slim 2.28.0 -> 2.50.0 and
openinference-instrumentation-pydantic-ai 0.1.20 -> 0.1.27; the lock
also moves anthropic to 1.8.0, openai to 3.19.2, google-genai to 2.25.0.
- Unwrap SourcedInstruction entries in the eval prompt override.
- Show the error message, not the model response dump, for
UnexpectedModelBehavior errors.
- Disable the pydantic-ai first-run Logfire banner.
- Stop in-flight tools when an eval case times out.
* fix: address AI dependency upgrade feedback
* chore(deps-dev): bump pytest from 9.0.3 to 9.1.1 in /backend
Bumps [pytest](https://github.com/pytest-dev/pytest) from 9.0.3 to 9.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/9.0.3...9.1.1)
---
updated-dependencies:
- dependency-name: pytest
dependency-version: 9.1.1
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* test: drop trailing comma from single-name parametrize argnames
pytest 9.1 fixed `parametrize` not unpacking values when argnames is a
string with a trailing comma, so `"value,"` now means `("value",)` and
pytest tries to unpack each value into one name. These four files carried
the comma by accident, which broke collection.
The two multi-name cases (`"table_row_id,db_row_id,"`) already pass
tuples and behave the same either way, so they are left alone.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Davide Silvestri <silvestri.eng@gmail.com>
* feat: add Phoenix LLM tracing service to the dev stack (ai profile)
* chore(deps): add openinference pydantic-ai instrumentation (dev)
* feat: export assistant traces to Phoenix when BASEROW_ASSISTANT_PHOENIX_URL is set
* fix: harden Phoenix tracing setup after review
* feat: Phoenix postgres storage, ai-evals profile and auth support
* docs: ADR 007 and assistant tracing/evals guides
* feat: assistant eval platform core (types, registries, scenarios)
* feat: eval harness with shared assistant factory
* feat: phoenix dataset sync for assistant evals
* feat: assistant eval experiments via phoenix client + CLI
* feat: migrate core, database and docs evals to the platform
Ports the 42 kuma-core/kuma-database/kuma-docs pytest evals into
declarative EvalCase/EvalScenario registrations, plus structure-level
tests asserting dataset counts, ids, and scenario wiring.
* feat: migrate builder and automation evals to the platform
Ports the 12 builder + 2 proactive + 2 user-source cases into
evals/datasets/builder.py (kuma-builder, 16 cases) and the 7 automation
cases into evals/datasets/automation.py (kuma-automation), following the
Task 5 pattern established in core.py/database.py. Extends
eval_platform/test_datasets.py with counts, id lists, a mode-per-case
assertion, and pre_state snapshot checks for the two cases that need one.
* fix: link traces and final counts for single-case eval runs
* fix: root spans for single-case eval runs use the assistant tracer provider
* feat: assistant eval runner service with run page
Adds the assistant_eval_runner management command (migrate -> instrumentation
-> dataset sync -> single worker thread -> wsgiref server) and its
runner.py module: a stdlib WSGI app serving a plain server-rendered page
(GET /, POST /run, GET /healthz) backed by a bounded in-memory run history
and one background worker draining a queue.Queue via run.run_experiment_for.
Wires the assistant-eval-runner compose service (ai-evals profile, own
baserow_evals DB), renames phoenix-db-init to ai-evals-db-init and extends
it to also create baserow_evals, and adds BASEROW_EVAL_RUNNER_PORT to both
env example files and the dev docs.
* fix: eval runner integration fixes
assistant-eval-runner needs its own SECRET_KEY/DATABASE_*/REDIS_* env vars:
dev-overlay compose services don't inherit docker-compose.yml's
x-backend-variables anchor (that's file-scoped YAML), so the container was
starting without a Django SECRET_KEY and without a Redis password, crashing
on auth. Also links to finished experiments pointed at the container-internal
BASEROW_ASSISTANT_PHOENIX_URL (http://phoenix:6006), unreachable from the
developer's browser.
Adds BASEROW_ASSISTANT_PHOENIX_PUBLIC_URL (defaulting to
http://localhost:${BASEROW_PHOENIX_PORT:-6060}) and has runner.py build the
Phoenix link from it, deep-linking straight to the finished run's experiment
compare view when its dataset_id/experiment_id are known, falling back to
the datasets list otherwise.
* refactor: retire the pytest eval harness
All 65 eval cases now live in baserow_enterprise.assistant.evals.datasets;
delete the legacy pytest-based suite and its `eval` markers.
* docs: rewrite assistant evals guide for the Phoenix platform
* feat: docs judge, prompt sync, git stamping and UI-contributed eval examples
- answer_quality LLM-as-judge evaluator for kuma-docs (BASEROW_EVAL_JUDGE_MODEL)
- Kuma prompts versioned into Phoenix on sync; experiments stamped with
prompt hashes, git branch/commit and judge model
- sync preserves UI-added dataset examples with prompt-match adoption;
eval-export emits paste-ready docs.py snippets
- final-review fixes: skip-safe scoring, runner CSRF/bind hardening,
doc corrections
* feat: eval runner UI round — tabs, fan-out, reference answers, 64-case docs dataset
- Runner page: dataset tabs with selection badges, per-dataset and global
all/none, cross-dataset fan-out (one experiment per dataset), 5s
auto-refresh of runs, persistent run history across restarts, per-dataset
Phoenix links, in-page Help tab rendering the repo docs via /docs.json.
- Reference answers for kuma-docs: EvalCase.reference_answer, judge grades
against it, sync preserves UI-curated ones, eval-export round-trips them.
- kuma-docs grown to 64 cases: reference answers for all, PostHog-mined
frequent questions, and cannot-do guardrail cases.
- Gemini (google:gemini-3.6-flash) in the eval model list.
* feat: runnable UI examples, prompt overrides, eval baseline and results view
- UI-added Phoenix examples now execute: docs questions get the standard
docs checks + judge; tool cases declare scenario/expected_tools/
answer_contains in metadata (empty-workspace default scenario). They are
tickable per dataset on the runner page and run in whole-dataset
experiments too.
- Prompt overrides: run any experiment with a prompt's latest Phoenix
version instead of the code constant (runner checkbox panel with soft
per-tab ordering, or --override-prompt). Agent singletons keep their
dynamic instructions; effective hashes + override list stamped on the
experiment.
- Committed baseline snapshot (evals/baseline.json, 111 cases) with
just b eval-baseline capture/import; the runner imports it on startup so
every Phoenix instance gets a baseline experiment per dataset,
idempotent by content hash and run count.
- Results tab: all datasets in one view for a named experiment, with
baseline deltas and a case-weighted overall row, via Phoenix experiment
annotation summaries.
- New evaluation guide (docs/testing/ai-assistant-eval-analysis.md) served
in the Help tab; layout uses horizontal space better (single tab row,
fluid case columns).
* feat: time and cost in eval results, frozen into the baseline snapshot
- Results tab gains time (sum of run latencies) and cost/token columns per
dataset and summed overall, with lower-is-better baseline deltas.
- eval-baseline capture freezes each dataset's time/cost/token totals into
baseline.json; import stamps them as metadata so imported baselines
(which carry no traces to price) still show time and cost.
- Importing a new baseline supersedes the previously imported one instead
of accumulating duplicates.
- Changelog entry for the eval platform.
* fix: OpenInference attributes on subset-run task root spans
Bare wrapper spans rendered as kind 'unknown' with Unset status and empty
input/output in Phoenix. The Task root span now carries the CHAIN kind, the
case prompt as input, the run result as JSON output, and an explicit OK
status.
* polish; minor fixes
* fix: address eval platform review feedback
Apply production model settings and retries, isolate automation checks, and fix runner configuration, links, and result status.
Defer GPT-5.6 compatibility and baseline comparisons to #6034.
* fix: preserve model profiles in rebased eval harness
Use an explicit model profile for evals and share concrete models with tools. Manage model clients through the existing lifecycle helper and preserve regression coverage from the retired harness.
* fix: harden eval persistence and Phoenix access
* chore(deps): upgrade pydantic-ai to V2 (2.28.0)
Upgrades pydantic-ai-slim from 1.102.0 to 2.28.0. No user-visible behaviour
change: where V2 moved a default, the V1 behaviour is pinned rather than
silently adopted.
Production changes are five files:
assistant/assistant.py async for -> async with ... as events:
(run_stream_events is a context manager)
assistant/retrying_model.py public RunContext; state/metadata/
close_stream proxy delegation; Vertex AI
via GoogleCloudProvider
core/generative_ai/registries.py output_retries=3 -> retries={"output": 3}
assistant/model_profiles.py normalise google-gla/google-vertex prefixes
assistant/tools/database/agents.py pin end_strategy="early"
The rest of the diff is test hardening, and it is the point of the change.
The assistant suite mocked pydantic-ai's streaming path instead of running it,
which hid four real breaks — one of them user-facing:
- Agent(output_retries=3) raises TypeError on V2, breaking the premium
generate_ai_formula endpoint. Invisible because the test patches prompt()
wholesale and the shared fixture refuses structured output.
- run_stream_events became a context manager; the bare async generator mock
kept working regardless.
- end_strategy flipped early -> graceful, letting a previously-skipped tool
call execute and hard-fail formula generation.
- GoogleProvider(vertexai=True) was removed entirely.
The doubles now wrap real pydantic-ai types, one test drives the genuine
streaming path, one proves cancellation unwinds through the context manager,
and test_pydantic_ai_contract.py pins the API surface (public and private) so
the next upgrade fails at import rather than mid-run in production.
Verified: assistant + core/generative_ai 343 passed, 66 skipped; full backend
suite 11962 passed, 360 skipped, 1 failed. That failure
(test_view_empty_count_aggregation_for_interesting_table, BaserowFormulaButtonType
missing empty_query) is pre-existing and unrelated — the identical failure occurs
at base commit 321c00adc, and this branch changes nothing under
backend/src/baserow/contrib/ or premium/.
Note for future upgrades: _ErrorRecoveringStream in retrying_model.py
re-exposes each StreamedResponse class attribute as a delegating property,
because class attributes shadow __getattr__. V2 added state and metadata. That
list must be revisited on every pydantic-ai upgrade — the failure mode is a
wrong value, not an error.
* fix: give Google models a usable HTTP deadline
A bare httpx.AsyncClient defaults to a 5s timeout, and GoogleProvider
forwards that to the Gemini API as an explicit deadline, which the API
rejects because its minimum is 10s. Every Google model was therefore
unusable. Build the client with pydantic-ai's own
create_async_http_client factory instead (600s read, 5s connect).
Also document GOOGLE_API_KEY alongside the other assistant provider
keys, pass it through docker-compose, and bridge it in the eval
conftest so evals can target Gemini.
* fix: resolve GOOGLE_API_KEY explicitly for Google providers
_PROVIDER_ENV had no google entry, so _resolve_credentials fell through
to the deprecated UDSPY_LM_API_KEY and handed whatever it held (e.g. a
Groq key) to Google. It only worked because pydantic-ai reads
GOOGLE_API_KEY itself when no key is passed. Map all four google
prefixes explicitly, matching the other providers' precedence.
Also raise the title-generation timeout from 10s to 15s: 10s is exactly
Gemini's minimum allowed deadline, leaving no margin.
* chore(deps): switch pysaml2 to baserow fork to fix cryptography and pyopenssl CVEs
The baserow/pysaml2 fork is v7.5.4 with IdentityPython/pysaml2#1021
cherry-picked, lifting the pyopenssl<24.3.0 cap that blocked the
cryptography upgrade. Pinned to the immutable merge commit
(tagged v7.5.4+deps-upgrade) via tool.uv.sources.
Upgrades cryptography 43.0.3 -> 49.0.0 and pyopenssl 24.2.1 -> 26.3.0,
resolving 3 high and 3 low Dependabot alerts including CVE-2026-26007.
git is added to the Dockerfile builder-prod-base and dev stages because
uv requires the git CLI to fetch git-sourced dependencies.
* chore(deps): upgrade twisted, django, daphne, pydantic-ai and pydantic-settings to fix remaining CVEs
- twisted 25.5.0 -> 26.4.0: DNS compression pointer DoS (high)
- pydantic-ai-slim 1.77.0 -> 1.102.0: two SSRF blocklist bypasses (medium);
requires boto3 >= 1.42.63
- pydantic-settings 2.12.0 -> 2.14.2: secrets_dir symlink traversal (medium)
- django 5.2.14 -> 5.2.15 and daphne 4.2.1 -> 4.2.2 security patches
pydantic-ai 1.102 turned StreamedResponse._parts_manager into a
cached_property and added _finished/_cancelled class-default fields.
These shadow __getattr__ on the assistant's _ErrorRecoveringStream
proxy, so get() would build the response from an empty proxy-local
parts manager. The shadowed attributes are now property-delegated to
the inner stream, with a regression test asserting get() sees the
streamed parts.
* chore: add changelog entry for security dependency upgrades