mirror of
https://github.com/baserow/baserow.git
synced 2026-12-05 08:48:35 +00:00
ff7885a003bd41509cb4dbbc705ec99b5ced8fb2
25
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
440a949339 |
fix(assistant): stop Kuma runs failing on dropped DB connections and tool errors (#6517)
* fix(assistant): stop Kuma runs failing on dropped DB connections and tool errors Kuma runs failed on dropped DB connections, link fields to non-text primaries and taken page paths, which made up most production failures. * fix(assistant): address review on Kuma run failures Health checks for DATABASE_URL configs, readable link examples without DISTINCT, a reused /login page, and error telemetry without provider bodies. * fix(assistant): address second review on Kuma run failures Login form set up on any reused /login page, lighter link examples, no refusal text in telemetry, guarded nested toolsets and title cleanup that keeps title characters. |
||
|
|
583ebf9f83 |
feat(mcp): offer Kuma's automation tools (#6469)
* feat(automation): share the workflow and node read tools MCP clients can find automations and read workflow graphs; workflows and nodes in another workspace are not found. * feat(mcp): label the automation tool groups * feat(automation): check automation formulas without a model Adds the workflow and node definitions to core so MCP can use them, with a formula check that needs no model. * fix(assistant): repair automation formulas after the nodes are written The model ran inside the write transaction (#6297), and Kuma's own write path didn't scope nodes and tables to the workspace. * feat(mcp): offer Kuma's automation tools * docs(mcp): list the automation tools * fix(automation): report values the node tools can't set These values were dropped or misapplied without telling the caller, who then assumed they were set. * fix(automation): keep node formulas runnable and updates non-destructive A ref in a previous_node path broke the workflow at run time and on import, and a typo in an update wiped a working value. * fix(automation): store the email body type as a choice The quoted value made emails go out as text/'html' and left the editor without a valid choice. * fix(assistant): let repaired formulas name nodes by their ref The generator sees each node's ref, but the repair write refused a formula that used it. * fix(assistant): stop repairing automation formulas when cancelled A cancel during the model call still wrote that node's formulas. * fix(assistant): keep a cancel and each field's repair apart in formula repair A generator error after a cancel was logged as a failed repair, and a missing field kept every repaired row value in formula_errors. * fix(automation): report a row_id or values a new row node can't take add_nodes dropped them silently where update_nodes reports them, so a create_row with a row_id looked like it acted on that row. * fix(automation): refuse a formula path the node doesn't output A condition like get('previous_node.<trigger>.Priority') parsed, so it was stored and its branch never matched. Kuma used to rewrite every condition, which hid this. * fix(automation): report what the node tools drop or misplace Values a node type takes no part of, a branch on a node that isn't a router, a repeated field and unchanged nodes were all reported as done. Text naming previous_node was read as a node path, and the builder lost its loose formula detection. * test(assistant): add evals for changing existing workflows The automation evals only created workflows, so add_nodes, update_nodes and delete_nodes were never exercised against a model. * fix(automation): list branches by label and keep a branch sent without a condition In the evals the model passed a branch uid as previous_node_ref, and listed unchanged branches in update_nodes without a condition, which was refused. * fix(automation): leave formula text in string literals alone Paths and $formula: inside quoted text were checked and rewritten as code. Field names are accepted in row paths since the row services read them too. A whole value written as one call with a space before ( is a formula again. * fix(automation): reload the graph after a node change rolls back The request's cached graph kept the rolled-back change and the next node saved it. A node given twice in update_nodes had its first formula repaired over the second. An email's body_type was reported as not set although it was. * fix(assistant): list nodes Kuma repaired in updated_nodes A node only the repair changed came back missing, so Kuma retried the update. The evals also check the email is still connected to the trigger. |
||
|
|
be799d43d2 |
feat(mcp): share Kuma's table, field and view tools with MCP (#6442)
* feat(database): share field tools and store raw formulas without a model MCP and Kuma need one definition of the field tools, and the MCP path has no model. Kuma repairs invalid formulas after the shared call, outside the transaction. * fix(assistant): run formula repair after the table transaction commits Tables and fields are now created by shared core code in one transaction, and Kuma repairs invalid formulas only after it commits. Closes #6297 for database. * fix(database): save each field in its own savepoint A database error on one field aborted the whole transaction, losing the other fields in the call. * feat(mcp): offer Kuma's table, field and view tools MCP clients get the field and view write tools Kuma uses, built from the same functions, and the disabled core table and field tools they replace are gone. * fix(database): reject bad select filter values and check every view first A string select value made an empty filter and an int one an internal error. A missing view left the filters of earlier views saved, so a retry duplicated them. * refactor(database): share list_tables between MCP and Kuma MCP gains Kuma's name filters and keeps its list output; Kuma's not-found hint now only names and counts databases the user can see. * refactor(database): share get_table_schema between MCP and Kuma MCP now gets Kuma's field details (option IDs, lookup through and target, array formula type) and keeps its old keys; Kuma reshapes the same result. * feat(mcp): share list_applications between MCP and Kuma Kuma's list_builders pages instead of silently stopping at 20. list_databases stays as an alias because existing connections allow it. * fix(assistant): keep generated formulas out of Kuma's table schema The shared schema sends MCP the formula of lookup, count and rollup fields, as before; Kuma only showed it for formula fields. * test(mcp): pin that stored tool lists can't hold removed or re-enabled tools Every write path has checked names against enabled tools since allowed_tools was added, so no data migration is needed. * docs(mcp): list the shared database tools in the test plan * fix(database): log unexpected field tool errors and hide their message The per-item loops sent raw exception text to MCP clients and never logged it. * fix(database): report an empty formula in formula_errors It used to fail later with "retry later" advice that Kuma's fixer never saw. * fix(database): create the filters of all views in one transaction An error on a later view left the earlier filters saved, and a retry duplicated them. * fix(database): store form settings and skip view filters Baserow refuses A form view filter or a field option error failed the call unreadably, form submit settings were dropped, and date, boolean and select filter values were stored as something other than what the response echoed. * fix(database): lock updated fields and drop models cached in a rolled back item update_fields merged select options from an unlocked read, and a failed item or a denied table could leave the request's cached table model ahead of the database. * fix(database): look up through the link field a lookup names through_field was taken for a table id, so the lookup failed or linked a new field to the wrong table, and a link field created for a lookup went unreported. * fix(database): report a refused primary field name with the table's name A reserved, blank or too long primary_field_name failed create_tables with "Internal error.". * fix(mcp): list only databases with list_applications The tool sits in the database read group, so it must not list builders, automations or dashboards until their groups exist. * fix(assistant): leave empty formulas to the user and note every unrepaired one The fixer invented a formula for a field that had none, and a permission denial while repairing dropped the notes for the formulas still invalid. * fix(database): validate a form view's redirect URL like the REST API The public form navigates to it after submit, so a javascript: URL ran in Baserow's origin. Also stops catching filter errors this path can't raise. * fix(database): match a lookup's through_field name ignoring case and spaces Select labels are matched that way, so link field names now are too. * refactor(database): move user_error_message next to the shared tools The table tools imported it from the MCP services, which is a layer above them. * fix(database): echo no value for a relative date filter that ignores it The response showed a value Baserow never stored for modes like today; it now reports null with a note. * fix(database): match reused table field names ignoring case and spaces "email" against an existing "Email" was reported missing, and next_steps led to a near duplicate field. Also tests a blank primary field name over MCP. * fix(mcp): let list_tables and get_table_schema ignore unknown arguments They are legacy default tools and ignored extra keys before, so existing clients that send them got errors. * fix(database): lock field updates in table and field id order Two calls locking the same fields in opposite order could deadlock when waiting for locks instead of failing with a conflict. * fix(assistant): drop models cached in a failed formula repair The repair savepoints could leave the request's table model ahead of the database, like the shared loops did before. * fix(database): lock all updated fields up front and apply them in order Sorting the updates broke a rename followed by a formula using the new name; the fields are now locked in id order first, and a lock conflict reads like REST's. * fix(database): make gte and lte view filters include equal values The aliases mapped to strict comparisons, so a row equal to the value was left out. * fix(database): skip link_row view filters without a row id A missing or non-numeric value was stored and matched every row. * fix(database): skip number view filters without a number A missing value was stored as "None", which hides every row. * fix(database): use UTC in date view filters when the profile has no timezone The filter stored "None" as its timezone and matched no rows. * fix(database): limit view names in create_views to 255 characters A longer name reached the database column and failed as an internal error. * fix(database): reject select options that share a value on create Tools pick options by value, so the second of two such options could never be matched. update_fields already rejected them. * fix(database): match a reused lookup's link field name like creation does Creation ignores case and outer spaces after an exact match, so the reused table check reported a lookup through "projects" as wrong when its link is "Projects". * fix(database): only skip a requested field named exactly like the primary field Field names are unique only when they match exactly, so a requested " Name " next to the primary "Name" was dropped without a word. * fix(database): reject a table name several tables in the database share Table creation reused the last such table while a link picked the first, so the link could point at another table than the response reported. * fix(database): create lookups after every requested table has its fields Fields were added table by table, so a lookup of a field in a later table of the same create_tables call failed. * fix(database): skip a requested field named like the primary in another case Clients vary the case of the primary field name, so an exact match created a second "name" next to "Name". Spaces still count, as on develop. * fix(database): resolve linked table names among the tables the user can see A hidden table of the same name made a link ambiguous, and the error revealed it. * fix(database): store an empty value for empty and not empty number filters * docs(mcp): list_applications lists databases only * test(assistant): add formula and lookup evals for Kuma's database tools * test(assistant): expect an empty value for empty number filters * feat(database): look up through the table's only link field when none is named Kuma often leaves the link out of a lookup and retries after the validation error. * fix(assistant): keep a later formula update and stop repairing formulas when cancelled * fix(database): take the filter timezone from the tool context, not the user profile An actor such as an Agent has no profile. * docs(database): explain a lookup to a formula of a later table * fix(assistant): repair the formula of the update that failed Formula errors from update_fields carry the index of their update, so the repair no longer matches on formula text. A later update that sets the formula to None leaves it unchanged and no longer skips the repair. |
||
|
|
8c56297939 |
docs(mcp): describe OAuth sign-in and endpoint keys in the MCP docs (#6394)
* docs(mcp): describe /mcp with OAuth and endpoint keys in the MCP server doc The doc still described the SSE key URL as the only way in. * docs(mcp): cover OAuth and settings tabs in the MCP test plan and dev doc The test plan only covered the SSE key URL. * docs(mcp): add setup for other MCP clients and the baserow-mcp plugin The test plan only showed Claude Code. * docs(mcp): fix review findings in the MCP test plan and docs Use a <server url> placeholder, link the baserow-mcp README for other clients and correct UI steps. * docs(mcp): unset BASEROW_PUBLIC_URL in the tunnel step It overrides PUBLIC_BACKEND_URL, so the tunnel URL was ignored. * docs(mcp): mention the OpenAI apps challenge route for self-hosted proxies #6395 added it to the Caddyfile only. |
||
|
|
91fabcb3ab |
fix(assistant): let Kuma change menu items by uid instead of recreating them (#6295)
* fix(assistant): keep the menu items Kuma resends instead of recreating them Kuma rebuilt every menu item as a new link with a new uid, so updating a menu deleted the click actions and settings of the items it meant to keep. Items matched by name now keep their uid, type, settings and children. * fix(assistant): keep Kuma's menu items by uid instead of by name list_elements now shows each menu item's uid, with sub-links nested under their parent, and update_element takes the uid back for every item Kuma keeps. A kept item keeps its type, settings, click actions and sub-links; a new name renames it and a new page moves a link, clearing the old page's parameters. children edits the sub-links. Requests the menu can't apply are refused before anything is saved: a page on a button, an unknown or repeated uid, or a new item named like an item being removed, which means Kuma forgot its uid. * test(assistant): set a non-default variant in the menu round-trip test * test(assistant): add evals for Kuma's header menu edits Five kuma-builder cases start from a header menu with a link, a dropdown, a separator and a button with a click action, the kinds of items production menus had when Kuma rebuilt them as page links. Each checks that the items Kuma doesn't change keep their uid, type and click action: adding a link, renaming the button, removing a sub-link, making the button open a page, and adding pages one at a time. The checks are tested against the untouched menu, the right edit and a rebuild into page links. * fix(assistant): delete menu items only when Kuma lists them update_element takes remove_menu_items, the uids of the menu items to delete. Every current item must come back in menu_items with its uid or be listed there, so an item Kuma forgets is refused with its name and uid instead of being deleted. remove_menu_items alone deletes those items and keeps the rest. The rule also covers a forgotten uid, so it replaces the check on new items named like removed ones. * fix(assistant): ask Kuma for the whole menu when it changes one item "Nothing is deleted unless listed" read to Kuma as permission to send only the item it changed, which the tool then refused for leaving the others out. The description now asks for every current item plus the new ones, and points deletions to remove_menu_items. * refactor(assistant): share uid helpers and let after_update add result keys Prepares menu items to follow the table column pattern: canonical_uid and NO_CHANGES move to types/changes.py, the menu listing helpers move to types/menu_items.py, and an element type's after_update hook can now add keys to update_element's result. * refactor(assistant): merge menu item changes like table column changes merge_menu_items turns add, update, reorder and remove lists into the full item list core saves. Items it doesn't name are resent as saved, removing a dropdown removes its sub-links, and anything it can't apply is refused before saving, including pages of another application. name_key and unique_in_order are now shared with the table column merge. * fix(assistant): let Kuma change menu items with add, update, reorder and remove lists update_element on a menu, header or footer now takes add_menu_items, update_menu_items, reorder_menu_items and remove_menu_items by uid, like table columns, instead of the whole menu. Items Kuma doesn't name stay as saved, the result lists the menu's items after the write and the removed items, and a refused change saves nothing. A header or footer changes the menu nested inside it and refuses when it holds several. * test(assistant): add evals for reordering menu items and removing a dropdown Two kuma-builder cases on the header menu scenario check that moving Help keeps every item, its click action and the Products sub-links, and that removing the Products dropdown removes its sub-links and nothing else. * fix(assistant): warn that undo keeps removed menu items deleted and list custom link urls Undo restores no menu item change, so the tool now says so next to remove_menu_items, as it does for table columns. list_elements shows a custom link's url, so it no longer looks like a link to nothing. A header's or footer's menu is locked before its items are read. |
||
|
|
eeb8d3900b |
fix(assistant): let Kuma change table columns by uid instead of replacing them (#6296)
* fix(assistant): keep the table columns Kuma resends instead of recreating them Replacing a table's columns gave every column a new uid, which deleted the click actions of button columns, and adding or removing columns reset the styles of the kept ones. Columns matched by name and type now keep their uid and styles. * test(assistant): add eval cases for editing table columns * fix(assistant): don't run a call the argument fixer repaired by dropping values A repair that left out a value the model sent used to run the tool anyway, so an edit could be ignored while the call reported success. The model now gets the error report plus the dropped paths and values instead. Moving a value, renaming a key and converting its type still run because the value survives. The harness lifecycle test now repairs a renamed key instead of replacing an unparseable value. * feat(assistant): show table columns in Kuma's list_elements * fix(assistant): let Kuma change table columns by uid instead of replacing them * feat(assistant): let Kuma bind table columns to database fields * fix(assistant): send unrepairable arguments back with the model's own errors Check a repair for dropped values before validating it, and answer a repair that still fails with the errors of the arguments the model sent. Arguments whose only errors are unknown keys holding values go back without a repair, the fixer may drop only empty unsupported keys, and arguments too deeply nested to compare go back instead of raising. * fix(assistant): show list field values in table columns and refuse type changes Derive the path a column reads from the shape of the field's values, as the table editor does, so lookups and array formulas show their values instead of raw JSON, and refuse fields that hold files. Accept the type list_elements shows in a column update but refuse a different one, and tell Kuma never to remove a column to rebuild it. Also: a value spelled differently from the stored formula keeps it as stored, tables that list a property refuse field bindings, refusals name every offending column, list_elements shows a table's data_source_id, and an unknown data source ref is refused with a next step. * test(assistant): check every kept table column and the reading of the link case builder/edits-table-columns now compares Email and Edit with the seed apart from Email's position. builder/keeps-link-column-settings requires that Kuma read the columns with list_elements and allows two refused attempts, since the columns' state decides the case. The edit-action lookup is shared. * test(assistant): don't depend on the recursion limit in the nested JSON guard test * refactor(assistant): move table column handling into element type hooks * fix(assistant): recover tool calls the model printed as text * refactor(assistant): move the remaining per-type update steps into element type hooks * fix(assistant): don't complete a printed tool call cut off after a stray quote * test(assistant): make the unknown-tool case reach the tool check |
||
|
|
dc62052c97 |
[4/4] test: harden assistant evals and tool contracts (#6007)
* test: bring Kuma eval baseline and dataset updates from #6006 * test: harden assistant evals and tool contracts Add production-replay datasets, resilient eval execution and comparison UI, a committed baseline, and broad tool contract and chain coverage on top of the runtime behavior changes. * test: align tool contracts with #6006 list_tables and permission output * fix: restore the eval runner results tab and pin it structurally The Results tab shipped unable to execute: the closing brace of usageCell was dropped, renderResults read an undeclared totals, the cost cell still called the old four-argument usageCell, and a second pane clear wiped the dataset errors appended just above it. Two tests covered the tab by asserting substrings of the page, so all four passed against dead script. Check the page structurally instead, with a small tokenizer, because the backend CI image has no JavaScript engine and a node-based test would silently skip there. Replace the sampled tool-visibility assertions with the full routed-tool map, so adding a tool has to state its reach rather than inherit one. * test: score eval checks against the call that actually ran An incomplete cross-mode call is answered with a re-call redirect, so the first create_workflows call can hold a pre-switch guess rather than the arguments that executed. Score the executed call instead, recognising the redirect through the router's own helper in both its retry and tool-result forms. * test: score the update_row target from the database, not the first draft The check read row_id out of the recorded create_workflows arguments, which are the model's raw output. When those arguments fail validation the toolset's argument-repair agent fixes them and the tool runs with the repaired payload, so a workflow that correctly names its row still scored as missing one. Measured over ten repetitions this produced one false failure; the trace shows execute_tool succeeding and a fix_agent span right behind it. Read the persisted service instead, like the neighbouring trigger and action checks already do. * test: check saved values in the prod-replay evals Replay checks now verify the form collects the order fields, the page was inspected, the requested tables have rows, ISO week numbers and signed amounts are correct for seeded rows, no broken formula is left behind, and all 30 employee rows carry typed values. * fix: compare eval results only across the same case population A baseline captured on an older dataset version ran a different set of cases, so its means are not comparable. The Results tab now requires the experiment and baseline to share a dataset version and says when they do not. * test: expect Kuma to ask when an implied app table is missing #6006 decided that a request to show records refers to workspace data, so Kuma asks where the projects come from instead of inventing a table. The eval had been flipped to expect building; restore the ask expectation while the explicit example-app case still builds. * test: accept date subtraction as a correct date-difference answer Subtracting two date fields returns a duration (verified: 5 days for 2026-01-01 to 2026-01-06), so an answer that subtracts the dates is correct even when it does not name date_diff. Retrieval rarely surfaces the reference-guide passage for date_diff, which made this case fail three times in four on an accurate answer. * test: expect Kuma to offer a sample-data table when app records are missing When no table holds the records an app should show, Kuma should create nothing and ask, offering a table with sample data among the next steps. * test: accept a plain-text question when Kuma must ask ask_user only records a question for the final answer, so a run that asks in its reply and builds nothing behaves the same for the user. The ask checks still require that nothing was created. * test: match docs keywords through Markdown emphasis Answers bold feature names, so '**File** field' missed 'file field'. Keyword matching now ignores emphasis markers, and the OCR case accepts 'AI prompt', the field type's name in the product. * chore: recapture the Kuma eval baseline on the final stack Three repetitions of all 122 cases on 3ca6497591 with Groq GPT-OSS 120B (harness v5): 355/366 passed. Docs 192/192, core 9/9, database 61/63, builder 55/60, automation 20/21, prod-replay 18/21. * chore: drop an import the develop rebase left unused * test: expect docs search in every mode * test: require complete tracker and employee replay data * fix: compare Kuma eval results using recorded cases and checks * fix: correct Kuma eval scoring and preserve baseline runs * test: reuse the seeded user in Kuma builder contracts * test: isolate async docs-search database fixtures Create users and workspaces in synchronous pytest fixtures so their writes stay inside the rollback transaction. Async setup previously used a separate autocommit connection and leaked users, causing later data-sync tests to fail on duplicate usernames. Remove the global async-safety bypass, enforce Django's guard locally, and keep the real database hybrid test synchronous around its async tool call. Verified the seeded two-test reproduction fails before and passes after with no leaked users. All 71 focused tests and 1,742 broader tests pass; one existing test is skipped. Scoped pre-commit checks pass. * docs: update Builder eval count after rebase * fix: grade saved assistant results and preserve eval errors |
||
|
|
157f586602 |
feat(database): add a floating add row button to the grid view (#6193)
* feat(database): add non-optimistic createNewRowConfirmed grid store action * feat(database): add floating add row button to the grid view * test(e2e): cover the grid floating add row button * chore: add changelog entry for the grid floating add row button * test(database): update page snapshots for the grid floating add row button * test: tighten floating add row button assertions * fix(database): keep the grid floating add row button above the footer |
||
|
|
7d94a86406 |
chore(deps): upgrade pydantic-ai to 2.50.0 (#6173)
* chore(deps): upgrade pydantic-ai to 2.50.0 - Bump pydantic-ai-slim 2.28.0 -> 2.50.0 and openinference-instrumentation-pydantic-ai 0.1.20 -> 0.1.27; the lock also moves anthropic to 1.8.0, openai to 3.19.2, google-genai to 2.25.0. - Unwrap SourcedInstruction entries in the eval prompt override. - Show the error message, not the model response dump, for UnexpectedModelBehavior errors. - Disable the pydantic-ai first-run Logfire banner. - Stop in-flight tools when an eval case times out. * fix: address AI dependency upgrade feedback |
||
|
|
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. |
||
|
|
479e616ee9 |
feat: add columns layout to grouped grid views (#6022)
* feat: add columns layout to grouped grid views * test: strengthen Columns layout coverage * fix: remove doubled vertical border on group column spans The group-by divider already draws a full-height line at each level boundary, so the span's own border-right rendered a second adjacent line in the body but not in the header. * chore: renumber group_by_layout migration after rebase Develop added 0221 and 0222 in the meantime, so the branch migration forked the graph into two leaf nodes. * refactor: rename banner group layout to section |
||
|
|
581917f842 |
feat [5/8]: use database-backed providers for AI Agent services (#5976)
* feat: register ai_agent AI provider model feature type * feat: expose integration-only AI provider settings lookup * feat: validate AI agent models against the ai_agent provider feature * feat: resolve AI agent dispatch settings from database-backed providers * feat: list database-backed AI providers in the AI agent node form * chore: add changelog entry for ai agent database-backed providers * fix: close dispatch feature-gate bypass for partial AI integration settings An integration-level ai_settings blob that omits credentials (e.g. only a models list) skipped the ai_agent feature membership check at dispatch, letting a restricted model run on the admin's DB credentials. Only a complete blob (its own connection) now bypasses the check; a partial one is validated the same way prepare_values already does. Also share one ScopedAIProviderState across the publish materialization loop instead of reloading it per model, and fully annotate AIAgentAIProviderModelFeatureType.get_workspace_availability. * fix: harden AI agent provider resolution * fix: preserve AI agent model inheritance during provider migration * fix: harden AI agent provider validation and document contracts * refactor: declare built-in AI provider types on the type itself The AI Agent model resolver duplicated the backend AI_PROVIDER_TYPES keys in a frontend Set, so a provider added there without updating the Set would silently lose model inheritance. Provider types now report it through isBuiltInProviderType(), inherited from BuiltInGenerativeAIModelType, with a test asserting every registered provider declares it. |
||
|
|
0bb39e36c6 |
[1/4] feat: AI assistant eval platform on self-hosted Phoenix (#5958)
* feat: add Phoenix LLM tracing service to the dev stack (ai profile) * chore(deps): add openinference pydantic-ai instrumentation (dev) * feat: export assistant traces to Phoenix when BASEROW_ASSISTANT_PHOENIX_URL is set * fix: harden Phoenix tracing setup after review * feat: Phoenix postgres storage, ai-evals profile and auth support * docs: ADR 007 and assistant tracing/evals guides * feat: assistant eval platform core (types, registries, scenarios) * feat: eval harness with shared assistant factory * feat: phoenix dataset sync for assistant evals * feat: assistant eval experiments via phoenix client + CLI * feat: migrate core, database and docs evals to the platform Ports the 42 kuma-core/kuma-database/kuma-docs pytest evals into declarative EvalCase/EvalScenario registrations, plus structure-level tests asserting dataset counts, ids, and scenario wiring. * feat: migrate builder and automation evals to the platform Ports the 12 builder + 2 proactive + 2 user-source cases into evals/datasets/builder.py (kuma-builder, 16 cases) and the 7 automation cases into evals/datasets/automation.py (kuma-automation), following the Task 5 pattern established in core.py/database.py. Extends eval_platform/test_datasets.py with counts, id lists, a mode-per-case assertion, and pre_state snapshot checks for the two cases that need one. * fix: link traces and final counts for single-case eval runs * fix: root spans for single-case eval runs use the assistant tracer provider * feat: assistant eval runner service with run page Adds the assistant_eval_runner management command (migrate -> instrumentation -> dataset sync -> single worker thread -> wsgiref server) and its runner.py module: a stdlib WSGI app serving a plain server-rendered page (GET /, POST /run, GET /healthz) backed by a bounded in-memory run history and one background worker draining a queue.Queue via run.run_experiment_for. Wires the assistant-eval-runner compose service (ai-evals profile, own baserow_evals DB), renames phoenix-db-init to ai-evals-db-init and extends it to also create baserow_evals, and adds BASEROW_EVAL_RUNNER_PORT to both env example files and the dev docs. * fix: eval runner integration fixes assistant-eval-runner needs its own SECRET_KEY/DATABASE_*/REDIS_* env vars: dev-overlay compose services don't inherit docker-compose.yml's x-backend-variables anchor (that's file-scoped YAML), so the container was starting without a Django SECRET_KEY and without a Redis password, crashing on auth. Also links to finished experiments pointed at the container-internal BASEROW_ASSISTANT_PHOENIX_URL (http://phoenix:6006), unreachable from the developer's browser. Adds BASEROW_ASSISTANT_PHOENIX_PUBLIC_URL (defaulting to http://localhost:${BASEROW_PHOENIX_PORT:-6060}) and has runner.py build the Phoenix link from it, deep-linking straight to the finished run's experiment compare view when its dataset_id/experiment_id are known, falling back to the datasets list otherwise. * refactor: retire the pytest eval harness All 65 eval cases now live in baserow_enterprise.assistant.evals.datasets; delete the legacy pytest-based suite and its `eval` markers. * docs: rewrite assistant evals guide for the Phoenix platform * feat: docs judge, prompt sync, git stamping and UI-contributed eval examples - answer_quality LLM-as-judge evaluator for kuma-docs (BASEROW_EVAL_JUDGE_MODEL) - Kuma prompts versioned into Phoenix on sync; experiments stamped with prompt hashes, git branch/commit and judge model - sync preserves UI-added dataset examples with prompt-match adoption; eval-export emits paste-ready docs.py snippets - final-review fixes: skip-safe scoring, runner CSRF/bind hardening, doc corrections * feat: eval runner UI round — tabs, fan-out, reference answers, 64-case docs dataset - Runner page: dataset tabs with selection badges, per-dataset and global all/none, cross-dataset fan-out (one experiment per dataset), 5s auto-refresh of runs, persistent run history across restarts, per-dataset Phoenix links, in-page Help tab rendering the repo docs via /docs.json. - Reference answers for kuma-docs: EvalCase.reference_answer, judge grades against it, sync preserves UI-curated ones, eval-export round-trips them. - kuma-docs grown to 64 cases: reference answers for all, PostHog-mined frequent questions, and cannot-do guardrail cases. - Gemini (google:gemini-3.6-flash) in the eval model list. * feat: runnable UI examples, prompt overrides, eval baseline and results view - UI-added Phoenix examples now execute: docs questions get the standard docs checks + judge; tool cases declare scenario/expected_tools/ answer_contains in metadata (empty-workspace default scenario). They are tickable per dataset on the runner page and run in whole-dataset experiments too. - Prompt overrides: run any experiment with a prompt's latest Phoenix version instead of the code constant (runner checkbox panel with soft per-tab ordering, or --override-prompt). Agent singletons keep their dynamic instructions; effective hashes + override list stamped on the experiment. - Committed baseline snapshot (evals/baseline.json, 111 cases) with just b eval-baseline capture/import; the runner imports it on startup so every Phoenix instance gets a baseline experiment per dataset, idempotent by content hash and run count. - Results tab: all datasets in one view for a named experiment, with baseline deltas and a case-weighted overall row, via Phoenix experiment annotation summaries. - New evaluation guide (docs/testing/ai-assistant-eval-analysis.md) served in the Help tab; layout uses horizontal space better (single tab row, fluid case columns). * feat: time and cost in eval results, frozen into the baseline snapshot - Results tab gains time (sum of run latencies) and cost/token columns per dataset and summed overall, with lower-is-better baseline deltas. - eval-baseline capture freezes each dataset's time/cost/token totals into baseline.json; import stamps them as metadata so imported baselines (which carry no traces to price) still show time and cost. - Importing a new baseline supersedes the previously imported one instead of accumulating duplicates. - Changelog entry for the eval platform. * fix: OpenInference attributes on subset-run task root spans Bare wrapper spans rendered as kind 'unknown' with Unset status and empty input/output in Phoenix. The Task root span now carries the CHAIN kind, the case prompt as input, the run result as JSON output, and an explicit OK status. * polish; minor fixes * fix: address eval platform review feedback Apply production model settings and retries, isolate automation checks, and fix runner configuration, links, and result status. Defer GPT-5.6 compatibility and baseline comparisons to #6034. * fix: preserve model profiles in rebased eval harness Use an explicit model profile for evals and share concrete models with tools. Manage model clients through the existing lifecycle helper and preserve regression coverage from the retired harness. * fix: harden eval persistence and Phoenix access |
||
|
|
ab45c2346a |
feat [4/8]: per-feature AI model settings (#5796)
* feat: per-feature and workspace-level AI model settings Baserow could only point every AI feature at one instance-wide model. An administrator can now register provider models, declare which AI features each model may serve, and pick the default model per feature; a workspace admin can inherit that choice, override it, or disable the feature locally. The assistant resolves its model once per logical request and threads that snapshot through its nested agents and tools, so a single run can no longer re-read settings repeatedly or pick a model other than the one it validated. The scoped provider state is memoized for the duration of a request, keeping workspace serialization from loading it once per workspace. Also: - add Google and Groq provider types, and keep these database-only providers out of the legacy workspace settings they cannot round-trip through; - prune orphaned feature selections so an unloaded feature type's RESTRICT FK no longer blocks provider and model deletion; - record whether a configured model answers text and tool-calling probes, and invalidate that result when its credentials or identifier change; - broadcast provider and availability changes over the existing realtime channel so open clients update without reloading; - read the assistant model from the shared configmap, so frontend pods no longer miss it on Helm installs. Manual test instructions live in docs/testing/kuma-model-settings-test-plan.md. * fix: address AI provider settings review feedback |
||
|
|
1fa388b83f |
chore(deps): upgrade pydantic-ai to V2 (2.28.0) (#5896)
* chore(deps): upgrade pydantic-ai to V2 (2.28.0)
Upgrades pydantic-ai-slim from 1.102.0 to 2.28.0. No user-visible behaviour
change: where V2 moved a default, the V1 behaviour is pinned rather than
silently adopted.
Production changes are five files:
assistant/assistant.py async for -> async with ... as events:
(run_stream_events is a context manager)
assistant/retrying_model.py public RunContext; state/metadata/
close_stream proxy delegation; Vertex AI
via GoogleCloudProvider
core/generative_ai/registries.py output_retries=3 -> retries={"output": 3}
assistant/model_profiles.py normalise google-gla/google-vertex prefixes
assistant/tools/database/agents.py pin end_strategy="early"
The rest of the diff is test hardening, and it is the point of the change.
The assistant suite mocked pydantic-ai's streaming path instead of running it,
which hid four real breaks — one of them user-facing:
- Agent(output_retries=3) raises TypeError on V2, breaking the premium
generate_ai_formula endpoint. Invisible because the test patches prompt()
wholesale and the shared fixture refuses structured output.
- run_stream_events became a context manager; the bare async generator mock
kept working regardless.
- end_strategy flipped early -> graceful, letting a previously-skipped tool
call execute and hard-fail formula generation.
- GoogleProvider(vertexai=True) was removed entirely.
The doubles now wrap real pydantic-ai types, one test drives the genuine
streaming path, one proves cancellation unwinds through the context manager,
and test_pydantic_ai_contract.py pins the API surface (public and private) so
the next upgrade fails at import rather than mid-run in production.
Verified: assistant + core/generative_ai 343 passed, 66 skipped; full backend
suite 11962 passed, 360 skipped, 1 failed. That failure
(test_view_empty_count_aggregation_for_interesting_table, BaserowFormulaButtonType
missing empty_query) is pre-existing and unrelated — the identical failure occurs
at base commit
|
||
|
|
667cfdd850 |
feat: support grouped row ordering (#5787)
* feat: support grouped row ordering * fix: use existing endpoints without modifications * fix: make grouped row moves reliable and optimistic * address feedback |
||
|
|
ad08d4be1d |
feat: Group-by aggregations (#5602)
* feat: show per-group aggregations in grouped grid views
Each group header shows the column's configured Summarize value computed
over that group's rows, column-aligned at every depth, visible whether
the group is collapsed or expanded. Reuses the footer aggregation config
and display components, and an interactive per-group picker that sets the
shared column aggregation. Gated behind the group_by_aggregations frontend
flag; backend returns values via the existing group-by-data response.
Not included (follow-up): realtime/live updates, performance and caching,
and consolidating the group-by-data and aggregations endpoints into one
request for grouped views.
* refactor: de-duplicate Decimal NaN handling in grid aggregations
Extract the repeated Decimal("NaN") -> "NaN" JSON-safety hack into a single
json_safe_aggregation_value helper, reused by the group-by per-group and totals
aggregations and the authed/public footer aggregation endpoints.
* fix: address copilot feedback on group-by aggregations
- Only show the "+ Summarize" picker for unconfigured columns; a configured
column with no per-group value (e.g. distribution) now renders nothing
instead of looking unconfigured.
- Document the aggregations_only and include_totals query params and the
optional top-level aggregations field in the group-by-data OpenAPI schema.
- Mark row_count, sibling_index and row_offset optional (omitted in the lean
aggregations_only mode).
* fix: de-flake replay-events last-seen-expired test
The test assumed RealtimeEvent id 1 never exists, but the id sequence isn't
reset between transactional tests, so the recorded event got id 1 when the
test ran first on an xdist worker and replay succeeded. Capture the real id,
delete it to simulate retention, and replay from it.
* feat: live, consolidated group aggregation updates
Group-header aggregation values and the footer total now update live and in
place on any change (cell edit, row create/delete, realtime), with no spinner.
In grouped mode they come from a single group-by-data request (aggregations_only
+ include_totals); the standalone /aggregations/ endpoint is no longer called
while grouped. Sort changes need no refresh (order-independent). Gated behind the
group_by_aggregations flag; flag-off behaviour is unchanged.
Deferred: per-group targeting (refreshes the loaded window), the optimistic +
realtime double request, and the 7.3.2 picker e2e.
* fix: dedupe and harden per-group aggregation refresh
Selecting an aggregation in a grouped view fired the group-by-data request
two or three times and could leave the footer total hidden behind a stuck
spinner until the page was refreshed.
- Clear the footer loading flag from refreshGroupByAggregations so the total
shows on first select.
- Make refreshGroupByAggregations the single owner and supersede in-flight
requests so a stale response can't overwrite newer values.
- Skip the duplicate fetch from updateFieldOptionsOfField and the footer
watcher while a picker already owns the refresh.
- Right-align and shrink the banner aggregation value, and let the label slide
behind the previous field instead of hiding it.
* chore: remove the group_by_aggregations feature flag
The per-group aggregations feature is finished, so enable it unconditionally
and drop the flag gating from the grid footer, group banners, and the
aggregation refresh action.
* test: drop obsolete group-by aggregation feature-flag specs
The group_by_aggregations flag is gone, so the two specs that asserted the
flag-disabled behaviour no longer apply.
* fix: stop the row context menu's Select row from clearing its own selection
The global click handler that clears a multi-select when clicking outside the
grid also fired for the row context menu's "Select row" click, wiping the
selection it had just made (most visible in group-by). Skip the clear when the
click lands inside a context menu; cell clicks, which should still clear, are
unaffected.
* fix: flaky test
* fix: show the spinner for updates as well
* fix: address copilot aggregation comment
* fix: avoid optimistic group aggregation values
* fix: address feedback
* fix: hide vert divider before primary field
* fix: only re-fetch when raw_aggregation_type changes
|
||
|
|
0aa7147db3 |
Collapsible group-by grid view (#5470)
* feat: add collapsible group-by grid view * fix: address copilot feedback, plus some other cleanup/fixes * fix: harden grid e2e navigation * Add e2e tests; improve performance; clean up code * feat: show resolved values for reference fields in group-by headers - Resolve collaborator, link-row and select group values to renderable display objects in the group-by data API, batched once per field per page (O(1) lookups, no per-group queries). - Order many-to-many groups identically to the rows via correlated-subquery ordering, since the relation column is shadowed by the aggregated array annotation in group-by queries. - Render the display values as chips in the group-by banner via dedicated multiple-select / multiple-collaborators components; shrink the collaborator badge, reduce the field-name size and keep the label on one line. * fix: group many-to-many fields by their set of values Grouping a grid by a collaborator, multiple-select or link-row field produced empty groups with orphaned rows and duplicate headers for the same set of values. The group key (an id array) was order-sensitive: the backend's aggregated array order was unstable row-to-row and the cell appends new values, so an optimistically-created group's key diverged from the server's and rows were rejected by rowBelongsToGroupBySection. - pathKey and the group-row Vue keys now sort m2m id arrays numerically, so a group is identified by its set of ids, not their order. - The backend aggregates the group value ordered by related id and sorts the group's unique value, making grouping deterministic and set-based. - Optimistically-emptied groups (row_count 0) are no longer rendered (the node is kept for reconciliation), and the leading group gap is fixed so the first visible group has no spurious gap. - A newly created collaborator group resolves its badge name from the workspace store instead of requiring the name on the value. * fix: keep cell multi-select when dragging in a group-by view A multi-select drag ends with a click whose target is the rows container (the common ancestor of the dragged cells). cancelMultiSelect- IfActive cancels the selection unless that container is recognised as part of the rows area, but its whitelist only knew the flat-grid classes (grid-view__rows / grid-view__row). The collapsible group-by feature renders rows in grid-view__group-by-rows containers, so the post-drag click was treated as "outside the rows" and the selection was cleared on mouseup. Add the group-by row containers to the whitelist. * test: expect emptied group-by banners to disappear The optimistic empty-group hiding (a group disappears once its last row moves out) made the e2e contract that kept the emptied source group visible at row_count 0 obsolete. Update the 2.2.7/2.4.4 assertions to expect the emptied group's banner to be gone (new expectNoGroupByBanner helper), and correct the tree-maintenance comments: the node is still kept for reconciliation, but the layout no longer renders its banner. * perf: load the collapsible group-by grid in one bounded request Grouping a wide table by many fields took several seconds and a request waterfall to render the first screen. The group tree was fetched one HTTP request per depth, a budget that ran out before reaching any leaf forced a per-parent fallback, and the rows endpoint resolved group-by metadata unconditionally. Backend - Walk the descendant tree with one batched windowed query per group-by level (get_group_by_data_for_parents) instead of one query per parent, so a single include_descendants request returns the whole visible subtree in O(depth) queries. - Scale the descent window to the viewport: row_budget = ceil(limit / depth). A deep group-by stacks each leaf row under its ancestor banners, so far fewer leaf rows fill the first screen; the window now returns a viewport-sized slice (~264 -> ~68 groups on a 12-level grid) and the rest lazy-loads on scroll. - Gate the rows endpoint's group-by metadata behind include=group_by_metadata so it is not computed when unused. - Resolve reference/link-row display values in one id__in query per field across all pages instead of once per page. Frontend - Initial load issues one group-by-data prefetch and one viewport rows request; expand mode no longer takes the per-depth path. - Cap the banner indent (<=50px) and shrink the per-level arrow spacing as the group-by count grows, keeping the count aligned and the field name ellipsised; render multi-level loading skeletons for the not-yet-loaded levels. - Guard walkPage against a cyclic page-resolution stack overflow and keep activeGroupBys filtered to fields that still exist. Plus e2e env isolation (configurable ports, cookie prefix) and docs. * fix: address review feedback Addresses the review comments on the collapsible group-by grid PR. - Gate the group-by add-row "+" on the same condition as the flat grid (not read-only, not a one-way data sync, has create-row permission), so it no longer renders buttons that error on click for data-sync tables. - Show the "(Empty)" label for empty array-valued groups (multiple select, link row, collaborators), matching the text-field behaviour. - Stop the flat-grid row placeholder from rendering in group-by mode (v-else-if instead of v-else). - Render formula group-by headers via the result field type's group-by component instead of RowCardFieldFormula, removing the dev-only "Missing required prop: row" Vue warning. - Keep the cell selected at the first/last field for both Tab and arrow keys (restore the pre-refactor behaviour); navigating past the edge no longer drops the selection in either flat or group-by mode. - Re-enable and de-flake the "sorted add outside buffer" e2e test: assert on the re-resolved last row instead of a snapshotted renderedRowCount() index, which raced with the create-confirmation re-render in CI. * fix: keep rows inserted below in a grouped grid view in their group Insert-below and add-row in a grouped view now derive the new row's group path from the neighbouring row, so it inherits all writable group-by values and lands in the same group; `before` is set only when the next row shares that group. * feat: soft-cap adding group-bys at 5 in the view UI Once a view reaches 5 group-bys the add button is disabled with a tooltip; views that already have more keep working and only offer to remove them. * limit group-bys; fix css * refactor: polish code and comments * fix: address Bram's feedback * feat: add vertical gap between sibling sub-groups and indent banner labels with their chevron * fix: address remaining feedback * fix: row-coloring and fixed-height for add-row * fix: address Bram's feedback v2 * fix regression in last commit * fix: address grid group review comments |
||
|
|
d8ff2e5b1f |
refactor: add a test plan and extract grid view helpers in preparation for collapsible group-by (#5430)
* refactor: extract grid view common test helpers
* refactor: extract row-lifecycle helpers and migrate grid store
Add computeRowInsertPosition to utils/row.js (expresses insert
position by row identity rather than flat array index).
Add handleRowCreated, handleRowDeleted, handleRowUpdated to
rowLifecycle.js. Each takes a store-supplied mutations adapter so
the decision logic (filter matching, sort position) is shared
between the flat-array grid store and the upcoming collapsible
group-by store.
Migrate createdNewRow, updatedExistingRow, deletedExistingRow in
grid.js to delegate through the new helpers via inline adapter
closures that translate position descriptors to the existing
flat-buffer Vuex mutations. Observable behaviour is unchanged;
search gating is preserved in each Vuex action.
Also includes grid view e2e test additions (section 1.5 task queue,
section 7.7 row identifier type, section 10.1 hover actions) and
grid test plan updates from the refactor/grid-view-common-e2e work.
* chore: fix CI
* chore: cleanup
* refactor: remove dead grid e2e search helpers and dedupe row-lifecycle guards
- Drop the unused openSearch/typeInSearch/clearSearch/toggleHideNotMatchingRows
methods from GridPage; the richer, used variants live in
grid_view_options.spec.ts. This also removes the placeholder/getByText
selectors flagged in review (the remaining 'Delete row' selector stays scoped
to the visible context menu).
- Centralize the repeated 'applyMatchFlags ?? noop' / 'rowsForMatchCheck ??
emptyRows' guards into a single normalizeMutations() helper. No behavior change.
* refactor: remove dead updateMatchFilters/updateMatchSortings grid actions
Both grid store actions lost all production callers in the row-lifecycle
migration (match flags are now computed via onRowChange/reapplyMatchFlags and
direct computeRowMatchFlags calls). Repoint the remaining viewFilters test at
the live onRowChange path instead of the orphaned updateMatchFilters action.
* docs: note field-constraint create/edit coverage in grid view test plan
Add 1.6.x and 2.6.x TODO entries describing add/edit behavior under unique and
unique-with-empty field constraints (backend validation error surfaced +
optimistic rollback; empty values exempt from uniqueness).
* test: await route registration in failNextRequest
failNextRequest fired page.route() without awaiting it, so the intercept
could register after the caller already triggered the request. Make it async
and await registration before returning (mirroring pauseNextRequestWithSignal);
it now returns { done } and the 3 callers await it.
* test: scope grid_interaction serial mode per-describe
Replace the single file-level serial config with a per-describe one (matching
the other two grid specs) so a failure in one block no longer skips the rest and
independent blocks can run in parallel.
* docs: document createRowLifecycleContext and clarify escape wording
- Add a docstring to createRowLifecycleContext.
- Reword the Deferred/Escape note in the grid view test plan.
* fix(e2e): return created rows from createRows helper
setupGrid expected createRows to return the created rows to collect their
ids, but the helper returned void and discarded the batch-create response,
so created.map() threw 'Cannot read properties of undefined' and every
grid_interaction spec failed deterministically. Return response.data.items.
* revert publicView changes
|
||
|
|
00c450872b |
chore: respect BASEROW_BACKEND_LOG_LEVEL setting in tests and management tasks (#5160)
* chore: respect BASEROW_BACKEND_LOG_LEVEL setting in tests and management commands
* fix: use dynamic Loguru {process} placeholder instead of baked os.getpid()
With setup_logging() now called from CoreConfig.ready(), the PID was
frozen to the parent process. Celery prefork children inherited the
wrong PID in their log output. Loguru's {process} resolves per record.
* fix: address feedback
|
||
|
|
cf15a4a02f |
refactor (MCP): refactor MCP tools; share AI Assistant capabilities (#4980)
* feat(mcp): refactor tools to service layer and add database/table/field CRUD Replace internal API request pattern with a dedicated service module for MCP operations. Simplify tool architecture from dynamic per-table tools to static tools with explicit table_id parameters. Add new tools for managing databases, tables, fields, and batch row operations. * fix(mcp): address Copilot review feedback - Let exceptions propagate from MCPTool.call() so call_tool() logs them - Fix N+1 queries in get_table_schema using enhance_field_queryset hook - Fetch fields for all tables in a single specific_iterator pass - Clamp list_rows pagination to safe bounds (ROW_PAGE_SIZE_LIMIT) - Fix update_fields docstring to reflect type-change support - Fix module path in utils.py comment - Update "Adding a new tool" docs to match current MCPTool pattern * fix: comment risky tools; waiting for a proper permission check * feat(mcp): add enabled flag to MCPTool and disable risky tools Add `enabled` attribute to MCPTool base class so tools can be registered but hidden from MCP clients. Disable database/table/field CRUD tools until users can control tool availability through the UI. Also add docs/testing/mcp-test-plan.md with manual testing instructions. * fix(mcp): replace list[dict] with typed Pydantic models for field/row specs Validate required keys (name+type for field create, id for field update, id for row update) at the schema level instead of relying on KeyError from dict.pop() in the service layer. Uses extra="allow" so type-specific options and field values pass through. * fix: wrap update_rows in a transaction * address feedback |
||
|
|
40c9f48081 |
feat (assistant) 3/3: add themes to templates and a set_theme tool (#4970)
* feat(assistant): add theme catalog, apply_theme, and theme templates Add 20 new theme templates and theme infrastructure: - THEME_CATALOG with 22 themes, ThemeName type, _load_theme_data(), apply_theme() - BuilderItemCreate.theme field with auto-apply on creation - set_theme() tool for changing themes on existing applications - Unit tests and eval tests for theme functionality * refactor(assistant): migrate theme evals to EvalChecklist pattern Replace removed assert_no_tool_errors with EvalChecklist + count_tool_errors in test_agent_creates_app_with_theme and test_agent_changes_theme. Remove stale test_navigate_to_workspace test. * refactor(assistant): move theme code from core/types to builder/themes Theme catalog, apply_theme, and related helpers are a builder concern, not core. Move them to tools/builder/themes.py so core never imports from builder. Also make apply_theme return bool so set_theme can report errors instead of silently claiming success, and fix "Thank youb" typo across all 23 theme templates. * refactor (AI field): remove langchain and use pydantic-ai (#5017) * refactor(ai): replace langchain with pydantic-ai for LLM calls and structured output Replace langchain dependency with pydantic-ai as the LLM abstraction layer. Each GenerativeAIModelType now implements get_ai_model() returning a pydantic-ai Model instance, and the base class provides prompt() and prompt_structured() using Agent.run_sync(). - Remove langchain, langchain-openai, and direct openai/anthropic/mistralai deps (pydantic-ai-slim extras install them) - Add prompt_structured() with PromptedOutput for Pydantic model output (e.g. BaserowFormulaModel) - Add output_choices parameter to prompt() for constrained choice selection with fuzzy matching, compatible with all models including those without tool support - Remove custom output_parsers.py (StrictEnumOutputParser, JsonOutputParser replacements) - Update AI field job flow to use prompt(output_choices=...) for choice output and prompt_with_files fallback for file-based prompts * refactor(ai): replace deprecated Assistants API with pydantic-ai multi-modal content Replace OpenAI's deprecated Assistants API (file_search, threads, polling) with pydantic-ai's native BinaryContent support. Files are now read from storage and passed directly in the prompt as multi-modal content — no upload/delete lifecycle needed. - Add content parameter to prompt() for multi-modal file attachments - Remove GenerativeAIWithFilesModelType abstract class and its upload/ delete/prompt_with_files methods - Remove get_client() from BaseOpenAIGenerativeAIModelType (no longer needed without file operations) - Replace AIFileManager.upload_files_from_file_field() with get_file_contents() returning BinaryContent objects - Simplify job_types.py: file+choice paths merge into single prompt() call with content and output_choices parameters - Remove format_prompt/parse_output hooks (no longer needed) - Remove FileId type alias and AIFileError exception - Works with any provider that supports documents (OpenAI, Anthropic, Mistral, Google) instead of only OpenAI * refactor(ai): unify prompt API into single method with output_type parameter Merge prompt_structured() into prompt() via the output_type parameter: - None (default): plain text response - list[str]: choice selection with fuzzy matching - Pydantic BaseModel/TypedDict: structured output via PromptedOutput Remove prompt_structured(), output_choices parameter, and dead code (format_prompt, parse_output hooks, AIFileError, FileId type). * refactor(ai): clean file handling API with model type owning processing logic Redesign file handling so the model type owns all file processing decisions (embed vs upload, size limits, count limits) while the manager only reads metadata from storage and provides a lazy reader callback. - Add supports_files flag and prepare_files() to GenerativeAIModelType base - OpenAI implementation: embeds images inline (BinaryContent, 50MB/500 limit), uploads documents (UploadedFile via Responses API) - Use OpenAIResponsesModel instead of OpenAIChatModel for OpenAI provider (supports all file types via input_file/input_image) - AIFileManager.prepare_file_content() collects metadata, passes lazy read_file callback — no data read until model type requests it - Remove is_file_compatible/get_max_file_size from public API (moved into prepare_files) - Add type hints throughout * fix(assistant): fix generate_formula tests and grid view row_height - Add output_type param to TestGenerativeAIModelTypePromptError.prompt() - Return BaserowFormulaModel in test mocks instead of raw JSON string - Use correct ORM field name row_height_size in grid view from_django_orm * docs: add AI field test plan * refactor(ai): improve docstrings, fix prompt signature and empty prompt handling * refactor(ai): merge ERROR_OUTPUT_PARSER into ERROR_GENERATIVE_AI_PROMPT The distinction between output parsing errors and prompt errors didn't provide actionable info to the user. Both now surface as a single ERROR_GENERATIVE_AI_PROMPT error code. * refactor(ai): move value generation into AIFieldHandler with AIFile abstraction Introduce AIFile dataclass that wraps serialized UserFile dicts with lazy read_content(). Move the core generation logic from AIValueGenerator._generate_value_for into AIFieldHandler.generate_value_with_ai so the handler owns the full flow: prompt resolution, file preparation, AI call, file cleanup, and choice resolution. - prepare_files() now takes list[AIFile] and returns only processed files - cleanup_files() mirrors prepare_files() for provider file cleanup - delete_file() takes AIFile instead of raw file_id string - AIFieldEmptyPromptError raised when prompt resolves to empty - Delete AIFileManager (absorbed into handler + model type) * docs: add AI field architecture overview * fix(ai): handle missing files and partial upload cleanup in prepare_files - OpenAI prepare_files() now catches per-file errors (missing files, upload failures) and skips them instead of failing the whole generation - Handler cleanup uses ai_files instead of prepared so files uploaded before a mid-prepare failure are still cleaned up * fix(ai): normalize LLM responses before choice matching Strip quotes, markdown bold, backticks, and trailing punctuation from model responses before fuzzy matching. Use case-insensitive comparison so responses like "POSITIVE" correctly match "Positive". * address feedback * Address feedback |
||
|
|
b65c7e77cb |
chore refactor (AI Assistant): context offloading; better telemetry data; add google and anthropic models compatibility (#4951)
* chore(deps): replace udspy with pydantic-ai and opentelemetry-sdk
Replace the udspy dependency with pydantic-ai-slim (with openai, groq,
anthropic, bedrock providers) and opentelemetry-sdk for structured
telemetry collection.
* fix(sentry): exclude pydantic_ai from auto-enabling integrations
sentry-sdk's pydantic_ai integration patches ToolManager._call_tool
which was removed in pydantic-ai >= 1.x (now execute_tool_call),
causing import-time errors.
* feat(settings): add dev log file mirroring and allow embeddings URL in tests
- Add BASEROW_LOG_FILE support in dev settings to mirror logs (including
loguru output) to a file, useful for AI-assisted debugging.
- Allow BASEROW_EMBEDDINGS_API_URL to be overridden via env in test
settings for search_user_docs eval tests.
* feat(assistant): add message_history field to AssistantChat
Add a BinaryField to store serialized pydantic-ai message history
(JSON bytes) for multi-turn conversation context, replacing the
previous udspy-based conversation state.
* refactor(assistant): port to pydantic-ai agent framework
Replace udspy with pydantic-ai as the agent framework for the AI
assistant. Key changes:
- Add Agent definitions with typed deps (AssistantDeps) and dynamic
toolsets for runtime tool loading
- Add deps module with AssistantDeps, ToolHelpers, and EventBus for
streaming events to the UI
- Add history module for serializing/deserializing pydantic-ai message
history to the database
- Add model_profiles for provider-specific configuration (Anthropic,
OpenAI, Groq, Bedrock)
- Add toolset module with ToolGroup base class replacing the udspy
tool registry pattern
- Add shared/ with formula_utils and sub-agent helpers
- Add tool_types.py per tool module for pydantic-ai ToolDefinition
- Port all tool modules (core, database, navigation, automation,
search_user_docs) from udspy decorators to pydantic-ai Tool instances
- Port assistant orchestrator, handler, and prompts
- Remove signatures.py (replaced by pydantic-ai output types)
* refactor(assistant): update telemetry for pydantic-ai
Rework telemetry collection to use pydantic-ai's message history
format and OpenTelemetry SDK for structured span/event recording,
replacing the previous udspy-based telemetry hooks.
* test(assistant): update unit tests for pydantic-ai port
Rewrite assistant unit tests to use pydantic-ai's testing utilities
(TestModel, FunctionModel) instead of udspy mocks. Add new test files
for core tools, navigation tools, and search docs tools. Remove
obsolete skip file.
* test(assistant): add LLM eval test suite
Add end-to-end eval tests that run the real agent against a live LLM
to verify tool selection, schema compatibility, and output quality.
Includes evals for: navigation, core builders, database tables/rows,
sample rows, automation workflows, search_user_docs, and cross-cutting
structured output validation.
Tests are marked with @pytest.mark.eval and skipped by default.
Configure via EVAL_LLM_MODEL or EVAL_LLM_MODELS env vars.
* docs: add eval guide and update AI assistant installation docs
- Add docs/development/ai-assistant-evals.md with instructions for
running the eval suite, configuring models, and writing new evals.
- Update docs/installation/ai-assistant.md to reflect pydantic-ai
provider configuration replacing the previous udspy setup.
* fix(assistant): fix test patch paths, optional filter args, and eval marker
- Fix mock patch paths from `assistant.agent` to `assistant.agents`
- Make ListTablesFilterArg fields optional to prevent LLM validation errors
- Surface field_errors in create_fields tool result
- Simplify EvalToolTracker to use message history inspection
- Register `eval` pytest marker and skip evals by default
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: move testing docs to docs/testing/ and add PR test plan
Move ai-assistant-evals.md from docs/development/ to docs/testing/,
add ai-assistant-test-plan.md with manual and automated test steps
for the pydantic-ai port PR.
* refactor(assistant): extract row models to types/rows.py, rename utils to helpers
- Move FieldDefinition, row model builders, and get_link_row_hints to
new types/rows.py module with dict-of-callables dispatch replacing
match/case
- Simplify update model: fields are optional (omit = don't change),
removing the __NO_CHANGE__ sentinel
- Move get_table_rows_tools into tools.py as _build_row_tools since it
builds pydantic-ai Tool objects
- Rename utils.py to helpers.py for clarity, remove dead list_tables
- Add docstrings with :param/:returns to all public functions, add
proper type annotations throughout
* refactor(assistant): flatten field/view/filter types into single models
- Replace per-type config classes in fields.py with a single flat
FieldItemCreate model using optional type-specific fields and a
model_validator for type aliases
- Simplify view_filters.py and views.py type hierarchies similarly
- Update table.py types and corresponding tests
* fix(assistant): improve telemetry span processor and minor tweaks
- Replace SpanExporter with SpanProcessor for real-time span handling
- Remap child tool spans past 'running tools' grouping span
- Parse JSON string arguments in tool call parts
- Add data_brief parameter to sample rows prompt
- Disable reasoning_effort for groq models temporarily
- Rename _fix_formula to _fix_formula_field in helpers
* refactor(assistant): use ISO strings for dates and add dateutil fallback
Replace Date/Datetime Pydantic model objects with compact ISO 8601
strings. Add lenient parsing via dateutil.parser fallback when
fromisoformat fails.
* feat(assistant): add DO/EXPLAIN agent modes with switch_mode tool
Introduce AgentMode enum (DO/EXPLAIN) and ModeAwareToolset that filters
available tools based on mode. DO mode (default) exposes all action
tools except search_user_docs. EXPLAIN mode exposes only read-only
tools (list_*, navigate) plus search_user_docs for answering Baserow
feature questions. The switch_mode tool allows bidirectional switching.
* refactor(assistant): flatten automation node types and add $formula: convention
Replace 13+ per-type action node classes (RouterNodeCreate, SendEmailActionCreate,
etc.) with a single flat ActionNodeCreate model using @model_validator for per-type
validation and dict-dispatched functions for ORM conversion and formula generation.
Add $formula: prefix convention — values prefixed with '$formula:' are sent to the
LLM formula generator, plain values become literal formulas. Also detect raw formula
expressions (get(), concat(), etc.) written inline.
Add trigger validation: periodic triggers now require periodic_interval (with
automatic folding of flat fields), row triggers require rows_triggers_settings.
* build: bump pydantic-ai-slim to 0.1.66 and anthropic to 0.84.0
* feat(assistant): add RetryingModel for transient provider error recovery
Wraps pydantic-ai model instances to automatically retry on transient
errors (rate limits, timeouts, server errors) with exponential backoff.
Handles both streaming and non-streaming calls.
* feat(assistant): add AgentMode system with ModeAwareToolset and switch_mode
Introduce domain modes (DATABASE, APPLICATION, AUTOMATION, EXPLAIN) that
control which tools are visible to the agent. ModeAwareToolset filters
the combined toolset per-mode, registries generate per-mode manifests,
and switch_mode lets the agent transition between domains. Each mode
gets a cross-mode summary so the agent knows what other modes offer.
* refactor(assistant): integrate RetryingModel, event-based streaming, and JSON retry
Replace direct model usage with RetryingModel for resilience. Rewrite
streaming to use run_stream_events for proper text/reasoning/tool event
handling. Add JSON-tool-call-as-text detection with automatic retry.
Auto-detect starting mode from UI context. Update model_profiles with
max_tokens settings.
* refactor(assistant): improve shared formula utils and add formula language reference
Add RAW_FORMULA_RE for detecting raw formula expressions, needs_formula()
for $formula: prefix and raw formula detection, literal_or_placeholder()
for ORM value creation, and a shared formula language prompt. Improve
formula generator to track remaining unresolved fields across retries.
* refactor(assistant): improve database tools with routing rules and type fixes
Add per-module routing rules via get_routing_rules(). Extract ToolInputError
to helpers. Fix field type validators, improve row model handling, and
refine view filter types. Update agents and prompts for better tool
guidance.
* refactor(assistant): improve automation tools with routing rules and formula handling
Add per-module routing rules for automation. Improve node type handling
with better formula context support. Refine automation agents and prompts.
* fix(assistant): improve telemetry span processor with real-time remapping
Enhance SpanProcessor with JSON arg parsing, real-time span remapping,
and improved trace output handling. Update tests to cover new behavior.
* test(assistant): update tests for mode system, retry logic, and type refactors
Add tests for switch_mode, mode-aware manifests, JSON retry logic.
Add test_assistant_automation_node_tools and test_assistant_database_field_tools.
Update existing database/automation/core tests for refactored types and
new tool signatures. Update eval_utils for new deps structure.
* fix: lint
* chore(frontend): ignore .claude dir in vite watcher and fix Nitro EMFILE
- Add .claude/ to vite server watch ignore list alongside node_modules
and .git to avoid unnecessary file watching in worktrees.
- Configure Nitro devStorage to use fs-lite driver to prevent chokidar
from watching the entire repo root, which causes EMFILE on macOS in
large monorepos.
* fix(tests): fix test settings and seat usage test isolation with xdist
- Ensure pytest always finds backend/pytest.ini by passing -c pytest.ini
explicitly, fixing DJANGO_SETTINGS_MODULE=dev when running from root
- Preserve existing TEST dict keys when setting MIGRATE in test settings
- Add transaction=True to seat usage tests to prevent data leaking from
TransactionTestCase tests running on the same xdist worker
* fix(assistant): fix field types, formula regex, validator guard, and consolidate evals
Fix multiple_select returning None instead of [], link_row description
typo, formula regex missing greater_than_or_equal/less_than_or_equal
variants, and guard against overwriting original validators on repeated
prepare_tools calls. Consolidate sample rows and navigation evals into
the database tables eval file and remove the meta tool-call history test.
* fix(assistant): improve tool return types, filter aliases, and eval infrastructure
- Return consistent dict types from all tools instead of plain strings
- Add operator aliases for view filters so LLMs can use natural names
- Fix boolean filter operator (is → equal)
- Remove reasoning format from UTILITY model profiles (pollutes structured output)
- Add ModelRetry for workflow creation and formula agent errors
- Add EvalChecklist for soft assertions with pass/fail scoring
- Add EVAL_RETRIES support for flake detection in eval tests
- Suppress loguru DEBUG noise during evals
* refactor(assistant): extract table creation helpers and remove unused model profile
- Extract _create_empty_tables and _create_table_fields from create_tables
- Filter out duplicate primary field in field creation to avoid model mistakes
- Remove unused gpt-oss-20b model profile
- Always attempt sample rows regardless of field errors
* fix(assistant): strip <think> tags and unify streaming as reasoning chunks
Models like MiniMax-M2.5 emit <think>...</think> tags inline. Handle
ThinkingPart/ThinkingPartDelta events from pydantic-ai and extract
inline thinking from text parts as a fallback. Stream all content as
AiReasoningChunk during the agent run; the final answer is emitted
as AiMessageChunk by _emit_answer.
* fix(assistant): simplify streaming and add collapsible reasoning UI
Replace _accumulate_text/_extract_thinking with a single _get_content_delta
helper that forwards text/thinking deltas. Accumulate reasoning_so_far and
strip <think> tags before sending to frontend (which replaces content on
each chunk). Add collapsible reasoning bubble (max 250px with fade mask
and chevron toggle).
* fix(assistant): bridge legacy UDSPY_LM_* env vars to pydantic-ai config
* docs(assistant): improve ai-assistant.md and add AWS_REGION_NAME backward compat
- Add both Bedrock auth methods (boto3 creds + bearer token)
- Add section 6 with pydantic-ai model overview link and provider list
- Restructure migration table: unchanged / bridged / new variables
- Fix AWS_BEARER_TOKEN_BEDROCK incorrectly listed as removed
- Bridge AWS_REGION_NAME to AWS_DEFAULT_REGION in settings for backward compat
* minor doc/evals fixes
* fix(assistant): strip unclosed <think> tags during streaming
Models behind Groq emit <think> tags as text content rather than using
the native thinking protocol. During streaming, the closing </think>
tag may not have arrived yet, causing raw thinking content to leak to
the frontend. Also strip think tags from tool thought fields and reset
reasoning on tool results.
* docs(assistant): use provider:model format and refresh eval docs
- Update all docs to use pydantic-ai provider:model format (colon separator)
- Fix mixed-up provider descriptions in configuration.md
- Refresh eval docs: replace assert_no_tool_errors with EvalChecklist pattern
- Add embeddings URL for local vs Docker in ai-assistant-evals.md
- Skip KB sync post_migrate signal during tests
- Fix temperature type in model_profiles.py
- Refactor justfile PYTHONPATH for test recipe
* fix(assistant): clean up navigation and improve tool types
- Remove unused WorkspaceNavigationRequestType
- Narrow exception catch in navigate tool to ObjectDoesNotExist
- Guard id field in CreateRowModel.from_django_orm
- Use id__in for batch filtering in ListTablesFilterArg
* Revert "chore(frontend): ignore .claude dir in vite watcher and fix Nitro EMFILE"
This reverts commit
|