[DASHBOARDS] chat agent improvements + new validation layer#17722
[DASHBOARDS] chat agent improvements + new validation layer#17722FelixMalfait merged 41 commits intomainfrom
Conversation
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:2063 This environment will automatically shut down when the PR is closed or after 5 hours. |
There was a problem hiding this comment.
1 issue found across 21 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-server/src/modules/dashboard/tools/utils/resolve-group-by.util.ts">
<violation number="1" location="packages/twenty-server/src/modules/dashboard/tools/utils/resolve-group-by.util.ts:182">
P2: The relation fallback warns that it is defaulting to "${field.name}Id", but the returned subFieldName is undefined, so no default is applied. Either set the subFieldName to the id field or adjust the warning to match the actual behavior to avoid misleading output and incorrect grouping.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
packages/twenty-server/src/modules/dashboard/tools/utils/resolve-group-by.util.ts
Outdated
Show resolved
Hide resolved
Greptile OverviewGreptile SummaryThis PR improves the dashboards chat agent by (1) enriching the AI browsing context on record pages with On the server side it also adds real validation for chart widget field references in Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant FE as twenty-front (useGetBrowsingContext)
participant AI as ChatExecutionService
participant Tools as Dashboard Tools
participant Cache as FlatEntityMapsCacheService
participant PL as PageLayoutService
participant W as PageLayoutWidgetService
U->>FE: Navigate record page / dashboards
FE->>FE: Read selectedRecordId + pageLayoutId
FE->>FE: Read activeTabId for tab list instance
FE-->>AI: BrowsingContext(recordId, pageLayoutId?, activeTabId?)
AI->>AI: buildRecordPageContext(..., pageLayoutId?, activeTabId?)
AI-->>Tools: Agent chooses get_dashboard / add_dashboard_tab / update_dashboard_widget
Tools->>Cache: getOrRecomputeManyOrAllFlatEntityMaps(flatFieldMetadataMaps)
Tools->>PL: findByIdOrThrow(pageLayoutId)
PL-->>Tools: tabs + widgets + raw configuration
Tools->>Tools: Enrich graph widget config with _resolved (labels/paths)
Tools-->>AI: Dashboard layout response
AI->>W: create/update widget (rich text or graph)
W->>Cache: getOrRecomputeManyOrAllFlatEntityMaps(fields + objects)
W->>W: validateChartConfigurationFieldReferences()
W-->>AI: success / INVALID_PAGE_LAYOUT_WIDGET_DATA
|
packages/twenty-front/src/modules/ai/hooks/useBrowsingContext.ts
Outdated
Show resolved
Hide resolved
...ages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/chat-execution.service.ts
Outdated
Show resolved
Hide resolved
...ages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/chat-execution.service.ts
Outdated
Show resolved
Hide resolved
...ages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/chat-execution.service.ts
Outdated
Show resolved
Hide resolved
...ages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/chat-execution.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/dashboard/tools/services/dashboard-tool.workspace-service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/dashboard/tools/utils/split-field-path.util.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
2 issues found across 4 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/twenty-server/src/modules/dashboard/tools/update-dashboard-widget.tool.ts">
<violation number="1" location="packages/twenty-server/src/modules/dashboard/tools/update-dashboard-widget.tool.ts:60">
P2: Type-only updates can bypass GRAPH configuration validation. Include `parameters.type` in the validation gate so switching to GRAPH triggers the required configuration check.</violation>
</file>
<file name="packages/twenty-server/src/modules/dashboard/tools/create-complete-dashboard.tool.ts">
<violation number="1" location="packages/twenty-server/src/modules/dashboard/tools/create-complete-dashboard.tool.ts:140">
P2: GRAPH widgets can still accept non-graph configuration types (e.g., IFRAME) because the new validation returns early for non-graph configurationType. This allows invalid GRAPH widgets to be created even after the added checks. Add an explicit check that GRAPH widgets must use one of the graph configuration types (or extend validateGraphWidgetConfiguration to error when widgetType is GRAPH and configurationType isn’t a graph type).</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
packages/twenty-server/src/modules/dashboard/tools/update-dashboard-widget.tool.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/dashboard/tools/create-complete-dashboard.tool.ts
Outdated
Show resolved
Hide resolved
...r/src/engine/metadata-modules/page-layout-widget/utils/build-fields-by-object-id-map.util.ts
Outdated
Show resolved
Hide resolved
...rver/src/engine/metadata-modules/page-layout-widget/utils/validate-relation-subfield.util.ts
Show resolved
Hide resolved
|
@ehconitin sorry about that, we have merge a bit PR today, could you fix conflicts and CI? |
…ents' into dashboards-chat-agent-improvements
LogDetails |
|
Hey @ehconitin! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
1 similar comment
|
Hey @ehconitin! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
CleanShot.2026-02-05.at.00.24.04.mp4
CleanShot.2026-02-05.at.00.27.54.mp4