mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 00:08:25 +00:00
develop
140
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f5bc919473 |
feat(celery): make every task work on a threads worker, and use one in dev (#6926)
* chore(dev): run one threads Celery worker with beat in dev The Docker and native dev stacks start a single Celery worker for every queue, with redbeat embedded, instead of a worker, an export worker and a beat process. It uses a new ThreadsPool that sends worker_process_init, so telemetry and the lazy import check still run under the threads pool. * fix(ws): stop closing every event loop's Redis pools after a broadcast send_messages_to_channel_group called channel_layer.close_pools(), which closes the pools of every event loop, including the ones other worker threads are still sending with. Under the threads pool about a third of broadcasts failed with "attached to a different loop" and some hung. channels_redis now closes a loop's pools itself when that loop closes. * fix(telemetry): keep Celery trace context per thread on threads workers The Celery instrumentation keys a running task's span, context token and start time by the task's id. A task replaced with self.replace(), like every automation node, keeps its id, and on a threads worker the replacement can start in another thread before the original ends. The original then ended the replacement's span and detached its context from the wrong thread, logging "Failed to detach context" and leaving its own context on the thread. That state is now kept per thread. * feat(celery): enforce soft and hard time limits in ThreadsPool Celery's own threads pool ignores soft_time_limit and time_limit, so on a threads worker tasks that rely on them would run on. ThreadsPool now raises the limit in the task's thread, only while that task runs, so a limit never reaches the next task of the thread. EMAIL_TIMEOUT stops a silent SMTP server from blocking a worker thread forever. * fix(chat-runs): cancel a run that keeps going after its deadline The deadline only asks a run to stop. A run whose tools or provider call ignore that request now gets 60 more seconds, is then cancelled, and is saved as timed out. Celery's limit moves after that, so the run's own stop always comes first. On a threads worker this is the only way to end it, because a time limit can't reach a thread waiting inside async_to_sync. * fix(premium): share one capped thread pool across AI field generations Each generation started its own pool of BASEROW_AI_FIELD_MAX_CONCURRENT_GENERATIONS threads, so a threads worker running several jobs multiplied the threads and model calls. All generations in a process now share one pool of that size. A prefork process runs one job at a time, so nothing changes there. * feat(celery): cancel queries at the hard limit and report overdue tasks ThreadsPool checks every running task's time limits from one watchdog thread, like the prefork pool's timeout handler, instead of starting timer threads for each task. At the hard limit it also cancels the query the task's thread is running, which the limit's exception can't interrupt. A thread can't be killed, so a task still running 60 seconds after its hard limit is reported to Sentry instead. Every limit reached is counted in baserow.celery.task.time_limit, per task and limit. * fix(airtable): time out requests to Airtable Two Airtable import requests had no timeout, so a server that stopped answering held the import, and on a threads worker its thread, forever. All Airtable requests now use the same 3 minute read timeout. * fix(celery): load sentry_sdk only when reporting an overdue task The overdue report imported sentry_sdk at the top of baserow.config.celery, which every process imports, so it was loaded even with Sentry off. * chore: add a changelog entry for the Celery task timeouts * fix(celery): raise threads pool time limits at the task's next query An exception raised into a thread from outside can land right after a lock is taken and before the code that releases it, leaving the lock held for every thread of the worker. The pool now marks a reached limit and the task's own next query raises it, once, through a connection execute wrapper. The hard limit still cancels the running query, and raises TimeLimitExceeded whatever the soft limit is. Limits end before Celery's success callback runs. Savepoint queries are never interrupted, through a helper shared with the periodic field update deadline. * fix(celery): apply the worker default time limits on the threads pool Celery passes CELERY_TASK_SOFT_TIME_LIMIT and CELERY_TASK_TIME_LIMIT to the pool and None per task when a task sets no limit. The prefork pool falls back to the pool's values; the threads pool now does too. * fix(celery): keep threads pool time limits until running tasks end The watchdog stopped before on_stop waited for the running tasks, so a task passing its limit during a warm shutdown was never stopped or reported. * chore: name the emails the SMTP timeout covers in the changelog EMAIL_TIMEOUT applies to the instance's own emails only. Automation and builder SMTP steps already time out after 30 seconds. * chore(dev): drop dev.sh tabs for the removed Celery workers The export and beat services are disabled, so attaching to them made the script exit before opening the remaining tabs. * test(celery): cover thread time limits and savepoint rollback * fix(ai): use one generation slot for nonpositive limits * fix(chat): warn that an action may finish after a reply times out * docs(celery): explain which timeout guarantees require prefork * docs(celery): record the threads pool decision and task contract * fix(chat): keep the worker slot until started tools finish * fix(chat): warn visitors about repeating a timed-out request * docs(chat): clarify when the stop grace period begins |
||
|
|
f01dce307f | chore: remove the agent-builder and user_templates feature flags (#6960) | ||
|
|
d7e2c3f635 |
chore: remove core and WAB feature flags shipping in v3 (#6903)
* chore: remove core and WAB feature flags shipping in v3 * docs: drop stale feature flag mentions from invitation link comments * docs: add missing changelogs for released core features * docs: mark identities ADR as accepted * chore: remove the identities feature flag * docs: add changelog for workspace identities * test: remove obsolete identity feature flag test * docs: remove stale identities feature flag references --------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com> |
||
|
|
e7381b5384 |
feat(mcp): always turn on OAuth sign-in and add the MCP tools changelog (#6930)
* 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. |
||
|
|
2686fb21a9 |
fix(agent): show held calls in full, name option renames, stop replies on trash (#6909)
* fix(agent): show held calls in full, name option renames, stop replies on trash Approvers saw cut previews of what was sent, option renames hid the rows they change, and trashing an agent left its running reply going. * fix(agent): let a removed member's running reply finish Removal now only blocks the member's next send or approval, so an accidental removal doesn't leave a partial result that won't resume. |
||
|
|
9e93fb8e36 |
chore(agent): keep agent tool approvals visible and show failure details to builders (#6883)
* fix: keep agent approval controls visible on every pending call * fix: show private tool failure details to agent builders * fix: align approval buttons and wrap them as a group * fix: highlight failed tool calls and show the reason on demand * fix: preserve native disclosure buttons in tool history * fix: label the batch action Always approve all * fix: simplify approval rows and open tool errors in a context * fix: give the always approve action more room * fix: show failed tool calls once in approval cards * feat: show live tool execution status in agent conversations * fix: align tool status icons across approval rows * fix: shorten batch button to Always approve * fix: explain future tool access in approval tooltips * fix: right-align tool statuses with trailing icons * fix: match the tool spinner to the status icons * fix: give approval buttons equal widths * fix: explain email failures at the agent boundary * fix: map known integration failures to safe agent messages * fix: wrap tool statuses and refresh private diagnostics on demand * fix: order the agent diagnostics migration and verify finish payloads |
||
|
|
3276ed06fb |
fix(agent): stop tool calls on Stop, always allow app tools, name databases on cards (#6890)
* fix(agent): stop tool calls on Stop, always allow app tools, name databases on cards Stop is seen only on the 2 s lease poll, Always allow skipped connected-app tools, and same-named tables and rows looked identical on approval cards. * fix(agent): give every named row its id when row labels repeat A row named like another row's label could still read the same. * fix: address review on agent stop, MCP always allow and database names Refused calls show as not run, Always allow on MCP tools respects switched-off servers and tools under lock, and more presentations name the database. |
||
|
|
724ca69647 |
fix(agent): small Agent Builder fixes from the launch review (#6871)
* 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. |
||
|
|
0efdf44427 |
Added additional actions and email trigger to agents (#6866)
* Added additional actions and email trigger to agents * Made delete row id required and share outcome * Default formula handles text and html * Made the email trigger and list rows labels a bit more generic * Remove AI prompt and start workflow actions * Added create, update, and delete permissions check * Give correct action name to Kuma * Add view, field and aggregation to tool call * Prefetch query for row aggregate to reduce queries * Implemented tool presentation for each type * Made semantic search extend LocalBaserowAgentActionType --------- Co-authored-by: Davide Silvestri <silvestri.eng@gmail.com> |
||
|
|
68139d057c |
feat(agent): add semantic search as an agent action (#6814)
* feat(agent): add semantic search as an agent action An agent's builder can add the enterprise semantic search service as an action: the model supplies the query, the builder picks the Local Baserow integration, table and fields. The search runs with the integration's authority. An action type now says whether it changes data. A type that only reads starts with Ask first off and is never held behind another held call. Every registered action type is offered, also when the workspace's license locks it. A locked type shows the upgrade modal instead of being added, and a locked action can only be renamed, switched or deleted until its type is usable again. The model never gets a locked action. * Fixed some bugs * Run action with workspace identity * fix(agent): keep a search match whose files or links don't fit A row whose non-text values took more than the space left could not be cut, so the result lost it and every row after it. Values that don't fit are now cut to "…" like texts, so the best match is still read. * test(agent): cover the semantic search card acting as the run identity The spec still expected the removed integration picker. It now checks the form gets the tables the run identity can read, the link to set up workspace access without one, and the reload when the identity changes. * fix(agent): don't offer action inputs in search filters A filter is resolved when the call is sent, without the call's inputs, so picking an input there only produced a configuration error. A host can now narrow what filter values read, and the action card offers them none. * refactor(agent): name the workspace check of an action type is_usable available_action_types now lists the locked types too, so is_available named the opposite of what it returned for them. * refactor(agent): one limit on what the model reads of an action result HTTP request and semantic search each defined the same 20,000 characters. * refactor(agent): drop what the integration picker of actions needed No action wraps its form anymore and Agents no longer hold Local Baserow integrations, so the presenter hook and the test changes for them go. * docs(agent): actions on Baserow data act as the Run as identity State the rule for every action whose service reads or changes Baserow data: no integration to pick, permissions on the identity alone. Actions on other services keep their integration. Drop the integration and form wrapper parts that no longer hold, and say how to bound a result. * fix(agent): log why a tool or run failed in debug mode Tool, preview, step, web fetch, trigger message, MCP and chat run failures logged only the exception class, so a failed semantic search showed nothing but its name. They now share the reply's helper, which adds the exception text in debug mode. --------- Co-authored-by: Bram Wiepjes <bramw@protonmail.com> |
||
|
|
c152a16f92 |
feat: let Kuma create, change and remove data source filters from the filter form, the chat and MCP (#6544)
* feat: let Kuma create, change and remove data source filters from the filter form, the chat and MCP * fix: allow earlier data sources in Kuma builder filters * refactor: share targeted Kuma action endpoint * refactor: derive service filter validation from filter types * fix: reuse shared boolean values in service filters * refactor: expose filter deprecation on backend types * refactor: delegate formula examples to application types * fix: allow Kuma to edit summary widget filters * test: include summary widgets in filter tool contract * fix: allow dashboard service filter groups * test: allow dashboard filter groups in assistant prompts * feat: enable inline Kuma for summary widget filters * test: initialize roles for transactional synced table copies * fix: reject table changes during Kuma filter generation * fix: reject current node formulas in service filters * perf: batch filterable data source discovery --------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com> |
||
|
|
b580793dd7 |
fix(agent): address agent builder feedback (#6781)
* fix(agent): address agent builder feedback * feat(identities): let builders bind existing identities Binding an Agent or a Local Baserow integration to an existing identity takes the new identity.bind permission, held by workspace builders and admins. Creating, editing and deleting identities stays admin-only. ADR 013 updated and trimmed of migration and deployment details. * fix(agent): show ask before changes only for the Everything preset * fix(agent): fix CI and polish the tools modal and input table Update tests for the identity bind rule and the key/value input table, keep table keys on one line, use one toggle style in the external tools modal, and apply Prettier. * fix(agent): compact the pending approvals menu Each conversation is one line: its title with an ellipsis, then Always allow, Reject and Approve. The chat keeps the full approval card. * feat(agent): make the conversation sidebar collapsible * address feedback * Added a little bit of space after the trigger --------- Co-authored-by: Bram Wiepjes <bramw@protonmail.com> |
||
|
|
49eb0c4881 |
fix(mcp): let MCP clients undo and redo their changes (#6753)
* fix(mcp): let MCP clients undo and redo their changes MCP tool calls ran without a client session, so their actions were stored with no session and no undo could reach them. * fix(mcp): undo a whole tool call past the action group limit Sets the undo session for every tool in one place and restores it after the call. Reports lock conflicts instead of an internal error. * fix(mcp): stop undo and redo at a part of a call that failed Carrying on past a failed part left one tool call half undone. * chore(mcp): say why the undo session import stays local Qodo asked for a reason; a module-level import fails before Django is set up. * fix(mcp): keep other calls of an endpoint out while undo or redo runs Undo and redo take a call back in parts, and a call of the same endpoint that landed between two parts made them stop with the call half undone. * fix(mcp): release the endpoint lock on any database error An InterfaceError on unlock escaped and could leave the lock held, and the regression test now waits on the lock instead of a fixed timeout. * fix(mcp): give up on a taken endpoint lock and stop undo in a split call A blocked advisory lock wait froze the shared sync thread of the worker, so calls now try for a few seconds and ask the client to try again. A second undo after a failed part went on into the older parts of the same call. * docs(mcp): say how far the undo API reaches into MCP changes * fix(mcp): wait for the endpoint lock off the MCP thread and redo a partly undone call at once The retry sleep held the worker's shared MCP thread, so other calls waited too. Undo stayed refused after redo could no longer restore the call, and one redo only reset the failed part. * docs(mcp): describe the endpoint lock errors and partly undone calls * fix(mcp): take, use and release the endpoint lock in one step and redo only the failed batch A cancelled tool call could leave the endpoint lock taken until the worker restarted. Redo of a partly undone call could mark really undone parts as redone without redoing them. * fix(mcp): set the undo session on the thread that runs the tool call A cancelled call keeps running on the MCP thread after the async side stops waiting, so its later actions lost the session and group. * test(mcp): cancel the call after its first field instead of after a fixed wait A slow runner could cancel before the body started and fail the test. * fix(mcp): drop the endpoint changes lock A session advisory lock can leak under PgBouncer transaction pooling and then block the endpoint's later calls. Without it, a write during undo only splits the undo, and the next undos finish it. |
||
|
|
d822dd067a |
feat(agent): row comment tools, with a search shared by MCP and Kuma (#6760)
* feat(row comments): search comments across a database Add RowCommentHandler.search_comments and the shared search_row_comments tool. They return the comments on the rows of a database, newest first, each with its table and row, narrowed by table, mentioned users, authors and creation time. A user is given as an ID, part of a name, or 0 for the user the tools act as. Every search is index-driven. A mention search is one query that starts from the mentions of the given users. Any other search reads the newest comments of each table from two new indexes, (table, -created_on) and (table, user, -created_on), added with RetryableAddIndexConcurrently. Comments on trashed rows are dropped after a page is read, so the result carries has_more instead of a total. list_row_comments now also returns the user_id and the mentions of each comment. * feat(mcp): expose search_row_comments Register the comment search as a read-only MCP tool in the database_read group, next to list_row_comments, and document it. * feat(agent): let a tool type be deactivated for a workspace An Agent tool type can now tell that a workspace can't use it, through is_deactivated and raise_if_deactivated, like service and node types do. A deactivated tool stays in the Agent's available tools, marked deactivated, so the client can show it as locked. It is left out of the allowed tools, so a reply never offers it, and the configuration refuses to allow it. * feat(agent): show a deactivated tool as locked in the tool permissions A tool the workspace can't use keeps its row in the Agent's tool permissions. A lock button replaces its Allow checkbox and opens the modal the tool's presentation type returns from getDeactivatedClickModal. The presets and the counts only consider the tools the workspace can use. * feat(agent): add the row comment tools An Agent can now list the comments of a row, search the comments of a database and post comments. Premium registers the three tools and their presentation. A workspace without premium sees them locked, and the lock opens the paid features modal on row comments. The core tests that pin the Agent tool names and their presentation now cover the core tools only; premium pins its own. * feat(agent): tell the model who a private conversation is with The tools of an Agent act as its identity, so the model had no way to turn "me" into a user. The instructions of a private conversation now name the person and their user ID. A conversation started by a trigger names nobody. The name is collapsed to one short line because it is user-controlled text. * feat(assistant): let Kuma search row comments Wrap the shared search_row_comments tool for Kuma, active in every mode like the other database read tools, and add an eval case that asks for the comments mentioning the user. * fix(agent): require workspace RBAC for row comment tools in Agents and Kuma * fix(row comments): accept an empty table list and odd digits in a search An empty table_ids returned no comments while the empty lists of users meant no filter. It now searches every table like an omitted one. A reference such as "²" passed isdigit() and failed in int(); isdecimal() reads it as a name. * refactor(row comments): check the searched tables in one permission call check_multiple_permissions raises the first denial itself, so the search no longer evaluates a denied table a second time to get its error. * fix(agent): refuse a deactivated tool by default A tool type that only said it is deactivated was listed as locked but could still be allowed and called. The base check now raises when the type is deactivated, as the service and automation node types do. A type can still raise its own error, like the one for a missing licence. * fix(agent): tell an Agent only about the locked tools it was allowed Every reply in a workspace without the licence carried a note about the three row comment tools, also for an Agent that never had them or has no workspace access. The note now names the tools in the Agent's allow list that the workspace can't use, and is left out when there are none. The tool type gives the reason and the handler writes the sentence. Kuma has no allow list, so its tool group keeps the sentence naming all three. * fix(agent): honor saved tool grants and row comment search permissions * fix(assistant): end a scenario's enterprise licence with its eval case A scenario's instance-wide licence stayed for every later case of the run, and the cached licence list hid it from its own case. The case's fixtures now add it, refresh the cache and remove it when the case ends. A licence that was already there is kept. * fix(row comments): cap the page of the comment tools A search without a mention filter reads the comments up to its page in every table, and a huge page overflowed the offset. Both comment tools stop at page 100, also in Kuma. * fix(row comments): read a user reference the same way in the search and its step The step of a search showed "0" when the model sent the acting user as text. The search and the step now share one parser. The description also says a name matches everyone whose name contains it. * fix(agent): make a tool's lock a button only when it explains itself A locked tool without a modal got a button that did nothing, and every locked tool kept a disabled Ask first checkbox that screen readers announced. |
||
|
|
a63ff419a2 |
feat(agent): let agents open web pages with any model (#6766)
* 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> |
||
|
|
216d724aa3 |
Add dashboard text filter widgets (#6572)
* feat: add dashboard input filters and connected widget filtering * style(dashboard): refine filter widget layout and resize handles * fix: hide optional labels in dashboard filter settings * feat(dashboard): resolve dropdown filter values from formulas * feat(dashboard): add input and dropdown filter settings with cached options * style(dashboard): use segmented control for filter type * style(dashboard): remove separator above filter type * style(dashboard): align filter settings field spacing * feat(dashboard): support list-valued dropdown filters * feat(dashboard): add single and multiple selection controls * feat(ui): allow item cards without an icon * feat(dashboard): simplify filter target configuration * fix(ui): position floating dropdowns around their trigger * feat(dashboard): simplify widget filter condition editing * style(dashboard): streamline filter sidebar settings * style(dashboard): clarify filter action buttons and spacing * test(dashboard): align widget fixture with card rendering * chore(changelog): document dashboard filters * fix: preserve dashboard filter links across trash and restore * fix: merge pending dashboard widget saves and settle all callers * fix: match individual values in dashboard multi-select filters * style: refine dashboard clear selection button * feat: show dashboard filter cases as tabs with condition counts * fix: limit dashboard refresh waits to dependent widget saves * refactor: share the builder and dashboard item picker * style: improve the dashboard text filter illustration * feat: show inherited dashboard filters in widget refinements * test: include table schemas in dashboard source responses * fix: defer builder element availability checks until picker opens * test: use shared item picker selectors in end-to-end tests * feat: show Select actions for dashboard filter option fields * feat: choose dashboard filter defaults from available options Reuse cached options for single and multiple default selections and place the default picker below Filter values. Store multiple defaults as JSON lists while preserving existing string defaults. * fix: clear dashboard filter defaults when options change Save the new options and cleared default together so undo restores both. Ignore unchanged formula values and leave option refreshes unaffected. * fix: persist filter defaults when switching selection modes * fix: normalize dashboard filter defaults at the write boundary * fix: preserve active filter selections when switching modes * fix: remove unavailable dashboard filter defaults * fix: reconcile filter defaults when dashboard options load * fix: roll back filter selections independently of other widget saves * fix: preserve explicit filter selections during failed saves * fix: align dashboard filter input and dropdown dimensions * feat: indicate when dashboard widget results are filtered * feat: toggle dashboard filters for individual widgets * feat: confirm and reset widget filters when changing tables * fix: use source context data for dashboard filter options * refactor: resolve dashboard filter options in the frontend * refactor: organize dashboard filter providers and lifecycle hooks * test: align dashboard context schema expectations * fix: accept formula validation context in dashboard providers * refactor: share dashboard update hooks and table selection * refactor: configure nested dashboard formulas with shared field * test: use grouped table selector in button field workflows * refactor: validate dashboard runtime data through providers * refactor: share formula property extraction across dashboard and builder * refactor: delegate filter status to service types * refactor: simplify dashboard restoration hooks and request cache * perf: cache dashboard property extraction per widget * refactor: resolve dashboard runtime filters through widget hooks * refactor: rely on request transactions for dashboard source updates * perf: share dashboard widget lookups and validation per request * refactor: resolve dashboard context sources through handler * refactor: validate dispatch data through every provider * refactor: extract dashboard properties using source handler * refactor: validate dashboard source ownership when saving formulas * refactor: apply dashboard filters as additional AND groups * refactor: store dashboard widget filters in relational models * refactor: share grouped filter conversion and persistence * refactor: delegate empty summary values to aggregation types * refactor: place dashboard settings separators in data forms * refactor: defer dashboard source formula imports * fix: expose table field options for all data source types * fix: scope dashboard cache signals to dashboard models * feat: support option labels in selection filters * fix: preserve summary widget spacing in edit mode * test: preserve selection labels during filter imports * fix: harden dashboard filters on public dashboards and select label view filters * fix: keep dashboard filter imports, settings and stored links consistent * fix: accept stale multi-value selections and validate inactive dashboard filter conditions * feat: gate dashboard filter creation behind a feature flag * feat: default dashboard filter conditions to their widget value * fix: explain when the formula data explorer is empty * test: use grouped table selector for agent triggers --------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com> Co-authored-by: peter_baserow <peter@baserow.io> |
||
|
|
5169076065 |
feat: introduce User-backed workspace identities (#6556)
* feat: introduce User-backed workspace identities Replaces workspace core.Agent subjects with identities stored as Django Users, so permissions, execution and attribution use the same record. - User.objects and WorkspaceUser.objects are human-only; permission and identity code opts in through objects_and_identities. is_human and is_identity classify a user at runtime. - Login, tokens, seats, notification recipients, personal views and last-admin checks stay human-only. Roles, teams and field grants work for identities unchanged. - Agent applications run as an identity, never as a person. Every shared tool rechecks the identity's authority on each call, and MCP refuses a tool that skips that boundary. - Migrations add the profile metadata and index, remove the Agent model and delete or clear legacy Agent data: trash entries, role assignments, team memberships, integration authorizations and run-as bindings. - Rename the management API, UI, events and feature flag to identity. Squashed and rebased onto develop; the previous history is kept on backup/6556-before-develop-rebase. * refactor: remove generic subject options endpoint * refactor: simplify identity selection and Agent run-as options * feat: distinguish identity notification senders * fix: restrict identity bindings to identity managers * docs: record users and identities verification * fix: restore snapshots as the person restoring A restore checked the snapshot creator's permission and used the creator to decide whether an Agent keeps its identity binding. It now checks the person restoring, passed to the import as `restored_by`. `copied_by` stays unset on restore, so credential checks keyed on it behave as on develop. Restoring a snapshot whose creator was deleted works again. The copy rule for identity bindings covers Agent run-as only; a copied Local Baserow integration keeps its authorized subject. * fix: leave settings pages the user may not open A settings route without a permitted tab rendered an empty page, as the Identities page did with its feature flag off. It now opens the first page the user may see. * fix: renumber the legacy Agent cleanup migrations Develop added agent 0016 and integrations 0043, so the migrations that clear legacy Agent run-as bindings and integration authorizations move to agent 0017 and integrations 0044. * test(agent): run the trigger self-event test as an identity The test added on develop created a `core.Agent`, which this branch removes. It now uses an identity user as the Agent's run-as subject. * perf: load user types once per batched permission check * refactor: state the stored subjects in each subject type * fix: give every user a profile * fix: keep identity attribution on rows copied in their workspace * refactor: give people and identities their own subject type UserSubjectType stays the type both are registered and stored under. It forwards what differs to HumanSubjectType and IdentitySubjectType, so get_specific_type is the only place in subject code that inspects the user type. The registry returns the specific type on request and get_by_model keeps returning the stored type, which never reads the profile. An identity's membership is checked in one query instead of two. * fix: keep the roles of identities when a database is duplicated The role import read subjects through the model's default manager, which only returns people, so duplicating or restoring a database failed when an identity held a role on it. It now resolves the subject through the subject registry. A subject that no longer exists is skipped instead of failing the whole duplicate or restore. * refactor: look up a subject type from its content type in one place * fix: reload a cached token whose profile is incomplete A token cached by the previous release has a profile without the user type, which reads as not a person, so its requests were refused until the entry expired. The token cache now treats it as a miss, with the check the user cache already used. * refactor: check the user type once where the check was repeated The MCP endpoint loader, the personal view permission manager and the identity trash type each asked the same question several times. The rule that an identity is never selected by email moves from the team handler to the identity subject type. * refactor: leave trashed workspaces out of the identity membership manager WorkspaceUser.objects_and_identities was named after objects but also returned memberships of trashed workspaces, so callers filtered them by hand. It now follows the existing pair: it leaves trashed workspaces out, and objects_and_identities_and_trash includes them, as objects_and_trash does for people. * test: state the behaviour of every user type The table fails when a user type is added and says what has to be decided first. An unknown type is checked to be denied. * refactor: refuse to say whether a stored user subject is interactive The answer differs between a person and an identity, so reading it from the stored type would be wrong for one of them. It now raises and points to the specific type. * refactor: lock the person in membership writes instead of checking the type Leaving a workspace, removing a member and adding a user lock the user through the people manager, which refuses an identity or an unknown type in the same query. Nothing adds an identity through add_user_to_workspace, so its branch for identities goes. The last admin check compares the membership with the people who are admin, which needs no type check. * test: leave no rows behind in the legacy authorization migration test The test left an integration that pointed at a user that didn't exist and a workspace, in the database the migration tests share. Tests that ran after it then failed on the foreign key or on the workspace id. It now uses a real user and empties the two tables. * docs: describe the subject types and compare the Subject table alternative ADR 013 is shorter and states that people and identities each have a specific subject type under the stored auth.User type. It compares shared User storage with a Subject table that users and identities would both point to. * chore: run the legacy run-as cleanup after the agent actions migration Develop added agent migration 0017, so the cleanup becomes 0018 and depends on it. * test: leave no rows behind in the legacy agent migration tests Like the legacy authorization test, these left a workspace in the database the migration tests share, which a later test that creates workspaces with fixed ids collides with. * fix: write and read the workspace role of an identity in one place The role assignment API wrote the role of an identity through the membership update of people, which told every member of the workspace about it and stored Builder as MEMBER, while the identities API stored BUILDER and returned the stored value. Both now write through the identity handler, which stores the role like the role of a person, and the role is read with the resolver the workspace members use. * fix: take no row lock in the membership writes of a person Leaving a workspace locked the user before the membership while removing or updating a member locks the membership first, so the two could deadlock. The user type never changes and these operations refuse an identity, so the lock protected nothing: they now only check that the user is a person. Leaving no longer locks the admin memberships and removing a member no longer checks for the last admin, as before identities. * fix: find an identity by its name only in the subject options The search also matched the email and username, which for an identity hold an internal key, so searching a part of that key returned every identity. * chore: run the identity migrations after the new ones on develop Develop added core 0138, integrations 0044 and enterprise 0073, so the identity migrations become core 0139 and 0140, integrations 0045 and enterprise 0074 and depend on them. * fix: keep the identity of a copied integration only for identity managers A duplicated application or a restored snapshot kept the identity its Local Baserow integration acts as, without checking the person who made the copy. Restoring a snapshot could so bring back a binding an admin had removed. The copy now keeps the identity only when that person may bind identities, as the Agent application already did, and is otherwise authorized as that person. * docs: follow the renumbered migrations and the copy rule in the test plan The test plan named the identity migrations and their tests by their old numbers and still said a copied integration keeps its subject. * test(agent): run the row trigger tests as an identity The row trigger tests added on develop created a `core.Agent`, which this branch removes. They now use an identity user as the Agent's run-as subject, and the e2e fixture creates it through the identities endpoint. |
||
|
|
12389f071c |
docs(mcp): align MCP docs with baserow-mcp 1.0.0 (#6754)
* docs(mcp): align MCP docs with baserow-mcp 1.0.0 Point tool changes at Edit tools under My settings > MCP server, list the six skills, add delete_element_items to the test plan, correct the BASEROW_OSS_ONLY builder notes and update the steps for adding a tool. * docs(mcp): say clients keep their tool list until they ask again * docs(mcp): fix test plan steps that fail as written Testers ticked the wrong tool, kept a stale tool list and had a wrong minimum version, so correct scenarios looked like bugs. |
||
|
|
5a6121b5a3 |
feat(agent): let agents send HTTP requests through configured actions (#6735)
* feat(agent): let agents send HTTP requests through configured actions An agent can now call an outside API with a configured HTTP request action. The model fills the inputs bound to the request, sees the API's answer, and fixed header, query and form values stay hidden in the approval preview. * fix(agent): hide and keep back what an HTTP action's approver doesn't read Values the builder fixed stay out of the preview and the paused run and are resolved again on approval, keyed by row position so an undone edit keeps a held call working. Malformed or oversized requests and other hosts are refused first. * fix(agent): keep an HTTP action's call on its host and bound what it returns A redirect elsewhere would carry fixed headers and the body past the approver, so agent calls only follow redirects on the same host. Also hide a URL's user, count row keys in the size limit, and measure the body the model reads. * fix(agent): show an HTTP action's inputs to the approver and refuse calls it can't send Review round 2: the approver reads every input the model chose but not a fixed URL path, and calls that can only fail are refused before they wait. |
||
|
|
b587de3dba |
feat(agent): configure per-user active-run limits (#6458)
* 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. |
||
|
|
26ff58a3d9 |
feat(agent): let agents send emails through configured actions (#6720)
* 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
|
||
|
|
4dcceef1d6 | chore: require Node.js 24.15 or later and switch the shared IDE test configs from Jest to Vitest (#6676) | ||
|
|
8fe54ed4da |
feat(mcp): plugin-first setup and one-click installs on the MCP settings page (#6386)
* 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. |
||
|
|
90fcd746ac |
refactor(builder): move the builder tools from enterprise to contrib/builder (#6660)
* refactor(builder): move the builder tools from enterprise to contrib/builder Only login needs enterprise code, so setup_user_source and its helpers stay there and the other builder tools work without a paid edition. * test(builder): keep the guards on the builder tools left in enterprise The enterprise tests block model calls and assistant imports again, and the backend tests pass without enterprise. * fix(builder): say an auth_form needs an instance that has it On an instance without enterprise, the refusal no longer claims the whole batch was undone. * test(builder): run the missing element check without enterprise |
||
|
|
18ae3c06cb |
feat(agent): ask before running tools (#6602)
* feat(agent): retain reply execution details * feat(agent): hold Ask first tool calls for the owner's approval * feat(agent): approve or reject held tool calls in the chat * fix(agent): tell the model that Ask first calls wait for the user * refactor(agent): run the approval action through the action registry * fix(agent): preserve approval state across reply transitions Mark held calls waiting immediately and keep retry slots across durable pauses. Keep stale history and run snapshots from undoing newer decisions. Contain rejection dialog focus and localize its waiting announcement. Add focused transition regressions and update the tool presentation contract. Align approval fixtures with the parent conversation cursor contract. Validation: 469 backend passed (one known xfail), 362 frontend passed; query-growth, migration drift, lint and browser component checks passed. * feat(agent): show partial results of approved calls in the approval card * test(agent): cover web searches next to held tool calls * fix(agent): drop retry slots, every tool call has its own card A paused reply no longer saves which failed steps the next response may continue. Transcripts drop text PostgreSQL can't store, like steps do. * feat(agent): show a held call's named request while it waits A held call is named as the Agent identity when it is held and sends the request to its step like a running call, so the owner decides on names. What can't be named keeps its ID; the call still waits. * feat(agent): title held changes with their table * fix(agent): end held calls by the owner's decision A held call that a reply ends without resuming is rejected when the owner rejected it, stopped when they approved it, since the resume may have run it, and failed when undecided. Copies end held calls at export, where the decisions are known. Rejected calls stay out of the interruption note. * fix(agent): resume a paused reply as the run that paused The transcript keeps whether the paused run offered web search and the identity it acted as. A resume offers search only if the paused run did, so a provider that refused it doesn't fail the reply after the approved change ran. It runs approved calls only as the identity they were held under; when the Agent no longer acts as it, they fail with a permission error. Every resume tells the model that users approve these calls. * chore(agent): clean up after the tool approval review Drop the unreachable ChatRunAlreadyActive from the decide path, its API schema and tests, and test the refused resume against the real run limit. Remove the import branch for exports without ask_first_tools and the toolInputText indirection, and add the decision audit strings to the agent catalog. * fix(agent): end held calls that never ran as not run A held call that a reply ends without running now fails with `not_run`: undecided, or approved when the resume never started (not ready, cancelled before it started). Only a resume that started stops its approved calls, since it may have run them; `mark_reply_interrupted` now passes an empty result, so `None` again means the run never started. The interruption note leaves `not_run` calls out, like rejected ones, and the card says "It didn't run." * fix(agent): keep the IDs of what a held request can't name A table, database or view the Agent identity can't see no longer empties the whole request preview: it keeps its ID, like fields and rows already did. Values of rows for a table that can't be named are all masked, since its password fields are unknown. An approval for an unknown table now shows `table_id` and the requested rows instead of nothing. * fix(agent): tell the model why an approved call lost its identity When the Agent no longer acts as the identity a call was held under, the approved call is denied with a note saying so, and that tools are unavailable for the rest of the reply, instead of "This tool is no longer allowed." * fix(agent): hold no change after a call with invalid arguments pydantic-ai validates every call of a response before running any, and reports invalid ones with `args_valid=False`. An ask first call that fails validation is retried, never held, so it no longer holds the changes after it: a change set to run without asking now runs. * fix(agent): leave reply transcripts out of copies Duplicates and snapshots no longer copy each reply's model messages and usage. They hold every tool result, nothing reads them, and the export loaded all of them at once. A copied reply can't resume anyway. * feat(agent): title unfinished calls by their request A call that isn't running or done is titled by what it asked for, so an approved call that fails keeps "Update 1 row in Accounts". An approved card item shows any outcome other than success next to the decision, now failed too. Held reads keep their request and are titled with their table. |
||
|
|
ad7c61db45 |
fix(mcp): follow-up fixes for the application builder tools (#6650)
* perf(automation): leave replaced published copies to the hourly cleanup
clear_old_history already removes them and keeps the newest copy, so the extra task isn't needed. Its delete now batches the service deletes.
* fix(mcp): keep dashboard creation on connections that allowed create_dashboards
The tool is now create_dashboard and unregistered names are ignored, so stored grants lost it.
* docs(mcp): list pause_workflow and move_elements as destructive
* fix(mcp): log the integration create_automation adds
It was created without its action type, so the audit log missed it.
* test(assistant): expect the integration action when redoing a new automation
* fix(mcp): check the workflow copy that publish_workflow makes live
A service-only node edit during the publication still went live unchecked. The checks now run on the copy in the same transaction, and come from the node types.
* test(assistant): tighten Kuma eval checks and add unquoted ask case
Search check judges only the sentence naming Sales and Invoices; two cases
also check nothing else changed; core cases share one database scenario.
* docs: run the shared tool tests in the assistant test plan
* chore: add changelog entries for the MCP builder tools and redo fix
* fix(mcp): check {{ }} templates in linear time
* fix(mcp): report the client's value in formula_errors
Kuma's repair step reads the description instead. The invalid-formula
warning uses loguru and no longer names the assistant.
* fix(builder): refuse a user property the user data provider doesn't have
* fix(assistant): route Kuma's mapping, move and style tools through the shared tools
Kuma now refuses mappings the page can't read and makes its moves in one
transaction, like MCP.
* fix(mcp): title list_applications 'List databases'
It lists only databases. The old list_databases becomes 'List all databases'
so the two stay apart at consent.
* feat(mcp): name the builder action tools element actions
list_element_actions, create_element_actions and update_element_action, so
they read apart from automation actions before grants store them. MCP drops
add_action_field_mapping; Kuma keeps it and its own tool names.
* fix(assistant): name the right update tool for an application of another type
* fix(mcp): keep create_database out of the shared create_tables description
The Agent Builder offers create_tables but not create_database; Kuma's own
description still names it.
* fix(builder): validate page paths in the handler and create pages with visibility in one action
* fix(builder): refuse row action mappings on read-only fields
* fix(builder): bound page, user source, menu item and column names in tool input
* fix(builder): keep an explicit column formula over a field of the same name
* perf(builder): reuse the loaded page when listing elements
* perf(builder): reload page graphs only after a failed move
* feat(builder): allow get_row data sources without a row id in the tools
* refactor(builder): update builders through the shared update_application helper
* perf(builder): list a page's data sources with the service in one call
* fix(builder): record tool-created integrations and login pages in the audit log
* docs(mcp): say setup_user_source can create a users table or a password field
* feat(mcp): move builder item deletes into a builder_delete group
* feat(builder): list links and actions a page parameter change breaks, and let update_element fix a link
* test(mcp): expect delete_element_items in the annotation list
* chore: update English backend translation catalogs
* feat(assistant): use the element action tool names in Kuma too
Kuma lists every mode's tools by name and switches mode on a call, so create_actions next to the automation node tools could route an automation request into the builder.
* chore: drop the MCP builder tools feature changelog entry
The MCP feature entry is added once the milestone is done.
* fix(automation): keep the draft dirty when a publication rolls back
Refuse an empty draft before copying it, and warn about a delete row node with no row ID.
* fix(mcp): keep the integration create_automation adds out of undo
Undo could trash it under the nodes that use it; the builder tools already do this.
* fix(builder): list table link columns a page change breaks and fix the link hint
* fix(assistant): keep Kuma's style and move tools to the page they name
* fix(mcp): shorten the setup_user_source title so consent shows it whole
* fix(mcp): keep tool changes made while the create_dashboard rename runs
One UPDATE rewrites each allow list from the row it locks, so a revoked tool
isn't restored from a stale read.
* fix(automation): keep the draft's dirty flag when a workflow is published
The flag tracks the test clone, which publishing doesn't replace, so a draft
edit made during a publication was lost and the next test run reused a stale clone.
* fix(builder): write page parameter formulas by name after a concurrent edit
The formula step runs in its own transaction, so an editor can reorder or
retarget the parameters in between. Match each formula by name, and refuse
when the link or action now opens another page.
* fix(builder): list menu items whose page parameters no longer fit
A menu item made in the editor can give page parameters, so a page that drops
them still breaks it. Compare its parameters always, and point to the editor.
* fix(assistant): judge the search-finds-table eval on claims, not wording
Negation is scoped to the clause naming the table, lists under a Sales heading
count, and an answer that also says Invoices is missing fails.
|
||
|
|
058bca8274 |
feat(agent): show readable requests for the database tools (#6651)
* feat(agent): name a tool request as the Agent before the call runs Before a change tool runs, its request is resolved into names with the Agent's permissions. If a name can't be resolved, the call fails and nothing runs. Values of password fields are masked, and lists are cut to 10 items of 10 keys. * feat(agent): show readable requests for the database tools Change tools show the tables, fields, views and rows they work on by name, rows by their primary value. Card titles use the requested table. * fix(agent): let the tool, not the preview, decide whether a call runs Fields, rows and tables the Agent identity can't name keep their IDs in the readable request, and a preview that can't be built is left out, so delete_fields and update_fields fail per item again and a table without a primary field can still be changed. * fix(agent): never show an oversized request as an empty list A request whose single item can't be stored keeps its names without the list. Row deletions no longer dedupe IDs, which the row handler rejects anyway. * fix(agent): show a call's readable request while it runs The tool sends its named request to the running step through a pydantic-ai custom event before it changes anything, so a stopped call or one whose worker died still shows what it asked for. |
||
|
|
68f8fed4c2 |
feat(agent): show tool inputs and why tool calls failed (#6631)
* feat(agent): show tool inputs and name known targets of failed calls Moved out of the tool activity layer so the approvals layer can decide how long input values are kept. * refactor(agent): drop duplicate checks on step resources and input previews * refactor(agent): drop failed-call targets and row input previews Failed calls show only the error, the input preview is a single size check on the stored JSON, and row writes keep no preview because their values can include passwords. Both are tracked in #6626. * feat(tools): report database tool errors in one format Every error has a code, a message written for people and an optional hint for the model. Batch tools list failed items in errors, set changed, and set error only when nothing was changed. MCP gets the hint after the message. * fix(assistant): read the shared tools' new error format Formula repair finds invalid formulas by code and rechecks the outcome after repairing. A repair that fails for another reason reports the real cause. Hints reach Kuma as next steps. * feat(agent): keep only tool calls that did something A failed call shows the reason, a call that changed nothing is skipped, a partly done call lists what failed, and a retry of a failed call continues its card. * feat(agent): show failure reasons and partial results in tool cards * style(mcp): format the server test * fix(tools): log unexpected errors and keep their text out of messages Built-in errors are unexpected again: logged, with the generic message. Tools raise ToolInputError with a message for people and a hint for the model where they mean a user error, including linking to a table in another database. create_views no longer turns any exception into a message. * fix(agent): give every tool call its own card A result ends only its own call's card: no retry continues an earlier card. Step text, reply text and streamed text are cleaned of characters PostgreSQL can't store. The partial status is visible. |
||
|
|
be71e3bce6 |
feat(mcp): add application builder tools and one create and update tool per application type (#6606)
* refactor(mcp): share the tool error messages
The row comment, row colour and audit log tools need licence errors to reach the client, and the item error helper outside automation.
* fix(assistant): show shared tool errors to Kuma
A licence or input error from a shared tool ended the chat run instead of reaching the model.
* feat(mcp): search the workspace
Lets MCP clients and Kuma find a table or row by name without walking every database.
* feat(mcp): read and post row comments
Lets MCP clients and Kuma read what people said about a row and add to it, in plain text.
* feat(mcp): change view sorts, field visibility and row colours
Lets MCP clients and Kuma configure views, and delete views and filters. list_views now returns the ids those tools take.
* feat(mcp): read the workspace audit log
Lets MCP clients and Kuma answer who did what in a workspace. It stays off until a user turns it on, even though it only reads.
* refactor(assistant): move the builder tool types out of the assistant
The builder tools need these types and helpers without pydantic_ai
or the assistant, so MCP can share them with Kuma.
* feat(assistant): make Kuma's builder writes undoable
Kuma's page, data source, workflow action and user source writes now appear in undo and the action log.
* fix(assistant): set up a new login page after undoing the old one
Undo trashes the login page but the builder still points at it, so setup skipped creating one.
* fix(mcp): run the field visibility change in a transaction
Over MCP and Kuma it failed on select_for_update, as they call tools outside a transaction.
* feat(mcp): add the application builder tool groups
Builder tools need their own groups and picker labels so users can switch them on separately.
* feat(mcp): offer the application builder read tools
Clients other than Kuma can inspect builders, pages, data sources, elements and actions.
* test(mcp): keep the no model calls check to the shared builder tests
Under a rootdir that excludes the enterprise tests, pytest applied the autouse patch of Agent to every test.
* test(mcp): prove the no model calls check runs and restore Kuma's not found hints
The folder check now resolves paths, and Kuma's list tools explain a missing builder or page again.
* feat(mcp): offer creating and updating builders and pages
Clients with builder_edit can set up an application builder and its pages. Kuma's
page tools now run the same create and update code, and keep their own results.
* feat(mcp): offer creating and updating builder data sources
The formula step that needs no model moves to the shared code, so MCP stores given
formulas and reports the rest. Kuma runs it, then repairs what is left with its model.
* fix(mcp): check builder formulas against values of the right type
Example values of the wrong type refused valid formulas, and over MCP no model can
fix that. Failures after a batch committed are now reported with their item.
* fix(mcp): check builder formulas without evaluating them
Example values can't stand in for every field type, so they refused valid formulas.
The check now looks at the formula's functions and paths against what the page has.
* fix(mcp): check nested builder formulas in linear time
Each nested get was visited twice, so a short formula could stall a request thread.
* feat(mcp): offer the application builder element tools
MCP clients can build page content without a model. Kuma runs the same create and
update code and repairs what it leaves.
* fix(mcp): store the values the element create tools are given
A default value or link URL was dropped with nothing reported; a negative size gave an internal error.
Column-name-wins is now opt-in, and update_element is marked destructive.
* fix(mcp): only take row colours a row can show
A row takes its colour from a CSS class per palette name, so a hex value reported success and coloured nothing.
* fix(mcp): undo a row colour that fails halfway
The tool adds to a view's colours, so a client retrying after an error would end up with a second colour.
* fix(mcp): show how a view's filters combine
A view matching any filter, or one with filter groups, read as one matching all of them.
* fix(mcp): mark set_view_sorts as overwriting
It replaces a view's sorts and an empty list removes them, so clients should confirm it.
* fix(mcp): read comments with a mention without a label
The API accepts such a mention, and one of them made every comment of the row unreadable.
* fix(mcp): refuse a blank workspace search
The API trims the query too, and a space would match most names.
* docs(mcp): say why reordered sorts are recreated
* test(mcp): expect how filters combine in the listed views
* feat(mcp): offer the application builder action, setup and theme tools
MCP clients can now wire up workflow actions, build a page in one call, add logins and set a theme.
Kuma's tools call the same functions and keep their results, repairing formulas after each phase.
* fix(mcp): handle bad input to the audit log tools
A reversed range and a blank query read as nothing having happened, and an unknown browser timezone ended Kuma's run.
* fix(mcp): read comments with no content
The API accepts such a comment, and one of them made every comment on the page unreadable.
* fix(mcp): show when a view's filters are switched off
Those filters hide no rows, so listing them as active misled the client.
* docs(mcp): correct what the view tools say they do
Row colours work on every view with rows, and Kuma was told to skip list_views when it needs the filters and colours.
* fix(mcp): leave IP addresses out of the audit log tools
Who did what doesn't need them, and Kuma sends tool results to the LLM provider.
* feat(mcp): add update_action and fix the builder action review findings
A refused notification or open_page value had no way to be corrected over MCP.
A shared page action could name a data source only one page has, which fails on click.
* fix(mcp): let clients read back action values and check open_page parameters
update_action could silently drop page parameters it couldn't show, and store ones the target page lacks.
Reads now give the values in the form update_action takes.
* fix(mcp): keep function-call values as formulas when update_action gets them back
A value list_actions shows like upper('abc') was written back as fixed text.
A custom-URL action no longer fails the page parameter check.
* feat(mcp): offer one create and one update tool per application type
A client asking for one application type should only get that type, and an
edit group should not reach the other types.
* fix(mcp): connect new automations to the workspace data
Row actions fail at run time without a Local Baserow integration, and Kuma's
old hook used to add it.
* fix: redo restores an automation after undoing its creation
An automation is trashed under its own type, so restoring it as an application failed and rolled back the whole undo group.
Undoing a delete and redoing a duplicate or template install had the same problem.
* feat(mcp): offer publishing a workflow
MCP clients could build a workflow but not make it run.
The list reported the draft copy, so a published workflow looked like a draft.
* fix(mcp): refuse publishing a workflow that can't do anything
An MCP client has no UI to stop it, and the workflow came back as live.
Clients also skipped confirmation for a tool that starts real effects.
* feat(mcp): offer pausing a workflow
A client could start a workflow over MCP but had no way to stop it.
* perf: delete older published workflow copies in the background
The delete took over 90% of a republish, in the transaction and on the thread
shared by MCP calls and websocket DB work.
* fix: keep the newest published copy of a paused workflow
The cleanup only kept live copies, so a paused or disabled workflow lost its copy and reported the wrong state.
pause_workflow no longer needs a local cache scope: the update reads the published copy uncached.
* perf: delete superseded copies on the export queue
Deferring the service deletes takes a 200 node copy from 22s to 1.2s.
A 60s countdown keeps the delete away from a row event still reading the just-disabled copy.
* fix(mcp): tighten application tool names, lookups and checks
Blank names, hidden applications and the unclear-request eval check slipped past the new application tools.
* test(mcp): cover builder tool schemas and the read only preset
Keeps Kuma-only parameters off MCP and shows the preset can't write.
* test: add a Kuma eval for a bare request to create an application
A request like this should make an application builder, not a database.
* docs: list the builder and application MCP tools and their test steps
Adds groups, defaults and destructive flags, the new tools, and the manual create-an-application test.
* test: drop tests another test covers and tighten the weak ones
Each dropped test had a covering test that asserts the same behaviour.
The routing test no longer hides a redirect behind a second call.
* test: add Kuma evals for dashboards, several applications, renames and action edits
Nothing called create_dashboard, update_* or update_action in the last eval run.
* fix: let Kuma create an application that has a purpose without asking for a name
Evals asked only for the name, and create_builder had lost the rule against inventing app records.
The setup_user_source description now says it reuses an existing source.
* docs: say MCP writes can't be undone where the action layer is described
The line said operations are undoable, which the builder section contradicts.
* fix: say an application, app or website means an application builder
Kuma and MCP clients could pick a database or dashboard tool for a plain request for an app.
* fix(mcp): refuse a builder formula that reads a row field by its name
A published page only loads fields its formulas name as field_<id>, so such a value
was stored with no report and rendered empty there. Kuma's repair now rewrites it.
* fix(mcp): point a button's click message to its notification action
A model asked to change the message a button shows rewrote the button's text and saw
only success. Descriptions say where that message lives, and the result names it.
* fix: ask first on a bare app request even though an app means a builder
"Application means builder" and "for my team" read as enough to create Team App.
The wording now says it only picks the tool, and who an app is for isn't a purpose.
* fix: show update_action's required thought in an example
On notification title edits the model left thought out and Groq rejected the call,
so the edit took two or three tries.
* fix(mcp): check what new and changed table columns read
A by-name column was stored and came back empty on the published page, with no signal to the client.
* fix(mcp): read a form element's default value from the row around it
At run time a record selector's default value reads the enclosing repeat, not its own rows.
* fix(mcp): refuse a user source table whose fields can't be used
A text field named Password made adding the password field an internal error, and a refused setup left an integration behind.
* fix(mcp): keep the given order of children in a container
Core puts each new child first, so one call's children came out reversed on both clients.
* fix(mcp): accept a file field's thumbnails in a formula
They are valid at run time, but the file field's schema leaves them out.
* fix(mcp): check a new row action's field values like an update does
A value like nosuchfn('x') was stored unchecked and failed only when the page ran.
* chore: remove the table button action hook that never created anything
It always returned no actions, so its result handling and the empty TYPE_CHECKING block were dead too.
* fix(mcp): mark update_action as destructive
Moving an action to another table clears its field values, so clients should ask first.
* docs: correct the builder tool descriptions and docs for MCP
They promised undo MCP doesn't have, named an unset setting, and left out the button note.
* fix(mcp): store plain field values on a new row action as fixed text
Only text that is or parses as a formula goes through the check; Alice no longer comes back empty.
* fix(mcp): list a page's elements in page order
A move showed in the page but not in the list. A move before a child of another place is refused.
* fix: point formula fields to the tool description
The field text claimed a $formula: prefix that MCP does not repair.
* fix(mcp): describe a field value so it is true on create and update
update_action refuses plain text with the same schema create_actions uses.
* fix(mcp): treat an empty place_in_container as unset when moving before a child
The move schema treats an empty place as unset, but this check refused it.
* fix(mcp): refuse an open_page action missing its page parameters
A new action without them stored a button that couldn't open its row and reported success; update_action already refused this.
* fix(mcp): create a child before the element given in its container
before_element_id was ignored once a parent was given, so the element went last.
* fix(mcp): move into a column's first place when none is given
The field says none means the default slot and create does this, but the move failed.
* fix(mcp): refuse moving an empty container into itself
The check for an element already last caught this case, so the move reported success.
* fix(mcp): make a valid example email for a role with spaces
A role name with a space or symbol made the example row fail, and with it the whole setup.
* fix(mcp): refuse a row_id on a data source that is neither a number nor a formula
Plain text was stored as a literal row id with no report, and on update it replaced a working value.
* fix(mcp): read a whole function call as a formula on a new action too
create_actions stored upper('abc') as text while update_action read it as a formula.
* fix(mcp): show a client the shared page's data sources and its ID
A header can only read a shared page data source, and a client couldn't list one or find where to create it.
* fix(mcp): let create_display_elements give a link's page parameters
Over MCP only setup_page could give them, so a link to a page with a path parameter was left broken.
* fix(mcp): refuse a link's new page when its parameters don't fit
update_element kept the old page's parameters, leaving a link that breaks when clicked.
* fix(mcp): say what a client can do when a link's new page doesn't fit
The refusal said to replace the link, but no tool deletes a builder element.
* fix(mcp): give a login page that's already set a working form
setup_user_source reported success on a set login page with no usable form, or one only logged-in visitors can see, and nobody could log in.
* fix(mcp): keep a sentence with a parenthesis as plain text
Order now (today only) was stored empty over MCP, against the docs saying plain text is fixed text.
Builder values now use the automation pattern, which keeps a whole spaced call like get ('x') as a formula.
* fix(mcp): refuse a new link whose parameters don't fit its page
The frontend hides such a link at run time. open_page and link updates already refuse it.
* fix(mcp): keep a fixed value that parses as a sum as plain text
A field value of 3/4 was stored as a formula showing 0.75, and a link parameter of 10/2 as 5.
Field values and link parameters now follow the title rule: calls and plain numbers or booleans only.
* fix(mcp): check every changed column when two share a name
Keyed by name, a bad formula on the first of two columns named Edit was stored unchecked.
* fix(mcp): list a column's children in the order the page shows them
Places were walked in insertion order, so a child added to the second column first was listed first.
* fix(mcp): refuse page parameters with a repeated name
The frontend compares the name lists exactly and hides the link or button if a name is there twice.
* fix(mcp): share the lookup that hides an application the user can't see
The same wrapper was copied in the four application types' tools.
* fix(mcp): remove a dead refresh action helper and a repeated form element block
The refresh helper's value was always overwritten, and four form elements built their label and default value the same way.
* fix(mcp): refuse form data on items of the shared page
At run time a shared element reads the form data of the page being shown, so a
header form's value is empty and its element or action counts as in error.
* fix(mcp): store an auth form's login button label as text
The frontend can't parse 'Sign in' as a formula, so visitors saw the default label
instead. Export and duplicate keep the value either way.
* fix(mcp): store page parameters in the order of the page they open
The frontend compares the names with _.isEqual, so a complete list in another order
hides the link or button from visitors.
* fix(mcp): make a link go to the page or URL an update gives it
Without a navigation type the stored one stayed, so visitors still went to the old
target.
* fix(mcp): refuse a menu item that links to a page with path parameters
Menu items have no parameter field, and one missing its parameters puts the whole
menu in error, which hides it from visitors.
* fix(mcp): refuse a row id on a data source that has none
A list_rows source dropped it and reported success. A get_row source does have a
search query, so that stays.
* fix(mcp): refuse a move before an element outside the given parent
It moved to the end and reported success. No Kuma prompt, eval or test depends on it:
on the base a parent made before_id ignored either way.
* fix(mcp): refuse a new field mapping on a trashed field
The mapping would be stored against a field no visitor's row can get. A mapping the
action already has on a trashed field can still be changed.
* fix(mcp): say when the login page's form uses another user source
The result reported success while people in the new table couldn't log in. A page at
/login found with no login page set now keeps its one form too, instead of a second.
* fix(mcp): mark the builder tools that overwrite stored values destructive
update_nodes, update_fields and update_widgets do. Clients only ask first when the hint
is set.
* fix(mcp): refuse element values the REST API refuses
level=99, format='html' and column_amount=500 reached the database with no error, and
rows=-1 gave "Internal error.". The limits are the serializers' and models'.
* chore(mcp): format the review fixes
* fix(mcp): keep what a restricted view hides out of the view tools
A member below builder could read a restricted view's filters, hidden sorts and colours from list_views, and a field's name from an error before permissions were checked.
* fix(mcp): replace a view's sorts one call at a time
Two calls could each read the old sorts and add to them, leaving a list neither asked for.
* fix(mcp): read a mention whose label isn't a string
The API accepts such a label, and one comment holding it stopped the row's comments from being listed.
* fix(mcp): limit the row comments of a call to 100
Each comment runs about nine queries in its own transaction, and a commenter could ask for any number.
* fix(mcp): show Kuma that set_field_visibility needs a field
Both clients now reject an empty list from the schema, so the checks after it can't run.
* docs(mcp): correct the audit log tools' licence and fields
An advanced licence also has the audit log, and entries no longer hold an IP address.
* test(mcp): run the missing formula case on a data source with a row id
A list_rows source now refuses a row id before any formula is generated.
* test(mcp): expect the builder tools that overwrite values to be destructive
* refactor(mcp): rename set_row_colours to add_row_colours
It adds to the colours a view has, while set_view_sorts replaces the sorts.
* fix(mcp): add a login form for the new user source beside another's
People in the new table can log in once the call succeeds, whichever way the login page
was found. This replaces the note and restores the two forms Kuma's test expects.
* fix(mcp): leave a refused field value out of a new row action
The empty placeholder was a live mapping, so each click wrote an empty string
over that field of a real row until someone fixed the formula.
* fix(mcp): refuse a header's pages that can't work
share_type 'only' with no pages hides a header on every page, and page_ids with
no share_type were ignored. An update has no page_ids, so it can only refuse.
* fix(mcp): refuse changing an action on a trashed page
The lookup only checked the application, so an action on a page in the trash
could still be changed.
* fix(mcp): keep a zero column gap and page size on a new element
0 is allowed, as on REST, but was replaced by the default of 20.
* fix(mcp): treat a whole function call on an element as a formula
A formula like upper('abc') read from list_elements and sent back was stored as
text, so the page showed the formula itself. Actions already follow this rule.
Also replaces the placeholder expression repeated on each element value.
* fix(mcp): share the parameter model and the stored formula reader
Two identical parameter models and three readers of a stored formula's text.
* chore(mcp): format the round's review fixes
* fix(mcp): refuse a page size of zero on tables and repeats
A page size of 0 fetches no rows and shows an empty element; the editor's
minimum is 1.
* fix(mcp): warn on publish about a row_id stored as an empty literal
update_nodes stores row_id='' as '', which the check for a missing row_id
didn't count as empty.
* fix(mcp): keep a field value's formula when its field id has spaces
The formula was stored under the stripped id and looked up under the raw one, so
' 12' lost its value with no report.
* fix: leave test clones out of the superseded copies task
A test run can pick up an older clone just before this task deletes it, so writing
its history entry fails. clear_old_history removes unused clones.
* fix(mcp): refuse style values the element columns can't hold
An overlong color or a radius or size past the column's limit gave "Internal
error.", and a negative radius, which the editor refuses, was stored.
* fix(mcp): treat a whole function call in search_query as a formula
upper('abc') from list_data_sources was stored as text when sent back, as elements
were. The create docstring also said plain text was left empty, which it isn't.
* fix(mcp): mark the application update tools destructive
update_table only renames and is marked destructive, as is update_page; these
overwrite a stored name too. update_builder also changes the login page.
* chore(mcp): format the round's review fixes
* fix(mcp): stop set_view_sorts deadlocking with a new sort
A new sort checks its view when it commits, which the view lock blocked while
the sort rows it needed were held. Sort writers now share a weaker view lock.
* fix(mcp): title add_row_colours Add row colours
* refactor(mcp): merge search_audit_log into list_audit_log
The two differed only by a text query and a 90 day cap. Timestamps now need an
offset, as nothing tells MCP the user's timezone.
* feat(mcp): let a date filter carry its timezone
MCP has no timezone for the user, so relative date modes would follow UTC. An
offset can't express those, so the caller names the IANA timezone.
* test(assistant): expect the login page to stay after undo
Develop creates the login page without an action, so undo no longer trashes it.
* fix(mcp): say a licence is missing when a tool needs one
The REST message reads like a permission problem, which sends users to the wrong fix.
* test(mcp): cover the licence message of the tool errors
* fix(mcp): mark tools that reach outside the workspace as open world (#6609)
ChatGPT's scan refused to publish create_views because it reported
openWorldHint false while public views, emails and redirects reach outside.
* fix(builder): refuse a reused user source without password login
A login form for it could never sign anyone in, yet the setup reported success.
* fix(automation): check a workflow under the lock that publishes it
A node deleted between the checks and the publication went live unchecked.
* fix(builder): cap how many items one builder tool call takes
A caller could ask for any number of elements or nested items in one call.
* test(assistant): fail evals that only look like they passed
A wrong dashboard name, a denied table search and a form mapping both fields to one input passed.
* fix(mcp): mark pausing a workflow and moving elements as destructive
Neither only adds: a pause drops events and a move changes existing placement.
* refactor(builder): read tables without the database MCP module
The shared builder layer shouldn't depend on one client's adapter.
* test(assistant): add an eval that changes a row action's mapping
update_action had no eval for the branch that writes rows.
* test(mcp): expect moving elements to be destructive
|
||
|
|
d59e412bf3 |
feat(agent): add native web search (#6628)
* feat(agent): add native web search setting Agents can answer from current web pages using the search built into their model provider. Off by default because searches cost money and can leak data when combined with workspace tools. * fix(agent): stop retrying searches once a reply reaches its limit Newer Claude models report the limit only inside their filtering code, so they kept retrying for minutes with nothing on screen. * fix(agent): let Anthropic enforce the reply's search cap Searches run from filtering code escape max_uses and continuations reuse the tool, and Anthropic already counts earlier requests of the reply, so plain search with a fixed cap is the only one it enforces. * fix(agent): show when a reply could not search instead of having the model say so A 400 doesn't prove the model can't search, and an SDK that excludes search would fail the whole reply. * refactor(agent): match step events by pattern * feat(agent): mark web search as unavailable beside its switch A saved setting the chosen model can't use looked on until you read the text under it. |
||
|
|
eec8247c0a |
feat(agent): show tool activity in conversations (#6551)
* feat(agent): show tool activity in conversations * refactor(agent): centralize tool step statuses * fix(agent): keep tool-step diagnostics free of private data * fix(agent): retain Sentry details for tool errors * feat(agent): show tool inputs and failed read attempts * fix(agent): show individual tool outcomes in activity groups * feat(agent): explain tool failures in translated tooltips * feat(agent): name known targets in failed tool calls * fix(agent): use shared tool errors after rebase * fix(agent): show interrupted changes, announce tool steps and clear pre-tool text * refactor(agent): move input previews and failed-call targets out of tool steps * refactor(agent): log tool-step failures without the Sentry helper * fix(agent): classify tool errors once and drop partial-failure steps Calls to tools a reply never offered no longer get a step. * refactor(agent): key tool presenters by tool name and drop unused step data Drops presentation_type, the unused card icon, copy-time step cleanup and Kuma-visible chat CSS changes, and defers steps when loading reply history. * test(agent): cover Stop during a change and merge overlapping step tests * docs(agent): trim tool presentation guide to the step contract * fix(agent): keep step facts JSON-safe and polish stopped cards Restores the JSON check on step facts, keeps a stopped change's title readable at narrow widths, raises its warning contrast, and stops reopening a running reply from re-announcing its old steps. * fix(agent): cap the Agent chat column at 900px * fix(agent): name the executing tool call and keep step cards stable while text streams Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(agent): name reused tables and views instead of showing zero created Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(agent): tell the model which changes an interrupted reply started Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(agent): continue a retried tool call on the step of its invalid attempt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(agent): report views skipped by name collisions --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4654019e22 |
feat(mcp): add search, row comment, view config and audit log tools (#6593)
* refactor(mcp): share the tool error messages The row comment, row colour and audit log tools need licence errors to reach the client, and the item error helper outside automation. * fix(assistant): show shared tool errors to Kuma A licence or input error from a shared tool ended the chat run instead of reaching the model. * feat(mcp): search the workspace Lets MCP clients and Kuma find a table or row by name without walking every database. * feat(mcp): read and post row comments Lets MCP clients and Kuma read what people said about a row and add to it, in plain text. * feat(mcp): change view sorts, field visibility and row colours Lets MCP clients and Kuma configure views, and delete views and filters. list_views now returns the ids those tools take. * feat(mcp): read the workspace audit log Lets MCP clients and Kuma answer who did what in a workspace. It stays off until a user turns it on, even though it only reads. * fix(mcp): run the field visibility change in a transaction Over MCP and Kuma it failed on select_for_update, as they call tools outside a transaction. * fix(mcp): only take row colours a row can show A row takes its colour from a CSS class per palette name, so a hex value reported success and coloured nothing. * fix(mcp): undo a row colour that fails halfway The tool adds to a view's colours, so a client retrying after an error would end up with a second colour. * fix(mcp): show how a view's filters combine A view matching any filter, or one with filter groups, read as one matching all of them. * fix(mcp): mark set_view_sorts as overwriting It replaces a view's sorts and an empty list removes them, so clients should confirm it. * fix(mcp): read comments with a mention without a label The API accepts such a mention, and one of them made every comment of the row unreadable. * fix(mcp): refuse a blank workspace search The API trims the query too, and a space would match most names. * docs(mcp): say why reordered sorts are recreated * test(mcp): expect how filters combine in the listed views * fix(mcp): handle bad input to the audit log tools A reversed range and a blank query read as nothing having happened, and an unknown browser timezone ended Kuma's run. * fix(mcp): read comments with no content The API accepts such a comment, and one of them made every comment on the page unreadable. * fix(mcp): show when a view's filters are switched off Those filters hide no rows, so listing them as active misled the client. * docs(mcp): correct what the view tools say they do Row colours work on every view with rows, and Kuma was told to skip list_views when it needs the filters and colours. * fix(mcp): leave IP addresses out of the audit log tools Who did what doesn't need them, and Kuma sends tool results to the LLM provider. * fix(mcp): keep what a restricted view hides out of the view tools A member below builder could read a restricted view's filters, hidden sorts and colours from list_views, and a field's name from an error before permissions were checked. * fix(mcp): replace a view's sorts one call at a time Two calls could each read the old sorts and add to them, leaving a list neither asked for. * fix(mcp): read a mention whose label isn't a string The API accepts such a label, and one comment holding it stopped the row's comments from being listed. * fix(mcp): limit the row comments of a call to 100 Each comment runs about nine queries in its own transaction, and a commenter could ask for any number. * fix(mcp): show Kuma that set_field_visibility needs a field Both clients now reject an empty list from the schema, so the checks after it can't run. * docs(mcp): correct the audit log tools' licence and fields An advanced licence also has the audit log, and entries no longer hold an IP address. * refactor(mcp): rename set_row_colours to add_row_colours It adds to the colours a view has, while set_view_sorts replaces the sorts. * fix(mcp): stop set_view_sorts deadlocking with a new sort A new sort checks its view when it commits, which the view lock blocked while the sort rows it needed were held. Sort writers now share a weaker view lock. * fix(mcp): title add_row_colours Add row colours * refactor(mcp): merge search_audit_log into list_audit_log The two differed only by a text query and a 90 day cap. Timestamps now need an offset, as nothing tells MCP the user's timezone. * feat(mcp): let a date filter carry its timezone MCP has no timezone for the user, so relative date modes would follow UTC. An offset can't express those, so the caller names the IANA timezone. |
||
|
|
d5d93a12cb |
feat(mcp): add the dashboard tools (#6526)
* feat(mcp): add the dashboard tool groups * feat(dashboard): share the dashboard list and create tools * feat(dashboard): share the widget read tools * feat(dashboard): share the widget write tools * feat(mcp): offer the dashboard tools * docs(mcp): list the dashboard tools * fix(dashboard): keep chart series styles when a widget changes Only the changed data source values are sent, and a series given at the same position keeps its id, so per-series chart types and colours survive. create_dashboards is capped at 20 names. * fix(dashboard): address review of the dashboard tools Chart aggregations, licence errors, series styles, clearing values, hidden items and write permissions behaved differently from the UI and the automation tools. * feat(assistant): let Kuma build dashboards Kuma gets a dashboard mode with the shared widget tools, so it can add, change, read and delete widgets and opens the dashboard after adding them. * test(assistant): give the chart eval a premium licence Charts need premium; without it Kuma asked about the plan instead of adding the chart. * fix(assistant): name the tools that list dashboard and widget ids Without them the argument fixer told Kuma to call list_dashboards, which it doesn't have. * fix(assistant): answer dashboard questions from the widgets Kuma sometimes added a widget or view filter to count something a chart already showed. * fix(dashboard): address final review of the dashboard tools A refused write kept earlier items, other users' personal views passed the check, and broken widgets, wrong chart types and missing ids gave unhelpful errors. * fix(dashboard): address review of the dashboard tools The services validate the data source, Kuma creates dashboards without an event the frontend can't handle, and the chart evals check the figures. * refactor(dashboard): let widget types register their tool definitions Charts and pie charts are premium, so their tool models, series handling and series_config now live in premium instead of the open-source tools. * fix(mcp): keep core.tools importable before Django is set up asgi.py imports baserow.core.mcp before django.setup(), and core.mcp now imports core.tools for its error mapping. * fix(assistant): refresh db connections in the dashboard tools develop now runs every Kuma toolset through AssistantFunctionToolset, which checks the thread's database connection before each sync tool call. * fix(dashboard): check the whole widget on partial updates The service only checks an aggregation sent with its field, so a partial update could save a widget that can't compute. Also restyle a chart whose series differ from its type, and tighten the eval check for the Won count. * test(dashboard): drop tests that only check constants and pydantic They assert configured limits and pydantic behaviour that other tests already cover. |
||
|
|
362f690b9e |
feat(chat-runs): per-run-type limits and a core run stream (#6454)
* 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 |
||
|
|
583ebf9f83 |
feat(mcp): offer Kuma's automation tools (#6469)
* feat(automation): share the workflow and node read tools MCP clients can find automations and read workflow graphs; workflows and nodes in another workspace are not found. * feat(mcp): label the automation tool groups * feat(automation): check automation formulas without a model Adds the workflow and node definitions to core so MCP can use them, with a formula check that needs no model. * fix(assistant): repair automation formulas after the nodes are written The model ran inside the write transaction (#6297), and Kuma's own write path didn't scope nodes and tables to the workspace. * feat(mcp): offer Kuma's automation tools * docs(mcp): list the automation tools * fix(automation): report values the node tools can't set These values were dropped or misapplied without telling the caller, who then assumed they were set. * fix(automation): keep node formulas runnable and updates non-destructive A ref in a previous_node path broke the workflow at run time and on import, and a typo in an update wiped a working value. * fix(automation): store the email body type as a choice The quoted value made emails go out as text/'html' and left the editor without a valid choice. * fix(assistant): let repaired formulas name nodes by their ref The generator sees each node's ref, but the repair write refused a formula that used it. * fix(assistant): stop repairing automation formulas when cancelled A cancel during the model call still wrote that node's formulas. * fix(assistant): keep a cancel and each field's repair apart in formula repair A generator error after a cancel was logged as a failed repair, and a missing field kept every repaired row value in formula_errors. * fix(automation): report a row_id or values a new row node can't take add_nodes dropped them silently where update_nodes reports them, so a create_row with a row_id looked like it acted on that row. * fix(automation): refuse a formula path the node doesn't output A condition like get('previous_node.<trigger>.Priority') parsed, so it was stored and its branch never matched. Kuma used to rewrite every condition, which hid this. * fix(automation): report what the node tools drop or misplace Values a node type takes no part of, a branch on a node that isn't a router, a repeated field and unchanged nodes were all reported as done. Text naming previous_node was read as a node path, and the builder lost its loose formula detection. * test(assistant): add evals for changing existing workflows The automation evals only created workflows, so add_nodes, update_nodes and delete_nodes were never exercised against a model. * fix(automation): list branches by label and keep a branch sent without a condition In the evals the model passed a branch uid as previous_node_ref, and listed unchanged branches in update_nodes without a condition, which was refused. * fix(automation): leave formula text in string literals alone Paths and $formula: inside quoted text were checked and rewritten as code. Field names are accepted in row paths since the row services read them too. A whole value written as one call with a space before ( is a formula again. * fix(automation): reload the graph after a node change rolls back The request's cached graph kept the rolled-back change and the next node saved it. A node given twice in update_nodes had its first formula repaired over the second. An email's body_type was reported as not set although it was. * fix(assistant): list nodes Kuma repaired in updated_nodes A node only the repair changed came back missing, so Kuma retried the update. The evals also check the email is still connected to the trigger. |
||
|
|
be799d43d2 |
feat(mcp): share Kuma's table, field and view tools with MCP (#6442)
* feat(database): share field tools and store raw formulas without a model MCP and Kuma need one definition of the field tools, and the MCP path has no model. Kuma repairs invalid formulas after the shared call, outside the transaction. * fix(assistant): run formula repair after the table transaction commits Tables and fields are now created by shared core code in one transaction, and Kuma repairs invalid formulas only after it commits. Closes #6297 for database. * fix(database): save each field in its own savepoint A database error on one field aborted the whole transaction, losing the other fields in the call. * feat(mcp): offer Kuma's table, field and view tools MCP clients get the field and view write tools Kuma uses, built from the same functions, and the disabled core table and field tools they replace are gone. * fix(database): reject bad select filter values and check every view first A string select value made an empty filter and an int one an internal error. A missing view left the filters of earlier views saved, so a retry duplicated them. * refactor(database): share list_tables between MCP and Kuma MCP gains Kuma's name filters and keeps its list output; Kuma's not-found hint now only names and counts databases the user can see. * refactor(database): share get_table_schema between MCP and Kuma MCP now gets Kuma's field details (option IDs, lookup through and target, array formula type) and keeps its old keys; Kuma reshapes the same result. * feat(mcp): share list_applications between MCP and Kuma Kuma's list_builders pages instead of silently stopping at 20. list_databases stays as an alias because existing connections allow it. * fix(assistant): keep generated formulas out of Kuma's table schema The shared schema sends MCP the formula of lookup, count and rollup fields, as before; Kuma only showed it for formula fields. * test(mcp): pin that stored tool lists can't hold removed or re-enabled tools Every write path has checked names against enabled tools since allowed_tools was added, so no data migration is needed. * docs(mcp): list the shared database tools in the test plan * fix(database): log unexpected field tool errors and hide their message The per-item loops sent raw exception text to MCP clients and never logged it. * fix(database): report an empty formula in formula_errors It used to fail later with "retry later" advice that Kuma's fixer never saw. * fix(database): create the filters of all views in one transaction An error on a later view left the earlier filters saved, and a retry duplicated them. * fix(database): store form settings and skip view filters Baserow refuses A form view filter or a field option error failed the call unreadably, form submit settings were dropped, and date, boolean and select filter values were stored as something other than what the response echoed. * fix(database): lock updated fields and drop models cached in a rolled back item update_fields merged select options from an unlocked read, and a failed item or a denied table could leave the request's cached table model ahead of the database. * fix(database): look up through the link field a lookup names through_field was taken for a table id, so the lookup failed or linked a new field to the wrong table, and a link field created for a lookup went unreported. * fix(database): report a refused primary field name with the table's name A reserved, blank or too long primary_field_name failed create_tables with "Internal error.". * fix(mcp): list only databases with list_applications The tool sits in the database read group, so it must not list builders, automations or dashboards until their groups exist. * fix(assistant): leave empty formulas to the user and note every unrepaired one The fixer invented a formula for a field that had none, and a permission denial while repairing dropped the notes for the formulas still invalid. * fix(database): validate a form view's redirect URL like the REST API The public form navigates to it after submit, so a javascript: URL ran in Baserow's origin. Also stops catching filter errors this path can't raise. * fix(database): match a lookup's through_field name ignoring case and spaces Select labels are matched that way, so link field names now are too. * refactor(database): move user_error_message next to the shared tools The table tools imported it from the MCP services, which is a layer above them. * fix(database): echo no value for a relative date filter that ignores it The response showed a value Baserow never stored for modes like today; it now reports null with a note. * fix(database): match reused table field names ignoring case and spaces "email" against an existing "Email" was reported missing, and next_steps led to a near duplicate field. Also tests a blank primary field name over MCP. * fix(mcp): let list_tables and get_table_schema ignore unknown arguments They are legacy default tools and ignored extra keys before, so existing clients that send them got errors. * fix(database): lock field updates in table and field id order Two calls locking the same fields in opposite order could deadlock when waiting for locks instead of failing with a conflict. * fix(assistant): drop models cached in a failed formula repair The repair savepoints could leave the request's table model ahead of the database, like the shared loops did before. * fix(database): lock all updated fields up front and apply them in order Sorting the updates broke a rename followed by a formula using the new name; the fields are now locked in id order first, and a lock conflict reads like REST's. * fix(database): make gte and lte view filters include equal values The aliases mapped to strict comparisons, so a row equal to the value was left out. * fix(database): skip link_row view filters without a row id A missing or non-numeric value was stored and matched every row. * fix(database): skip number view filters without a number A missing value was stored as "None", which hides every row. * fix(database): use UTC in date view filters when the profile has no timezone The filter stored "None" as its timezone and matched no rows. * fix(database): limit view names in create_views to 255 characters A longer name reached the database column and failed as an internal error. * fix(database): reject select options that share a value on create Tools pick options by value, so the second of two such options could never be matched. update_fields already rejected them. * fix(database): match a reused lookup's link field name like creation does Creation ignores case and outer spaces after an exact match, so the reused table check reported a lookup through "projects" as wrong when its link is "Projects". * fix(database): only skip a requested field named exactly like the primary field Field names are unique only when they match exactly, so a requested " Name " next to the primary "Name" was dropped without a word. * fix(database): reject a table name several tables in the database share Table creation reused the last such table while a link picked the first, so the link could point at another table than the response reported. * fix(database): create lookups after every requested table has its fields Fields were added table by table, so a lookup of a field in a later table of the same create_tables call failed. * fix(database): skip a requested field named like the primary in another case Clients vary the case of the primary field name, so an exact match created a second "name" next to "Name". Spaces still count, as on develop. * fix(database): resolve linked table names among the tables the user can see A hidden table of the same name made a link ambiguous, and the error revealed it. * fix(database): store an empty value for empty and not empty number filters * docs(mcp): list_applications lists databases only * test(assistant): add formula and lookup evals for Kuma's database tools * test(assistant): expect an empty value for empty number filters * feat(database): look up through the table's only link field when none is named Kuma often leaves the link out of a lookup and retries after the validation error. * fix(assistant): keep a later formula update and stop repairing formulas when cancelled * fix(database): take the filter timezone from the tool context, not the user profile An actor such as an Agent has no profile. * docs(database): explain a lookup to a formula of a later table * fix(assistant): repair the formula of the update that failed Formula errors from update_fields carry the index of their update, so the repair no longer matches on formula text. A later update that sets the formula to None leaves it unchanged and no longer skips the repair. |
||
|
|
9eabe6b06b |
feat(core): add Redis-backed background chat runs (#6382)
* 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 |
||
|
|
585694941f |
feat(mcp): choose tools per connection and share list_views with Kuma (#6425)
* feat(assistant): add MCP metadata decorator for Kuma tools * feat(mcp): offer Kuma's read tools over MCP from the same definition Builder page lookups are now scoped to the chat workspace so a read can't cross workspaces. * fix(mcp): keep endpoints without an allow-list on today's tools A null allow-list now means the tools enabled on 2026-10-19, so new tools need an explicit grant. Cross-workspace tests assert the exact exception. * fix(assistant): treat a workflow in another workspace as missing A different error for a foreign workflow let a client probe workflow IDs across workspaces. * feat(mcp): return tool errors as MCP error results Expected errors reach the client as readable error results without an ERROR log, only unexpected ones are logged. * chore: add changelog entry for Kuma read tools over MCP * fix(mcp): keep null grants on legacy tools in the consent screen A null allowed_tools made the consent screen tick every tool on reconnect. * chore(mcp): tidy tests and validation error handling Only argument validation maps pydantic errors to client errors; one raised in a tool body is now an internal error. * chore(mcp): rewrap get_allowed_tools docstring * chore(mcp): drop null grant handling from the consent page The consent API now sends the legacy tool list for a grant with no saved tools, so the page never receives null. * fix(mcp): keep client errors readable and server errors logged Row tool errors on develop reached the client verbatim; the new mapping hid some behind "Internal error.". * fix(mcp): map remaining field errors and document the legacy allow-list * feat(mcp): keep existing connections on the tools they had Fill every null allow-list with the legacy tools, so tools added later never reach an existing endpoint. New endpoint keys store their tools explicitly. * feat(mcp): group tools by area The consent page lists tools by group and offers presets built from them. It also gets the tools each workspace can't use. * feat(mcp): read-only and full-access presets on the consent page The tool list moves into McpToolPicker so Settings can reuse it. * feat(mcp): change a connection's tools without reconnecting PATCH on an OAuth connection or an endpoint key replaces its tools, checked against what the endpoint can use, and logs the change in the audit log. * feat(mcp): edit tools from Settings Each connected app gets an Edit tools modal and a hint for the tools it has off, since new tools never turn on by themselves. * chore(mcp): changelog for tool groups and Settings * test(mcp): point the OAuth e2e test at the tool picker checkboxes * fix(mcp): keep stored tools on edit and check availability at consent Sending back a connection's own list failed when one of its tools was unavailable, and consent stored tools the workspace can't use. Removing tools now needs no permission. * fix(mcp): keep hidden tools when editing a connection's tools Ticking any box in Settings dropped granted tools that are only unavailable for now, and a slow save for one app could close the modal opened for another. * refactor(mcp): share list_views from core and expose database tools only Tool definitions live in contrib and know nothing about MCP or Kuma, so the Agent Builder can reuse them. Builder and automation tools ship later with their write tools. * fix(mcp): reuse REST errors, validate row values and name blocked fields Bad row values and field-level denials now read like the REST API's errors instead of "Internal error." or a generic denial. * refactor(mcp): drop tool availability until a tool needs it No tool overrides is_available since the Kuma tools left this PR. Also loads form field options in one query in list_views and logs stored tool names. |
||
|
|
aba67743e2 |
feat(agent-builder): scaffold Agent workspace applications (#6343)
* feat: scaffold Agent Builder applications and empty agents * chore: defer Agent Builder changelog until feature flag removal * refactor: represent each agent as a workspace application * fix: complete Agent application rollout safeguards * fix: use the designed robot icon for Agent applications * refactor: gate only Agent application creation * refactor: keep Agent scaffold on standard shared behavior * fix(agent): load workspace access before opening from overview * refactor(agent): align enterprise feature naming * refactor(agent): retain application stylesheet name * refactor(agent): move application scaffold into open source * fix(agent): hide the empty Agents sidebar group while creation is disabled * test(agent): keep only Agent-specific scaffold tests Generic application behaviour is already covered by core tests, and the branch has no enterprise code, so the enterprise tests are removed. * refactor(agent): define the agent-builder flag with the other flags * chore(agent): type Agent application hooks and tidy flag docs * fix(agent): support the purple item icon color * fix(agent): use the shared application type keys for Agent names The export and import dialogs read `applicationType.<type>s`, so Agent groups showed the raw key. * fix(agent): hide the Agent type filter while creation is disabled All workspaces now only offers the application types that can be created, so Agent stays out of the filter while the flag is off. * fix(agent): use a singular Agent search subtitle * test(agent): cover Agent creation with the flag enabled * refactor(agent): match the Agent search type to Dashboard The backend already filters results by read permission, and the Agent route checks access when it opens. * refactor(agent): drop the unreachable sidebar creation check The only link that opens the modal already checks `canBeCreated()`. * fix(agent): drop the Enterprise-only hint from the empty Agent page Managing access needs Enterprise, so the text was wrong elsewhere. * refactor(agent): drop the default allowed_fields from the Agent type * feat(agent): track when Agents were last viewed Opening an Agent now loads it from `GET /api/agent/<id>/`, which marks it viewed like the load endpoints of the other application types. |
||
|
|
fc3a9bb1d7 |
feat: descriptions for official templates (#6389)
* feat: descriptions for official templates * fix: shorten template descriptions to fit two lines |
||
|
|
8c56297939 |
docs(mcp): describe OAuth sign-in and endpoint keys in the MCP docs (#6394)
* 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. |
||
|
|
48491a94a6 |
feat(mcp): send openWorldHint and serve the OpenAI apps challenge (#6395)
OpenAI's ChatGPT app review needs all three tool hints set explicitly and fetches a domain verification token from /.well-known/openai-apps-challenge. |
||
|
|
7c3525dc1a |
chore(embeddings): update the embeddings server and release it as 1.1.0 (#6300)
* 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> |
||
|
|
2c5fca6538 |
feat(mcp): OAuth sign-in for MCP clients with CIMD, DCR and consent (#6312)
* 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. |
||
|
|
8ba73684d8 | feat(core): new template browser behind the user_templates feature flag (#6334) | ||
|
|
4187dbb2c8 |
chore(deps): upgrade Docker base images (#6227)
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. |
||
|
|
fcaea7f1a1 |
feat(core): add Z.ai AI provider (#6209)
* 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. |
||
|
|
7b41023ab2 |
feat(core): add xAI AI provider (#6203)
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. |
||
|
|
8b51a71c1c |
feat(core): add Amazon Bedrock AI provider (#6192)
* 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. |
||
|
|
7d94a86406 |
chore(deps): upgrade pydantic-ai to 2.50.0 (#6173)
* 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 |