mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
stop-reporting-builder-custom-code-errors
464
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 |
||
|
|
59fab074b5 | Updated descriptions for 3.0 (#6979) | ||
|
|
9d3d657b56 | Prepare for 3.0.0 (#6961) | ||
|
|
cf0ec8e797 | Latest translations for 3.0 (#6955) | ||
|
|
ba7a06521e | fix: stop reporting handled AI provider errors to Sentry (#6761) | ||
|
|
44aeb711f0 |
fix: stop dashboard charts failing to save a series sent without its chart type or aggregation (#6917)
* fix: stop dashboard charts failing to save a series sent without its chart type or aggregation * fix: report a series without an aggregation as a configuration error when loading a chart |
||
|
|
bb7ba42b90 |
fix: small template marketplace fixes (#6916)
* fix: small template marketplace fixes * Review feedback |
||
|
|
67101593d4 | fix: apply view field visibility to ad hoc filters, sorts and aggregations (#6913) | ||
|
|
06ba01b67a | fix: user templates leave out synced table settings, shared links and mentions (#6837) | ||
|
|
85f9e8e67d |
[2/2] Usage credit subscription: Measure AI usage (#6823)
* Measure AI usage * Show the AI usage data of plugins per agent reply and AI values job * Fixed feedback |
||
|
|
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> |
||
|
|
f07d8c895e |
feat: set up dashboard filters from a table and create the widgets they filter (#6771)
* feat: set up dashboard filters from a table and create the widgets they filter * feat: refine dashboard filter setup and widget association Support multi-table filters, guided widget configuration, same-table condition copying in display order, and automatic linking defaults. Preserve independent target settings and undo/redo behavior. * fix: show copied filter conditions after widget association * test: cover guided dashboard widget creation from a filter * test: cover dashboard filter copying across tables * refactor: simplify dashboard filter configuration * fix: restore dashboard filter links exactly on undo and redo * feat: set up a new widget and how a filter narrows it down in one modal * feat: fold the add-widget modal into collapsible sections that fit chart settings * fix: cancel queued updates when destroying dashboard charts * fix: reference dashboard option context by table * refactor: rename dashboard table context provider * fix: label dashboard table context as field options * fix: shorten dashboard table options label --------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com> |
||
|
|
114e0a04c8 |
feat: trigger automations and agents when a row comment is posted (#6787)
* feat: trigger automations and agents when a row comment is posted * fix: verify row comment trigger access at setup and dispatch * refactor: pass the trigger event source as a plain task argument Drop the Celery headers and the per-type flag kept for the previous release's workers: Agent Builder is behind a feature flag. A service type names what it watches through get_event_source_id. Check a table's trigger read permissions in one call, add the trigger's msgid and shorten the changelog entry. * feat: lock agent triggers the workspace's license doesn't cover The configuration lists every trigger type the instance offers, and the license is checked apart. A locked trigger shows switched off with read-only settings that open the upgrade modal; it can still be renamed, replaced by another type or deleted, and resumes once coverage returns. Menus mark paid items with the lock badge, in Agents and Automations. * address feedback * fix: address second round of row comment trigger feedback - Treat an integration the service list loads as None as trashed - Restore a locked trigger as it was; license checked on edit and fire - Drop a queued event whose trigger watches another source, no skip - Disable the mention checkbox when the host's form can't be used - Fence the comment event text as labelled JSON for agents - Mention the license in the trigger API docs and error * fix: address third round of row comment trigger feedback - pass the run identity's name to the comment form from the agent host - keep only server-decided data in service form choices - log comments a misconfigured comment trigger skips - mention the license in the remaining trigger type texts * test: serialize comment trigger nodes with the user's table access |
||
|
|
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. |
||
|
|
23f328cb19 |
feat(database): assign identities to rows and mention them in comments (#6619)
* feat(database): assign and mention identities behind a field option - Collaborator fields get `include_identities` and long text fields `long_text_include_identities`, both off by default. - With the option on, active identities of the workspace can be assigned or suggested as mentions; they are shown with their icon and renamed in realtime, and they never receive notifications. - Turning the collaborator option off backs up the column, deletes the identity assignments and strips identities from the view defaults, so the update can be undone. - Identities can author row comments and be mentioned in them. - Exports write an identity as `Name <identity>`. * refactor: hide internal emails in collaborator exports through one check * fix: import a personal view only for a person, without a query per owner * fix: show collaborator identities with the icon of the user subject type * refactor: drop a redundant local import of the core handler * fix: unify identity icons and space field options * fix: keep identity field menus and saved mentions readable * fix: limit identity mention suggestions to row comments * perf: prefetch available collaborators once per workspace * fix: use workspace members as authors of generated rows * fix: resolve linked collaborator values by member email * fix: use workspace collaborators for field pickers and paste * refactor: move identity avatar styles to the avatar stylesheet * fix: address review feedback on identity collaborators |
||
|
|
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> |
||
|
|
42803f23ca |
feat: record and show the identity kind in history and pickers (#6620)
* feat: record and show the identity kind in history and pickers - Snapshot the user type of the actor on row history, workflow history and audit log entries, and return it from their APIs. - Show the identity icon in row and workflow history, list identities in their own section of the audit log actor filter and count them per role in inherited access. - Load every identity in the team and access pickers through the paginated subjects endpoint, which now returns the workspace role. - Give identities premium features from the workspace or instance licence instead of a seat. * feat: record identity management in the audit log Creating, updating and deleting an identity go through registered actions, so the audit log shows who did it, with the identity's name and role before and after an update. The actions are not undoable. * fix: export an identity by its name in created by and last modified by * fix: record the values an identity update replaced from the locked row * fix: check the owner of an imported personal view without a query * fix: show an identity with the avatar and icon of its subject type * fix: audit an identity update by what it changed * feat: include the actor's user type in the audit log export and tool * test: cover a row history actor of an unregistered type * test: name the history migration test after what it checks |
||
|
|
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. |
||
|
|
eaf6971633 |
fix: exclude personal views from the Local Baserow integration (#6724)
* fix: exclude personal views from the Local Baserow integration * fix: let undo and redo restore a view that has become personal |
||
|
|
727772b03c | Prepare for 2.4.3 (#6726) | ||
|
|
431c823fa8 | Prepare for 2.4.2 (#6679) | ||
|
|
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
|
||
|
|
313156b6ea |
fix(database): group date-only created on and last modified fields by day (#6618)
* fix(database): group date-only created on and last modified fields by day (#6616) * fix(database): sort grouped date rows by their group key (#6616) * fix(database): align date groups and audit date sorting * fix(database): align audit date filter values with sorting Implement the companion get_value_for_filter required by custom get_order. Normalize date-only values to the UTC-day ordering key while preserving full timestamps and nulls, with SQL regression coverage. * fix(database): harden date grouping and view indexes |
||
|
|
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. |
||
|
|
d0571201ad |
feat: [2/5] Added semantic search vector indexing for text fields (#6450)
* Added semantic search vector indexing * Introduced incompatible state * Covered template scenarios * Set data_schema in local baserow ingration * Check if field is still enabled when updating * Update docs about env var hash change * Added enterprise query test * Fixed index name |
||
|
|
efbd35c34f | refactor(core): propagate export config through property serialization (#6503) | ||
|
|
e53694bfec |
fix: cap the page size of view row listings (#6489)
* fix(backend): cap page size on view row listings and the agents list Grid, gallery and timeline row listings (including public views) and the agents list accepted any page size, so one request could serialize a whole table. Kanban limit/offset now reject negative values instead of erroring. * fix(frontend): keep view row requests within the row page size limit Grouped grid ranges can span collapsed groups and exceed the limit the backend now enforces, so grid requests are split into chunks and merged. Gallery and timeline request sizes are capped to the configured limit. * fix(backend): cap kanban limits and keep default page sizes within the limit Kanban limits were unbounded, and a default page size above a lowered BASEROW_ROW_PAGE_SIZE_LIMIT made requests without a size fail. * chore: add changelog entry * fix(frontend): fetch grouped grid rows per visible section One range from the first to the last visible section also fetched every row of the collapsed groups in between, split into thousands of capped requests. * fix(frontend): fill the visible gallery and timeline range under a small page size limit Capping the request size left visible rows as placeholders when the limit was smaller than the visible range. * fix(frontend): keep kanban row requests within the page size limit The kanban store always asked for 24 rows, so it stopped loading when the limit was set lower. * fix(premium): return no rows when kanban or calendar grouping has no group to fetch With no matching select option or an empty date range, the empty filter selected every row of the queryset without the view filters applied. * fix(frontend): refresh grouped grid rows per visible section The refresh fetched one range across all visible sections, so a large collapsed group in between turned into thousands of capped requests. * chore: mark the page size limit changelog entry as a breaking change Requests above the limit now return a 400 instead of rows. |
||
|
|
3fb5483dec | fix: harden integration checks (#6485) | ||
|
|
4049b1a391 |
feat: support most of field types in grouped data source (#6392)
Co-authored-by: Tsering Paljor <tsering@baserow.io> |
||
|
|
0809c8f531 | fix: propagate template export configuration (#6431) | ||
|
|
58a9449209 |
feat: create a user template and list it in "Your templates" (#6421)
* feat(jobs): Opt-in lock so a job type can refuse a cancel after its commit * feat(create-user-template): Create a user template and list it in "Your templates" * fix(create-user-template): Address review feedback - Only the owner can open a user template; the slug endpoint returns 404 otherwise and includes `type`. - List templates through `/api/templates/?view=flat` instead of `/own/`. - Rename the job's copy to `template_workspace`, renumber the migration to 0132 after develop's core migrations, guard it like 0128, and move revision fields and metadata to the update PR. - Clear references outside the selection instead of failing the import, lock the owner row against a concurrent delete, and keep leftovers tracked until they're deleted. - Load workspace permissions only for the wizard, handle instances without categories, restore a running job before a failed one, and open the default template again in the template modal. - Reuse existing export, cancel and serializer code, keep one icon list, remove overlapping tests, and give template fixtures a unique slug. |
||
|
|
98acd64960 |
feat: Dashboard sharing (#6408)
* Add backend changes: models, handler, etc. * Add frontend share dashboard modal * Add public dashboard endpoint * Add frontend public dashboard view * Add public dashboard auth * Show the logo in the password page based on license * Add abuse reporting and fix license check * Fix tests * fix tests * Fix aggregation in public dashboard * Fix styling on sharing options * Ensure anonymous dashboard views only return the data it needs * DRY public access token logic * Add changelog * Added UpdateDashboardSharingActionType to ensure audit log accurately records changes. * Add e2e tests * Remove old todo; creation-time check is sufficient * Re-add request serializer field overrides * fix test * Ensure that the password protection modal can be persisted with an Enter keypress. --------- Co-authored-by: peter_baserow <peter@baserow.io> |
||
|
|
93eeb19dcb |
feat: run Local Baserow integrations as Agents (#6064)
* Run Local Baserow integrations as Agents * fix tests * feat(core): add reusable subject options endpoint * Add beta badge * fix(audit-log): require actor type with actor id * fix(audit-log): avoid duplicate actor export columns * fix(audit-log): guard deprecated actor fields * Restore the feature flag * fix tab alignement * fix(integrations): reject trashed authorized agents * Fix migration conflict * fix(audit-log): assert structured validation error * fix(database): support agent row deletion trash entries * fix(database): support agent row notifications * fix(core): enforce subject option permissions * chore: fix formatting after rebase * fix(core): include agents in member totals * fix(database): batch row history actor migration * fix(integrations): handle trashed authorized agents * fix(core): remove untranslated subject labels * chore: move nodes around * test: mock integration registry in AI agent service tests * fix: resolve database migration conflict * Add changelog entry * feat: use typed subjects for local Baserow integrations * fix: make audit actor migration retry-safe * fix: retain historical audit actors * Please linting * fix: use canonical local integration subjects * fix: order listed workspaces * fix: validate current user integration authorization * fix: preserve integration authorization on update * docs: clarify migration deployment compatibility * fix: paginate local baserow agent selection * fix: validate selectable subject options * fix: preserve integration authorization on update * fix: show saved integration user in subject dropdown * fix(enterprise): protect team subject options * fix(builder): redispatch data sources for trashed agents * fix(database): split row history actor backfill * fix(enterprise): require audit log actor type * fix(enterprise): use audit log actor options * fix(core): prevent blank agent names * fix(integrations): resolve migration conflict * fix(integrations): pass SMTP preparation context * docs: clarify migration rollout guidance * fix: handle trashed integration subjects * fix: reuse local integration authorization column * fix: allow unconfigured local integrations * fix: only update changed integration values * fix: cache local integration subjects * fix: sort field permission subjects by name * fix: include historical audit log actors * fix: center grow tab labels * chore: remove unused AI providers flag * fix: support agent file uploads * Please linter * fix: initialize integration edit values * fix: preserve integration authorization updates * fix: bound audit log actor pagination * fix: support legacy local integration fixtures |
||
|
|
0971ac4504 |
feat: data model for user templates (#6388)
* feat: data model for user templates (#6341) * docs: ADR 008 template revisions * fix: collision-aware duplicate template slug rename in 0128 |
||
|
|
99e9f0a9ab | Prepare for 2.4.1 (#6368) | ||
|
|
a507ea1439 | Fix the hourly application user limit check timing out (#6311) | ||
|
|
fc6bfb299b |
feat(database): format AI field text output as rich text (#6221)
* feat(database): format AI field text output as rich text AI fields with text output can store rich text, reusing the rich long text editor without mentions or images. New AI fields default to it in the create form; existing fields, API clients and old imports stay plain. Rich fields add a one-line formatting instruction to the prompt. Also: - forward row-modal edits of AI fields, which were never saved - keep image markdown as literal text when images are off, instead of reducing it to its alt text and losing the URL on save - escape user file image references as `![alt]\[name]` so a reference nested in another's alt text can't stay live - return 400 instead of 500 when a PATCH would make a primary field rich text Closes #6220 * fix: preserve reference image URLs in rich text Defined Markdown image tokens carry their destination and title separately from the raw reference marker. Keep that data as self-contained literal inline text when image nodes are disabled, and align the preview behavior. Add parser, AI row persistence, and browser regressions while preserving internal file references and the existing inline-image path. * fix: handle AI field changes during generation |
||
|
|
663dcc9937 |
fix(backend): skip timeline field options when a personal view is not imported (#6234)
* fix(backend): skip timeline field options when a personal view is not imported Snapshots failed with a null timeline_view_id when a personal timeline view's owner had left the workspace. * fix(backend): address review on timeline personal view import Return type can be None, the test checks which fields the options point at, and the changelog covers duplication and imports too. |
||
|
|
8097dfc412 | Prepare for 2.4.0 (#6206) | ||
|
|
4716fc7561 | Latest translations for 2.4 (#6185) | ||
|
|
d448b9ab2e | fix: Fix filter values on lookups of select fields being lost on serialized import (#6138) | ||
|
|
64c9fff85e |
feat [6/8]: prepare AI provider management for rollout (#6070)
* feat: retire AI provider flag and add rollout audit * test: remove obsolete AI provider flag setup and docs * chore: clean up AI provider configuration and tests * feat: deprecate legacy AI provider environment configuration * docs: explain AI provider migration sizing and timing * docs: mark AI provider migration audit for removal * docs: explain AI provider migration audit usage * fix: log AI provider env deprecations after logging setup log_ai_provider_env_deprecations() ran at the tail of _setup_health_checks(), which ready() calls before setup_logging(). The notice went out through loguru's default sink and missed BASEROW_BACKEND_LOG_LEVEL, the Baserow format, and the OpenTelemetry log exporter, so operators shipping logs to a collector never saw it. Also drop two references the flag removal invalidated: the getEffectiveAIAgentModels JSDoc still described filtering as conditional on the removed provider flag, and the AI field architecture doc still pointed provider authors at the deleted legacy workspace-setting hook. That doc now names BuiltInGenerativeAIModelType, which is what grants an integration override model inheritance. * fix: reuse environment AI settings in generation workers * feat: import legacy AI provider settings on upgrade Removing the ai-providers flag makes database-backed providers the default, which would leave every existing installation on an empty AI providers page with a management command as the only way to populate it. A data migration imports the environment and each workspace's stored settings instead, so a standard upgrade needs no commands. Both scopes are imported in one migration. Legacy workspace settings replaced the instance ones entirely, while database providers inherit, so each imported workspace is also switched off the instance provider of the same type. Without that a workspace would silently gain models billed to the instance account. Settings that cannot fit their columns are skipped and logged rather than raising DataError and rolling back the whole upgrade. The migration reverses as a no-op because the previous version does not read these tables, so deleting rows would only discard edits made during a rollback window. migrate_ai_provider_settings stays as the recovery path and now shares its planning logic with the migration, so both agree on which legacy settings are complete. It deliberately does not switch workspaces off inherited providers, and warns instead. * chore: remove the temporary AI provider audit command audit_ai_provider_settings existed to inventory legacy configuration before a manual import. The upgrade now imports automatically, so the command has no remaining step to support. Removal was already tracked in #5749. * docs: reduce AI provider docs to lasting behaviour The upgrade procedure, rehearsal plan and sizing query described a one-time transition and do not help anyone after the release; they live in the pull request instead. What remains explains how providers work: the two scopes, how they combine, the inheritance switch, what the deprecated environment variables still do, and how integration overrides and published applications behave. Also corrects claims that no longer hold: published applications keep materialised credentials only when they were published before the upgrade, the import is no longer optional, and a workspace-owned provider suppresses the environment fallback too. * docs: shorten the AI provider changelog entries Bullet points render as single list items under the entry. The released entries average around twenty characters; these ran to four hundred, so the detail belongs in the AI providers guide rather than the changelog. * docs: clarify where imported AI credentials are stored The previous wording implied Baserow's own exports carry provider credentials. They do not: AIIntegrationType lists ai_settings as a sensitive field and ImportExportConfig excludes those by default, and AIProviderConfig is not part of any export path. * docs: explain the AI provider upgrade and where to configure providers State that the upgrade imports the BASEROW_* provider variables once and no longer reads them, list the exceptions, and give the exact navigation for instance admins (Admin tools -> AI providers) and workspace admins (workspace Settings -> AI providers). Map each deprecated variable to the field that replaces it. * fix: renumber the legacy AI provider import after 0121_agent Develop's core 0121_agent and this branch's import migration both depended on 0120, leaving two leaf nodes, so migrate refused to run and the startup check and E2E shards failed. The import is now 0122 and depends on 0121_agent. * feat: remove the legacy workspace generative AI settings endpoint GET/PATCH /api/workspaces/{id}/settings/generative-ai/ had no caller left, yet a PATCH was still honoured for any provider type without a workspace provider and never shown in the AI providers UI. Remove it with the handler parameter, receivers and frontend handler that only it could trigger. * fix: stop instance AI provider changes from fanning out per workspace An instance-level change queued one Celery task per 25 workspaces behind a global blocking lock, sent a payload to every connected user, and made the premium receiver serialize every AI field on the instance. Instance changes now notify staff only; other users see them after a reload. The render lock is per scope, and the in-use guards no longer read one row per workspace. * fix: keep inherited Kuma when a workspace switches off the instance provider The upgrade switches imported workspaces off the same-type instance provider, which made an inherited instance Kuma model invalid there, so Kuma fell back to the deprecated env model or turned off. Inheriting the instance Kuma selection now ignores workspace switch-offs; explicit workspace selections stay strict and are the only ones that block a switch-off. * fix: skip malformed Ollama URLs during AI provider migration * fix: preserve skipped legacy AI provider connections * test: cover independent legacy AI workspace connections * fix: skip malformed legacy AI provider settings * fix: move legacy AI import after current core migrations The linear rebase omitted the migration renumbering from the previous merge commit, while develop advanced through core 0124. Rename the existing AI import to 0125, depend on 0124, and update its historical migration test so core has a single leaf. |
||
|
|
6e5680264c |
All workspaces homepage [6/7]: Added recently viewed page (#6107)
* Added recently viewed page and show that on workspace homepage * Fixed undo redo * Fixed feedback |
||
|
|
7abd82ff4f | Fix personal view permission check so it only works with real users (#6158) | ||
|
|
57031e305e | feat: arrange widgets on a responsive grid (#5882) | ||
|
|
13a0f435b5 | feat: add graph element (port from dashboard) (#5575) | ||
|
|
ad80341c03 |
feat: add Agent subject type (#5851)
* Add workspace Agents and permission management * fix: remove all duplicate team subject memberships * fix: align agent team role inheritance with users * fix: delegate workspace role storage to subject types * fix: preserve agent team memberships through trash * Fix migration conflict * fix: save agent settings pages independently * fix: preserve agent roles across license changes * fix: stabilize agent list pagination * fix: filter agent websocket events by list permission * fix: authorize agent team membership changes * fix: serialize concurrent agent team updates * fix: refresh agent teams through realtime events * fix: restrict personal views to user subjects * fix: deny agents with unavailable roles * fix: exclude agents in trashed workspaces * test: cover permanent agent access cleanup * fix: gate agents in team selectors * fix: accept trash option for preview actors * fix: set native agent form button types * fix: ignore stale agent modal saves * fix: show permitted agent management actions * fix: validate subject lookup fields * perf: optimize batched user membership checks * perf: cache agent team feature per list * fix: map agent nonmember API errors * fix: document paginated agent API schema * fix: stabilize agent API schema operations * fix: show agent name validation errors * fix: show total agent count * test: cover agent creation submissions * test: cover agent and subject UI behavior * docs: define direct subject role contracts * fix: clarify team access management * fix: use standard empty agents table * fix: align agent name column styling * refactor: move agent trash import * refactor: align agent extension registry naming * fix: recover agent team selector loading * fix: validate every subject in role batches * fix: ignore stale agent list responses * perf: index recent team subjects * fix: restore role handler imports * Fix lint * fix: reuse prefetched user memberships * fix: preserve low priority role fallback * fix: preserve trashed field permission subjects * fix: open team picker when agent loading fails * Fix tests |
||
|
|
8d389cd0e8 |
fix(database): Show when a button field needs reconfiguring (#6114)
* feat: report when a button's row action points at the trash * fix: keep a row action's mapping on a trashed field across edits * fix: update buttons in other tables when their target is trashed * feat: disable a button cell that needs reconfiguring * feat: flag a row action that writes to a trashed field * docs: describe the button reconfigure state in ADR 006 * test: cover a button healing when its mapped field is restored * test: keep failing-click tests clickable under the reconfigure state Give "Broken" and "BrokenChain" a table-targeting action that fails at dispatch instead of one with no table, so requires_reconfiguration stays false and the original click/toast assertions still run. * perf: look up a button's own services in the reconfigure check The uncorrelated subqueries scanned every upsert row service in the instance, which the builder and automations share. * perf: load mapped fields in one query when saving and serializing mappings Update responses and realtime payloads read each mapping's field for `trashed`, and saving looked each field up separately. * fix: let undo restore the values of a mapping on a trashed field The kept mapping was skipped, so replaying the exported mappings left its current value and enabled flag in place. * perf: skip the button lookup when no service depends on a trashed item Every table and application created, and every field trashed, joined all button fields and their actions even when no service pointed at it. * fix: only offer restoring the field to heal a trashed field mapping A permanent delete is cleaned up later without a broadcast, so an open page never learns the action works again. * fix: show the full label of a grid button that needs reconfiguring The tooltip span shrink-wrapped the button, so its 90% max width resolved against the span and cut the label short. * fix: put a button using a trashed integration in the reconfigure state The dispatch refuses a service whose integration is in the trash, so the button now says so up front and open grids update on trash and restore. * fix: update open grids when emptying the trash heals a button Permanently deleting a trashed field or integration ends the reconfigure state without any broadcast, so the cell stayed disabled until a reload. * docs: note trashed integrations and permanent deletion in ADR 006 * fix: count a missing integration a button action needs Deleting a trashed Slack bot left the action with none and re-enabled a button that still fails. Also skips integrations outside a database, keeps service lookups as subqueries, and stops a failed deletion leaking state. * docs: note a missing required integration in ADR 006 * test: wait for a button field save to finish before moving on The save sends the field update and each action call in sequence. A test that navigated right after clicking Save could cancel the order call, so the Stale button kept its old order and never navigated. * fix: replace a row action's mappings with exactly what the payload sends Keeping trashed mappings the payload left out stopped undo from removing them and made undo raise on a mapping it had removed. The editor now sends them back. * fix: leave the reconfigure flag out when the field refresh after a save fails The mount-time value was written over whatever a broadcast had set since. * fix: update buttons mapping a link field to a table that is trashed Trashing a table trashes the link fields to it in other tables without a field_deleted signal. * perf: send the buttons of a table in one message with their flags annotated Every field_updated refreshes the grid, and an unannotated button cost queries of its own. * fix: put a button whose target table is in a trashed workspace in the reconfigure state An action can target a table in another workspace, and the dispatch refuses one whose workspace is trashed. * fix: leave the buttons of a new table or database out of its broadcast Duplication, template installs and imports send the created signals too, and nobody has the copy open. * perf: pair each button service lookup only with the actions it backs Also stop the early check deduplicating its UNION, and test that permanently deleting a builder integration never looks up buttons. * fix: name each action that needs reconfiguring in the button editor The field flag is now whether any action has the per-action flag, so the editor can point at a trashed table, database or integration too. * fix: keep the button flags out of the cached table model They depend on other tables, so a model cached for the button's table served them stale. They are now annotated only where fields are fetched to serialize. * test: make the shared grid view private again after the public view test A public view hides a field created in it until its editor closes, so the retry test that runs later never saw its column. * fix: update buttons mapping a link field to a table deleted from the trash Deleting the table deletes the link fields to it and their mappings, with no signal of their own. * fix: send a restored workspace's dependent buttons once and leave its own out The once-per-restore check now keys the waiting on-commit callback by workspace id instead of relying on a shared Workspace instance. * perf: leave a button's action state out of a service's table schema The grouped aggregate rebuilds that schema uncached per property, and each flag now cost a query per button. Nothing reads them from the schema. * refactor: read an action's reconfigure flag straight from its definition * fix: update buttons mapping a link field whose related field is purged Emptying the trash for a link field also deletes its related field and that field's mappings, which left buttons mapping it disabled until reload. * fix: drop a mapping whose field was deleted from the trash on save An open editor or an undo still sends the purged field's id, so every save failed until reload. Fields that still exist elsewhere are still refused. * fix: match no button for a lookup with no action model An empty model list left the action filter empty, which matched every action and would have sent every button in the instance. * test: describe mappings replaced by the payload after a table change The table change test sent no mappings, so it did not show a new table's mapping replacing the old table's trashed one. * fix: name a button action's trashed table instead of its fields Trashing a table marks all its fields trashed, so the editor asked to restore a field that only restoring the table brings back. The 404 from the fields fetch now marks the table missing, and the action says so rather than a toast. * fix: drop a mapping on another workspace's field instead of refusing it Refusing it told the editor that the field exists. * perf: send a button's state on its own realtime message A `field_updated` makes the client refetch the whole grid, which for a flag that says nothing about the rows throws away what someone is typing. The signal also gives the enterprise restricted views a place to mirror from. * fix: update buttons when a workspace is purged without being trashed `delete_expired_users` and the admin panel delete a workspace outright, so the `workspace_deleted` that would have flagged the buttons pointing into it never goes out. A snapshot's application expires the same way. * fix: flag an update row action that names no row Every click on it is refused, so to the person clicking it is no different to a target in the trash, but the button stayed enabled. * fix: clear the server's reconfigure verdict when an action is edited It describes the action as it was read, so the warning stayed up after a fix until the save landed. Changing the type already dropped it by rebuilding. * docs: name every cause of the button reconfigure state The field and action descriptions each left one out, so they disagreed with ADR 006 and with each other. * test: expect the rowless button to render disabled The server now flags an update row action with no row id, so the click the test made never lands. * perf: serialize button fields once for all restricted views Each serialization runs the reconfigure and action queries, which repeated for every view. * perf: skip purged buttons and merge purge broadcasts Buttons deleted with their container were collected for nothing, and a workspace purge also purges its tables, so one button could be sent twice. * fix: bump the global cache version The button field schema dropped its action state, and cached schemas would keep the old shape. * fix: keep the reconfigure verdict while the integration is unchanged A trashed integration is missing from the list, so the verdict is the only warning. |
||
|
|
2e80579d44 |
[2/4] fix: contain assistant failures and harden formulas (#5898)
* fix: contain assistant failures and harden formulas
Contain recoverable tool, formula, and provider failures without ending the assistant turn. Keep formula documentation safe to interpolate and cover the production paths with focused regressions.
* fix: preserve assistant recovery and validated formula targets
* fix: preserve assistant row action updates and verify recovery
* fix: report only saved assistant form inputs
* fix: refresh assistant row tools when a table's fields change
Row tools bake the table schema into their pydantic signature when
load_row_tools builds them, so adding, renaming or deleting a field left
the already-registered create_rows_in_table_<id> tool rejecting the new
column ("Extra inputs are not permitted"). The model could only recover
by guessing that a reload was needed, which is what produced the fatal
duplicate-tool crash in production.
Every tool that changes a table's fields now rebuilds the loaded row
tools in place from the current schema, so the next row call just works:
create_fields, update_fields, delete_fields, create_tables (a link_row
or lookup adds a reverse field to an existing table) and generate_formula
(saving over a non-formula field trashes it). The whole registry is
rebuilt rather than only the mutated table, because a link_row field also
changes the table it points at. A rebuild failure is logged and leaves
the previous tool in place, so it can never fail a field change that
already succeeded.
load_row_tools' docstring no longer tells the model to avoid reloading;
it now says a reload after a schema change is safe and is the recovery
path if a row tool still rejects a new field.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: record why an assistant run ended without an answer
A run that produced no answer was reported to PostHog as
$ai_is_error=false with a null $ai_output_state, so it was invisible to
every error dashboard. Over 28 days that hid 315 traces (1.3% of all
runs) which had executed tool calls and run for tens of seconds before
returning nothing.
Only a BaseException can reach that state, since set_trace_output runs
on every normal exit of the traced block, so in practice these are user
cancellations and dropped connections rather than silent failures.
Lumping them in with exceptions would have inflated the tracked error
rate with ordinary user behaviour.
Every run is now classified into an explicit AssistantTraceOutcome
(answered, error, cancelled, interrupted, no_answer) recorded on the
trace. $ai_is_error stays true only for error, and is now also true for
no_answer: a run that ended normally with nothing to show is a real
defect. Cancelled and interrupted stay non-errors but are finally
distinguishable, and the three no-answer outcomes carry a {"status": ...}
output state instead of a bare null.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: stop destroying assistant stream events at chunk boundaries
The custom XHR adapter treated `buffer` as a high-water mark of everything
received rather than as a pending buffer. Every progress event advanced it
to the full responseText, so the incomplete trailing fragment of the chunk
was JSON.parse'd into a swallowed console.trace and then dropped: it could
never be rejoined with its continuation. Any streamed record split across a
network read was lost, which is what produced the reported
"Unexpected token 'b', \"ber 1, Num\"..." in the browser console.
The reader now keeps the unconsumed tail, splits only on whole delimiters
and dispatches complete records through a promise chain, so ordering holds
across progress events even if the consumer becomes async. onload flushes
the remainder: a final record that merely lost its trailing delimiter is
delivered, a truncated one is reported instead of silently dropped. That
also fixes responses small enough to arrive without a usable progress
event, which previously delivered nothing at all.
Resolving now waits for the flush, so the store's post-send check no longer
races the last record and reports "The assistant did not provide a
response." for a run that actually answered.
The spec drives the real adapter through a fake XHR and asserts every
record is delivered exactly once, in order, for every possible one- and
two-cut split of the body.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs: explain the ModelRetry passthrough in generate_formula
Review read `except ModelRetry: raise` as dead code. It is unreachable
today, but only because agent.run() converts every ModelRetry from tools
and output validators into retry prompts internally. Without the guard, a
ModelRetry that did escape would be caught by the blanket handler below,
rewritten into a generic failure message and logged as an exception —
turning a retry signal into an error. A reviewer misreading it is reason
enough to say so in the code.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|