* chore: add changelog entry for the MCP shared tools
The tools PRs left it for when the milestone was done.
* feat(mcp): always turn on OAuth sign-in
BASEROW_MCP_OAUTH_ENABLED is removed before it ships, so OAuth sign-in is
on everywhere. The settings page opens the endpoint tab when the OAuth
connections fail to load.
* feat: add a shared base for integrations that connect an account through OAuth
* fix: keep OAuth account scopes current and bound provider answers
* fix: share parent registration between form APIs
* fix: preserve refreshed OAuth tokens when actions fail
* refactor: use absolute imports for parent OAuth modules
* refactor: decouple OAuth cleanup from application publication models
* refactor: use common import hooks for OAuth connections
* fix: keep OAuth account integrations out of the workspace
---------
Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
* fix(agent): small Agent Builder fixes from the launch review
Imported actions ask first, SECRET_KEY_FALLBACKS is read, signed links keep their query,
Gemini retries transient errors, approval cards stop saying 'by you', and agent-builder turns identities on.
* test(assistant): turn identities off by having no flags
The agent-builder flag now turns identities on as well.
* fix(agent): address review of the launch quick fixes
Key fallbacks are JSON arrays, Gemini retries once per Kuma call, and an
imported action must carry the service its type runs.
* fix(agent): keep HTTP action requests on the builder's host
The host was checked with urlsplit while Requests sends elsewhere, so model input could send the builder's key to another host.
Model-picked hosts now refuse private addresses, and ALLOW_PRIVATE_ADDRESS=false no longer turns that protection off.
* chore: drop changelog entry
* chore: add breaking change entry for boolean env parsing
* fix(agent): read a single-input URL with the formula parser
Bracketed or uppercase spellings of one input were treated as mixed URLs and hidden from the model.
Docs now match the boolean parsing and the transport limits on model-picked hosts.
* feat(assistant): stream Kuma background replies over HTTP
Behind assistant_background_runs, commit and enqueue the message then follow
Redis on the existing POST/200 cumulative JSON response. Resume the same run
without sending the prompt again. Keep refresh, multi-tab discovery, onboarding
and durable outcome recovery in the Kuma adapter and UI integration.
Part of #6346
* Remove unused Kuma chat run response header
* Register Kuma with the shared async streaming router
* Always execute Kuma messages in background runs
* Use chat run constant enums in Kuma
Kuma's model_unavailable error code moves to its own run constants,
because the engine no longer defines run type specific codes.
* Move the tool executor into Kuma
Kuma is its only user, and it is specific to pydantic-ai agents, so it does
not belong to the shared chat run engine.
* Return nothing from Kuma's interruption warning hook
The engine now prunes a run whatever the hook does, so it no longer reports
whether the warning was kept.
* Stop patching the removed ChatRunBuffer.finish
* Fix and simplify Kuma's background run adapter
- Save "nothing changed" when the model was unavailable or the prompt
never reached it.
- Keep the progress line after a reconnect and build the compatibility
records from their models, with the right text for runs that did nothing.
- Delete the in-request path, its cache-key Stop and the event bus.
- Map a second message to 409 directly and return one run shape in the
chat API.
- Fix docstrings, help texts and the POST schema; drop overlapping tests and
share run test helpers.
* Fix and simplify Kuma's run follower in the browser
- Keep local-only messages on refresh and show a queued run as queued.
- Settle a request aborted before it is sent and never show raw error pages.
- Fall back to the API for a new view whose broadcast is late.
- Stop a run through the engine.
- Delete the reader for the previous backend, the old cancel call and the
UI location history.
- Share run test helpers and drop overlapping tests.
* Tighten Kuma's e2e tests, CI setup and docs
- Prove a live resume after a reload and drop a test that proved nothing new.
- Keep Kuma's panel closed in every browser context through the storage state.
- Drop the unused OpenAI key from the e2e setup.
- Rewrite the background replies section of the AI assistant docs.
* Handle Kuma runs whose sender lost access, and other review fixes
- A queued run whose sender can no longer use Kuma ends as access_lost
without calling the model.
- A chat keeps asking runs for a title while its title is provisional.
- Test that a run captures and saves its onboarding target.
- Pass Phoenix settings to the dev export worker; pin CI's Kuma stub to
Node 24.22.1.
* Fix Kuma's browser edge cases found in the re-review
- A send whose stream is refused after its run started re-reads the
chat and counts as accepted.
- A chat read that ends after another chat was chosen is dropped, and
only a 4xx forgets the tab's stored chat.
- An unsaved outcome stays shown while its run is the chat's latest.
- The status line shows that Kuma is answering.
- Empty stopped or failed answers show only their outcome.
- Logout clears Kuma's chats, messages and pending navigation.
* feat(assistant): follow Kuma replies through shared chat runs
* refactor(assistant): remove obsolete stream-limit recovery
* fix(assistant): simplify Kuma cutover and preserve legacy Stop
* fix(assistant): preserve existing Kuma API contracts
* refactor(assistant): match stream event kinds
* refactor(assistant): simplify execution and navigation
* fix(assistant): show that Kuma is cancelling after Stop
* test(assistant): cover the stale refresh guard and trashed workspaces
* refactor(assistant): close the run follower and drop the unused baseline
* refactor(chat-runs): share the run-in-progress error code
* docs(assistant): document the run limit and the deprecated chat status
* fix(assistant): give a duplicated tab its own Kuma tab id
* feat(agent): trigger agents when rows are created, updated or deleted
* test(agent): find the trigger picker by the class it now has
The trigger picker renders the shared service picker since the send
email actions, so its menu is under .agent-service-picker.
* fix(agent): check a trigger's access again before its conversation starts
The task that starts a firing's conversation trusted the access check made
when the event happened. A run identity removed, trashed or without access
by the time the task ran still got a conversation with the event's rows.
* fix(agent): apply the row trigger review fixes
- A type change moves an overlap rule left at the old type's default to
the new type's default.
- Queued replies wait while the run identity can't read what the trigger
watches.
- An imported formula is kept as written when no path is remapped,
through one import_formula in core.
- Row events hand their listeners services holding the event's table.
- Trigger form choices no longer read the workspace's views.
- A first row too long for a message is cut short instead of left out.
- A no-access error for a type the card no longer shows is ignored.
- The dispatcher no longer clamps the batch size.
* fix(agent): keep the merged trigger behaviour and UI for row triggers
- Skipping stays the default overlap rule: only the row trigger types say
their events can't be skipped, so HTTP and periodic triggers start as
they did before.
- The workspace-access note is a plain alert and the batch size field is
spaced like the hosted forms, without style overrides.
- The type-change and queued-firing tests are develop's again, with the
row trigger tests added after them.
- ADR 014 names the hooks row triggers add to the shared service type.
* fix(agent): show a row trigger without workspace access as misconfigured
The trigger can't run until the agent has workspace access, so its card
gets the error icon with a tooltip and the database field shows the error,
instead of an info note.
* feat(agent): configure per-user active-run limits
BASEROW_AGENT_MAX_ACTIVE_RUNS_PER_USER caps the Agent replies one user can
have queued or running across workspaces. Unset means no limit, so
self-hosted installs are unaffected. The run-type hook receives the user so
a plugin can set the limit per user.
* fix(agent): address review of the per-user run limit
- Negative Agent run limits mean no limit, like the trigger limits, so no
configured value can refuse every send.
- Docs keep plan wording for the workspace hook only; the user hook sets
one user's cap across workspaces.
- ChatRunLimitReached docstrings say "a reply limit" instead of listing
which limits exist.
- Drop Agent tests that repeated core checks; core now checks that a
finished run frees its slot.
* feat(agent): add configurable send email actions
* fix(agent): send what an action call showed and harden actions
Review fixes for the send email action.
- Resolve an action call's formulas once and carry the values from the
held call to its dispatch, so the approved preview is exactly what is
sent. DispatchContext.resolved_values lets a dispatch skip resolving
the formulas of that service again.
- Deny an approved call when its integration changed, or when it comes
back without the values its approver read.
- Let the AgentActionType base own configuration checks, preview and
dispatch. A type only supplies its defaults and readable values.
- Reserve the mcp<number>_ names of connected app tools, and accept any
valid input name, run_ctx included.
- Keep whole numbers whole in Number inputs.
- Add BASEROW_AGENT_MAX_ACTIONS_PER_AGENT, unset by default, and load an
agent's actions in a constant number of queries.
- Order and label an action's fields from its presenter in the step
card and in configuration errors.
- Replace the plan with docs/development/agent-actions.md.
* fix(agent): show what a saved action returns and drop undone errors
- A debounced save updated a copy the action card doesn't render, so the
configuration errors the server found never showed. Save through the
object the list renders.
- Clear a rejected edit's error once the edit is undone.
- Word the action limit so it also reads well with a limit of one.
* test(database): update decorator tooltip snapshots for edge-aware tooltips
The tooltip directive now keeps top and bottom tooltips inside the
viewport and positions their arrow, which changes the inline style the
two decorator tooltip snapshots record.
* fix(agent): mark an action formula with a refused argument as invalid
A function's argument check raises Django's ValidationError, which the
readiness check let through. A formula like minus('abc', 1), stored by
an import, then failed the action list, the configuration and every
reply instead of showing the action as misconfigured.
* fix(agent): start an email action on the instance server only if it delivers
The starter asked the looser question the builder and automations use,
while the readiness check asks whether a message is delivered. With a
backend that only prints, a new action opened on the instance server
and was unavailable straight away.
* fix(agent): name a deleted action in the trash
* fix(agent): read a negative agent limit as no limit
A limit of -1 was kept as a limit, so nothing could be added: no action
with BASEROW_AGENT_MAX_ACTIONS_PER_AGENT, no reply with
BASEROW_AGENT_MAX_ACTIVE_RUNS_PER_WORKSPACE. Both now treat 0 or less
as no limit, like the trigger caps.
* feat(agent): ask first by default before an action runs
A new action sent as soon as it was added, so anyone chatting with the
agent could have it email any address. Built-in tools that change data
and MCP tools already start with Ask first on; every action now does
too, at the model level so the next action types inherit it.
* fix(agent): tell the approver's own session when "Always allow" applies
Approving with "Always allow" turned Ask first off on the server, but
the realtime event skipped the approver's session as if it had edited
the action itself. The Actions card kept showing Ask first on while
emails went out. No session made this edit, so every session is told.
* fix(agent): show an action call in full to whoever approves it
The approval preview kept 10 recipients and 1,000 characters while the
call sent everything. An action's step now shows every value, never
shortened. Limiting what a call may send is left to a follow-up.
* fix(agent): apply every action event a reconnect replays
Action events all write to one slot of the agent, and the watcher only
saw the last value of a tick. A reconnect replays what it missed in one
loop, so an action another user created was lost when a later event
followed it. The watcher now runs on every write.
* fix(agent): reload the configuration when the agent gains or loses an action
Actions count as tools for web search, but nothing refetched the
configuration when one was added, switched, repaired or deleted, here
or by another user. On a model that can't search while it uses tools,
the web search setting stayed stale until a reload. The Actions section
now emits the reload other sections already use, only when the agent
gains its first callable action or loses its last.
* docs(agent): leave the limits of a call to its action type
What a call may send and what its preview shows is for each action type
to limit. Send email limits neither yet.
* fix(agent): mark a stored formula that can't be checked as invalid
A formula nested too deeply raised RecursionError in the readiness check,
so listing the actions, the configuration and every reply failed. Any
failure to check a formula now marks its field as invalid, as a stored
formula can make the parser or a function's own check raise anything.
* fix(agent): keep an approval when its integration is renamed or moved
The approval key digested the whole exported integration. Its name and
its place in the list don't change where a call is sent, and the place
of every integration can change when another one is added or moved.
* fix(core): keep the custom scrollbar in WebKit browsers
Since Chromium 121 the standard scrollbar properties replace the
::-webkit-scrollbar rules, so the rich text editor lost its 10px thumb.
The standard properties now only apply where those rules don't exist.
Stylelint is told that a mixin's body ends up inside a rule.
* chore(agent): name the collapse-all button after its block
* feat(agent): rate-limit agent triggers and let a busy trigger skip or wait
* feat(agent): choose a trigger's overlap rule and show skipped firings
* feat(agent): let a trigger run its replies in parallel
A third overlap rule, Run in parallel, starts up to
BASEROW_AGENT_TRIGGER_MAX_PARALLEL_RUNS replies at once (default 5) and
queues the rest up to the queue cap. Skip, Wait and Parallel now share one
rule (OverlapLimits): start while there is room to go and nothing is
queued ahead, queue while the queue has room, else skip. A firing held
back by the workspace's run limit queues where the rule queues. The
hand-off and the sweep start as many queued replies as fit.
* test(agent): pin the trigger lock order a hand-off and a builder's save rely on
* fix(agent): lock agent before firing its trigger
* fix(agent): tighten trigger overlap counts and limit parsing
- A reply in a trashed conversation no longer counts as going, so it
can't block a trigger until the trash is emptied.
- A message that fails to resolve fails its reply before the overlap
rule, so the builder sees it instead of a skip.
- The hand-off locks only the queued replies that can start.
- Rate-limit pairs must be positive integers.
- The API help text describes `parallel`.
* fix(agent): hand a trigger's queue on in its own task
- When a trigger's reply ends, a task started with the trigger's id
starts its queued replies, instead of the ending reply's save doing
it. With the broker down, a hand-off fails at most one reply instead
of the whole queue, and the reply's save no longer loads the trigger.
- The hand-off and the sweep check what a firing checks: Agents on, the
trigger type available and the agent ready. A trigger that can't fire
keeps its queue until it can.
* feat(core): encrypt stored secrets with a dedicated key
A database dump or read access shouldn't reveal the credentials Baserow sends
to other services. Values say which key encrypted them, so keys can rotate.
* feat(integrations): encrypt the keys and tokens of MCP servers
They are the first secrets stored with the new encrypted field.
* docs: explain that one key encrypts every stored secret
The key, field and rotation command are shared by every secret encrypted at rest, so losing or changing the key affects all of them.
* fix(core): never decrypt written secrets and keep rows with unreadable ones loading
A written ciphertext was decrypted on save, and one unreadable value broke every query on its row.
Also reads secrets after a SECRET_KEY change, fixes the context per field, and stops the image generating a key per container.
* fix(core): keep unreadable secrets stored, never sent, and load dumps once
An unreadable secret read as empty, so moving its server skipped the credential
check and refreshing erased the tokens. Dumps were encrypted twice on load.
* fix(core): refuse encryption keys that share an id
A value names its key by id only, so the second key could never be used.
* fix(core): make reencrypt_secrets decrypt every secret and fail on any it can't
--check only counted prefixes, so missing keys and tampered values passed.
* docs: explain backups, restores and changing the encryption key
* fix(core): keep damaged secrets unusable and verify against the primary
A damaged envelope read as plain text and passed --check, and --check could
read a lagging replica instead of the database rotation writes to.
* docs: stage a first dedicated key and upgrades from development builds
* feat(mcp): link to the docs for per-app OAuth setup steps
Claude and ChatGPT change their connector UI often; the docs can follow without a release.
* feat(mcp): plugin-first setup and one-click installs on the MCP settings page
Point Claude Code users at the plugin, build Cursor and VS Code install links from the instance URL, and add Codex, Gemini CLI and add-mcp commands so self-hosted users get copy-ready setup.
* fix(mcp): handle non-Latin instance URLs in the editor install links
btoa() threw on a non-Latin hostname and blanked the Cursor tab, including the config fallback.
* Add suspect and presume primitives for wait service.
* Add the Wait service and node that pauses a workflow.
* Ensure resume_at is returned in node history serializer
* Add the frontend Wait node and show waiting nodes in the workflow history.
* Add migrations for wait service and node
* On cancellation request, ensure waiting node is cancelled immediately
* Tolerate a deleted run history when the dispatch chain ends
* Ensure that lost wake-up tasks are recoverable
* Add changelog
* Fix test
* Cancel run of deleted workflow
* Mark the node as error when hourly sweep finds stale waiting node that is in a loop
* Show the iteration of a waiting node in the run history
* Stop counting waiting runs toward the unfinished runs rate limit
* Add tests that waiting runs finish after the workflow is switched off
* Merge migrations
* Update comment
* Disable node error policy for types that don't need it
* Simplify error message
* Remove the skipped status, as it isn't really useful
* create index concurrently
* feat: add permanent workspace invite links behind the rbac_improvements feature flag
* feat: ask logged-in users to confirm before joining a workspace through an invite link
* feat: make the invite link code length configurable with a default of 12 and a minimum of 7
* feat: let admins name invite links so they remember what each one is for
* feat: show only the invite path in the link column to make room for the name
* fix: harden invite links and let people sign up through them with single sign-on
* fix: ask people who sign up through an invite link with single sign-on to confirm joining
* feat: let invite links raise a member's role after they confirm, without ever lowering it
* fix: move shared clipboard helper into core
* fix: validate workspace invitation link roles
* refactor: share confirmation modal across core features
* refactor: use literal frontend translation keys
* fix: label invitation route Invite links
* fix: copy invitation links when clicking their paths
* fix: align invitation migration with latest develop
---------
Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
* feat(agent-builder): answer messages with background replies
Each message starts a core chat run that streams the configured model's reply and saves it with its turn: status, error code, model messages, usage, and the provider and model that answered. Messages record their author. One reply runs per conversation, and BASEROW_AGENT_MAX_ACTIVE_RUNS_PER_WORKSPACE caps a workspace (default 5). Copies keep turns and authors and end replies still running.
* feat(agent-builder): stream, stop and resume replies in the chat
The chat follows each reply through the core run stream, shows authors, lets the user stop a reply, resumes after a reload or in another tab, and explains replies that did not finish.
* refactor(agent): keep replies focused on chat
* refactor(agent): keep each reply's outcome on its message
A reply is an assistant message created empty with its prompt, and the run
writing it saves its text, status and error code there, replacing the turn
table. Send responses name the run they started, so a reply that ends before
the response is still followed. Retries read the run before the reply, listed
replies that still look unfinished are read again from the primary, and blank
replies are saved empty.
* feat(chat): add shared chat components
Store-free message, markdown, composer and copy button components styled
after the agent builder designs, so the Agent chat and later Kuma can share
one UI. Replies render markdown without images, which could carry
conversation data to any URL, and app links open in the router.
* feat(agent-builder): show replies with the shared chat components
Replies render in place from the conversation history under the agent's
name and avatar, with Thinking and Writing above the composer while they
run, a note when stopped and an error card when they fail. Stop stays
available while a reply runs, even when the configuration stops being
ready.
* feat(agent): hand finished replies to followers and announce reply runs
A finished run carries the saved reply as the messages list shows it, so
followers can apply it without reading the messages again. Conversations
expose the run writing a reply, and agent_conversation_updated carries that
run's id when a reply starts and null when it ends, with the conversation's
updated_on to order them, so every session can show it without requests.
A blank model answer now ends the reply as failed, and replies reuse
ChatRunStatus. Reply permission checks move to the service, sends check the
agent-builder flag, finishing a reply relies on the engine's run lock
instead of a row lock, and the workspace limit defaults to 10.
* feat(chat): share Kuma's typing and loading indicators
Kuma's bouncing dots and reasoning spinner move to core as ChatTyping and
ChatLoading, and Kuma renders them from there with the same look.
ChatComposer's status prop becomes activity and keeps focus on the input
when Send and Stop swap, ChatMessage drops its author props until
conversations can be shared, and markdown leaves mailto and other non-web
links to the browser.
* feat(agent-builder): show reply progress like Kuma and apply replies in place
A reply shows the typing dots until its first text, then a spinner beside
the streaming text. The finished run's saved reply replaces it in place, a
run's start no longer reads the messages, and a streamed chunk re-renders
only the reply being written. Realtime updates set a listed conversation's
run without reading the list again, so its dot pulses grey while it
replies, in every session, and the page drops its chat subscription when no
conversation is open.
* fix(agent): handle empty replies and legacy message retries
* fix(agent): address reply review feedback
* refactor(chat): share response UI with Kuma
* fix(assistant): separate thinking from streamed answers
* feat(chat): share message footers with Kuma
* fix(chat): keep thinking blue and streamed answers expanded
* fix: download active content from secure file serve
Without dl, every type was served inline, so an uploaded HTML or SVG file could run script on the Baserow origin.
* fix: download audio and video opened directly from secure file serve
The sandbox CSP left a dead player for them, and the built-in mime table made the audio entries depend on the host.
* fix: remove audio and video from the secure file serve allow-list
The sandbox CSP left a dead player for them, and the built-in mime table made the audio entries depend on the host.
* fix: download BMP from secure file serve and test both MIME tables
The production image calls BMP image/x-ms-bmp, which Chromium and WebKit download anyway.
SecurityMiddleware already sets nosniff, so the view no longer does.
* Added semantic search vector indexing
* Introduced incompatible state
* Covered template scenarios
* Set data_schema in local baserow ingration
* Check if field is still enabled when updating
* Update docs about env var hash change
* Added enterprise query test
* Fixed index name
* feat(chat-runs): limit active runs per run type, per user or workspace
Each run type now counts only its own runs. The per-user limit keeps its default of 2, and a run type can add a per-workspace limit.
* feat(chat-runs): follow any run over one core streaming endpoint
GET /api/chat-runs/<run_id>/stream/ relays the output of any run type behind its read check. Helm and the install guides route /api/chat-runs/ to the ASGI service; the guides also gain Kuma's /assistant/ route.
* feat(chat-runs): read the core run stream by default in the frontend
The base ChatRunType reads the core stream, applies the resume baseline and retries once after a token refresh.
* refactor(chat-runs): expose the output fold for lost runs
Run types rebuild a lost run's partial text from the buffered output with fold_output.
* perf(chat-runs): send heartbeat records and skip repeated run reads
While no output arrives, an open stream sends run.heartbeat as a JSON
record, so a follower can tell a quiet stream from a stalled one. The stream
view hands follow_run the run state it read for its permission check,
finish_run returns the ended run instead of letting callers read it again,
and a lease renewal takes one statement while the run goes on. The
per-workspace limit hook receives the workspace, so a run type can set the
limit per plan.
* perf(chat-runs): follow runs from their open stream in the frontend
The store reads a run's status only while it has no stream or the stream
lost its output, and restarts a stream that stays silent for 15 seconds,
also after the computer slept. Following a run opens its stream directly,
and Stop doesn't read a run whose stream is open. Each run type keeps one
chat subscription, released with unsubscribeFromChat; refreshChat runs only
when a subscription is confirmed on a new websocket, and window focus or a
regained network only re-attach followers. The developer guide documents
the subscription and heartbeat contract.
* perf(chat-runs): write a reply's first words at once
- The journal writes output after a quiet moment at once and batches
what follows, so the first words no longer wait for the 250 ms timer.
- The stream adapter settles when aborted. Chrome can fire the last
progress event after the request is done, where aborting fires no event.
- A stream refused with 503 is retried with the next status check
instead of spending every reconnect attempt at once.
* refactor(chat-runs): register the stream route by URL name
* fix: rotate refresh tokens and revoke the session when an old one is reused
A refresh token could be replayed to get new access tokens until it expired,
so a leaked token gave access for up to seven days.
* test: mint the refresh token inside the frozen time
The token was minted at the real time, so refreshing at an earlier frozen time failed once the clock passed it.
* fix: document the rotated refresh token in the token refresh response
The schema checked simplejwt's own rotation setting, which is off, so the API docs left out refresh_token.
* fix: keep the user session valid across refresh token rotation
The previous release crashed on the new cookie payload, and the cookie stopped
working as soon as its refresh token rotated.
* test: sign out through the API in the secure file serve test
Signing out revokes the session, which is what the user session cookie checks now.
* fix: limit password reset and verify email requests
Anyone could flood an address with reset emails, and parallel requests got past
the verify email limit. Adds a per-recipient reset limit, a per-IP limit on both
endpoints, and makes the rate_limit decorator atomic.
* fix: keep reset and verify email limits separate
Both senders were named send_email, so they shared one rate limit bucket per user.
* fix: make the per-IP email limit opt-in and name rate limits
Behind nginx and Caddy every caller shares one IP, and behind an appending
proxy the caller picks it, so the IP limit now needs BASEROW_THROTTLE_IP_ENABLED.
* feat(core): add Redis-backed background chat runs
Run AI work once in Celery and follow bounded Redis Streams over HTTP. Keep
lifecycle, Stop, leases and final outcomes in Postgres without per-token writes.
Include the shared frontend follower, adapter registry, recovery API, migration,
queue/deployment wiring and adapter guide. No product uses it yet.
Part of #6346
* Remove unused chat run response header exposure
* Extract shared async streaming HTTP router
* Simplify chat run follower and group engine constants
- Check read access once when a stream opens; read run state from Postgres
only after 5 s without output or on run.finished.
- Split follow_run into small steps around _OutputReader.
- Turn event kinds, error codes and stop reasons into StrEnums; the
Kuma-only model_unavailable code moves to Kuma.
- Document ChatRunType hooks with param, return and raises fields.
- Add BASEROW_ASGI_HTTP_MAX_CONCURRENT_STREAMS and size the follower Redis
pool by it.
- Give handler publish/recover calls their own event loop, so cleanup
cannot close pools shared by HTTP followers.
- Update ADR 010 and the background chat runs docs.
* Clean up chat run interfaces and test setup
* Prune chat runs once after 7 days and skip overdue claims
- Delete each expired page with one statement. Incomplete runs get one more
ensure_interruption_warning call first, and are deleted even if it fails,
so run metadata never accumulates. The hook now returns None.
- Keep runs for 7 days instead of 30.
- Never claim a queued run older than NOT_STARTED_AFTER; the sweeper ends it.
* Retry brief Redis failures in chat run followers
- A connection error, or a buffer that does not exist yet, is retried with
the same cursor, sending heartbeats meanwhile.
- run.replay_unavailable is only sent once the follower stops reading, so
the browser can treat it as final.
* Let finished chat run output expire with the active TTL
Nothing reads a buffer once its run has finished: followers return the saved
outcome first and recovery only reads running runs. Drop finish() and the
24 h TTL, so a finished buffer expires an hour after its last append.
_publish_terminal now reuses _publish.
* Run the chat run scale tests on fakeredis
Build the buffer's real read and write pools on fakeredis connections, so
these tests always run and backend CI needs no Redis service. The Kuma e2e
tests cover a real Redis.
* Address the remaining chat run review comments
- Serialize the saved outcome after the transaction, so only a failed save
is logged as one.
- Make the primary-pin test transactional; inside the test transaction the
router always used the primary, so it could not fail.
- Cover the race past the per-user lock, a lost run after Stop and an old
writer appending to a recreated buffer.
- End the admission test's request with a disconnect, so a regression fails
instead of looping.
- Document that one worker process runs AI replies one at a time.
* Move the chat run migration after develop's core 0130
* Log only the class of an outcome serialization error
* Test that the run deadline asks a run to stop
* Keep a run's status when a resumed follower rebuilds its output
* Note that slow DNS lookups turn off a run's live output
* Implementing the new invite-to-scope design and functionality.
* Simplifying the invitation acceptance, we don't need the redirect.
* Fix the action type description
* Addressing my own review feedback, and making sure the workspace invitation form behaves like the scoped one.
* Further tweaks after testing edge cases manually
* Lint fix
* Taking a DRYer approach to validating the subject chips.
* Lint fix
* Addressing feedback
* fix: block invitation batches containing invalid emails
Malformed addresses could be silently cleared after a partial batch send.
Keep them visible and block submission until corrected or removed.
* fix: respect workspace invitation permission in scope sharing
Scoped Admins could attempt email invites denied by workspace permissions.
Gate new-email invitations while keeping existing subjects assignable.
* feat: unify workspace and scoped access lists
Workspace and scope lists duplicated markup and lacked consistent controls.
Share rows, add workspace edit/cancel actions, and cap lists at six rows.
* fix: reconcile invitation branch with develop
Develop enables agents and adds an Enterprise migration at the same number.
Align invitation subjects and renumber the branch migration after develop.
* refactor: resolve workspace user roles in the backend
The frontend duplicated the backend mapping from basic roles to RBAC roles.
Expose role_uid in user payloads and reuse it for inherited access counts.
* fix: validate invitation emails before submission
The permissive database validator let malformed invitation addresses reach the API.
Use the existing strict validator for email suggestions, chips, and batch submission.
* fix: align invitation input focus styling
The invite input used a gray border tied to whether suggestions were open.
Use the standard blue border with focus-within so Escape preserves the focus highlight.
* feat: limit email invitation batches
Large invitation batches can exhaust the sending allowance partway through.
Default to five new emails per batch, configurable, with a message before submission.
* feat: let roles declare the invitation default
RBAC invitations should default to Viewer without Enterprise-specific logic in core.
Let role types declare the default: Member for basic workspaces and Viewer for RBAC.
* refactor: keep invitation role semantics in their owning modules
Core invitation UI should not interpret Enterprise role IDs or depend on Database roles.
Move basic roles to core and let Enterprise supply invitation subtitles through role metadata.
---------
Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
* docs(mcp): describe /mcp with OAuth and endpoint keys in the MCP server doc
The doc still described the SSE key URL as the only way in.
* docs(mcp): cover OAuth and settings tabs in the MCP test plan and dev doc
The test plan only covered the SSE key URL.
* docs(mcp): add setup for other MCP clients and the baserow-mcp plugin
The test plan only showed Claude Code.
* docs(mcp): fix review findings in the MCP test plan and docs
Use a <server url> placeholder, link the baserow-mcp README for other clients and correct UI steps.
* docs(mcp): unset BASEROW_PUBLIC_URL in the tunnel step
It overrides PUBLIC_BACKEND_URL, so the tunnel URL was ignored.
* docs(mcp): mention the OpenAI apps challenge route for self-hosted proxies
#6395 added it to the Caddyfile only.
* chore(embeddings): replace transformers with tokenizers and drop pip from the image
* chore(embeddings): fix the dev health check and docs, add a changelog entry
* chore(embeddings): port the dependency and threading updates from #6379
Brings over the changes from #6379 that this branch didn't have yet:
- onnxruntime 1.26.0, tokenizers 0.23.3, starlette 1.8.0 and uvicorn 0.54.0,
plus huggingface_hub 2.2.0 and transformers 5.19.0 in the build stage.
- The model download is pinned to its current revision.
- Inference uses as many threads as the container's CPU limit, which
EMBEDDINGS_NUM_THREADS overrides.
- Inference runs in a worker thread behind a lock, so /health answers during
long batches.
- An empty texts list returns 400 instead of 500.
- Helm, its README, Cloudron and the README point to baserow/embeddings:1.1.0.
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
* chore(embeddings): address review feedback
- The build stage writes tokenizer.json with the 512-token truncation and
per-batch padding, so app.py only loads it. The build stage uses the
tokenizers library for this and no longer installs transformers.
- tokenizers is installed with --no-deps. Its only dependency,
huggingface-hub, is used by from_pretrained, which the app never calls.
- The README's local run installs the image's packages, downloads the model
with _download_model.py into EMBEDDINGS_MODEL_DIR (default /model), and
its snippet posts texts instead of text.
* chore(embeddings): fix the issues found while verifying the image
- requirements.txt pins all 13 runtime packages and is installed with
--no-deps, so rebuilds are reproducible. The builder no longer installs
git, and the build fails if the app can't be imported.
- Requests are processed 8 texts at a time and limited to 256 texts and a
1 MiB body, so a single request can't OOM-kill the container anymore.
- Inference holds a lock in its worker thread, and a queued request whose
client has gone is skipped.
- Malformed input, including lone surrogates, returns 400 instead of 500.
- The app refuses to start with a tokenizer.json that doesn't truncate at
512 tokens, or with EMBEDDINGS_NUM_THREADS below 1.
- _download_model.py can be re-run.
- The README, docs, Cloudron manifest and changelog match the code, and the
Cloudron manifest gets a 1.5 GiB memory limit and the /health check.
* chore(embeddings): correct the response size per text in a comment
---------
Co-authored-by: Bram Wiepjes <bramw@protonmail.com>
* 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): upgrade the Python base image to 3.14.8
* chore(deps): upgrade Caddy to 2.11.6
* chore(docker): add apt repository keys without installing gnupg
* chore(docker): install supervisor from PyPI in the all-in-one image
* chore(deps): upgrade wasmtime to the 48.0.5 LTS release and verify its checksum
* ci: run the code runner tests against the real wasmtime binary
* chore(deps): bump click to 8.3.3
* chore(deps): build mox against x/crypto 0.56.0
* address feedback
Python 3.14.7, Node.js 24.21.0, Go 1.27 (mox builder), and the dev-only
Keycloak, OTel collector and Phoenix images. Caddy 2.11.4 is already the
latest release.
* feat(core): add Z.ai AI provider
Z.ai can be added as an instance or workspace AI provider with an API key.
It uses pydantic-ai's ZaiModel with a profile limited to the request fields
Z.ai documents: automatic tool choice, max_tokens, no strict tool definitions
and no file parts. AI fields send JPG/PNG images and small text files; the
temperature is capped at 1.
Part of #5753.
* fix(core): limit Z.ai thinking on short capped requests
Z.ai reasons at maximum effort by default, so a 250-token Kuma title or a
256-token model test could spend its whole budget reasoning and return
nothing. Requests capped at 1024 tokens or less now disable thinking, or
ask always-thinking models such as glm-5.3 for low effort, unless the
caller chose a level.
Admins can add xAI as an instance or workspace AI provider with an API key.
It uses xAI's OpenAI-compatible Chat Completions API at https://api.x.ai/v1
through pydantic-ai's OpenAIChatModel and Grok profile, so no new dependency
is needed. Only the stored key is used: the provider never falls back to
XAI_API_KEY or OPENAI_* variables, and it clears the organization and project
headers the OpenAI SDK would otherwise fill from the environment.
AI fields embed JPEG and PNG images within a 20 MiB budget and inline small
text files. Chat Completions has no document input, so other files are
skipped.
* feat(core): add Amazon Bedrock AI provider
Admins can add Amazon Bedrock as an instance or workspace AI provider with
an IAM access key or a Bedrock API key plus a region. The client only uses
the stored credentials: it forces its signature version so botocore never
prefers AWS_BEARER_TOKEN_BEDROCK, and ignores configured endpoint URLs so
the Helm chart's MinIO AWS_ENDPOINT_URL cannot redirect Bedrock traffic.
AI fields send images and documents as native Converse blocks within
Bedrock's per-kind limits, via a new EmbedKindLimit hook on FileHandler.
* fix(core): allow AI provider API keys up to 4096 characters
Short-term Amazon Bedrock API keys are presigned URLs of about 2,500
characters, so the 512-character limit rejected valid keys. The column only
widens (varchar(512) to varchar(4096)), which needs no table rewrite and
stays compatible with the previous app version.
* fix(core): do not send HTML files to Bedrock as documents
Uploads store HTML as application/octet-stream to neutralise active
content, which Bedrock Converse cannot map to a document block, so one
large HTML file failed the whole AI field cell. Large HTML files are now
skipped; small ones are still inlined as text like for every provider.
* test(core): pin Bedrock API key mode and newline key rejection
Assert that an API key client never resolves the default AWS credential
chain, and that the embedded-newline test fails on the api_key error
rather than on an unsupported provider type.