Skip to content

feat: files meta tool#18512

Merged
Dakuan merged 15 commits intomasterfrom
feat/files-meta-tool
Apr 14, 2026
Merged

feat: files meta tool#18512
Dakuan merged 15 commits intomasterfrom
feat/files-meta-tool

Conversation

@Dakuan
Copy link
Copy Markdown
Contributor

@Dakuan Dakuan commented Apr 10, 2026

Description

  • adds a tool that allows agents to query what documents are in the knowledge base

note: real struggle getting the tests to pass, related to resolving workspace ID turned into a whackmole game where Id fix one test and then another would fail. Probably exposing 'just so' test scaffolding existing before.

Screenshots

Screen.Recording.2026-04-10.at.10.43.54.mov

@Dakuan Dakuan force-pushed the feat/files-meta-tool branch from 06a6228 to 367ce22 Compare April 10, 2026 12:33
@github-actions github-actions bot added size/xl and removed size/l labels Apr 13, 2026
@Dakuan
Copy link
Copy Markdown
Contributor Author

Dakuan commented Apr 13, 2026

@cubic-dev-ai

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai bot commented Apr 13, 2026

@cubic-dev-ai

@Dakuan I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@Dakuan Dakuan force-pushed the feat/files-meta-tool branch from 27d172c to 866e244 Compare April 13, 2026 08:44
@Dakuan Dakuan marked this pull request as ready for review April 13, 2026 08:46
@Dakuan Dakuan changed the title Feat/files meta tool feat: files meta tool Apr 13, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 11 files

Confidence score: 4/5

  • This PR is likely safe to merge, with one moderate issue: packages/server/src/ai/tools/budibase/knowledgeFiles.ts appears to compute total and status counts from filtered matches instead of all attached files.
  • Impact is mainly reporting accuracy (incorrect totals/status breakdown), which can mislead users but is unlikely to break core functionality, so risk stays moderate rather than high.
  • Given the single 5/10 issue and otherwise limited evidence of broader regressions, merge risk looks minimal-to-moderate overall.
  • Pay close attention to packages/server/src/ai/tools/budibase/knowledgeFiles.ts - ensure total and status counts are derived from all attached files, not only filtered results.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/server/src/ai/tools/budibase/knowledgeFiles.ts">

<violation number="1" location="packages/server/src/ai/tools/budibase/knowledgeFiles.ts:233">
P2: Compute `total` and the status counts from all attached files, not just the filtered matches.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.


return {
matchedCount: metadata.length,
total: metadata.length,
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Compute total and the status counts from all attached files, not just the filtered matches.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/server/src/ai/tools/budibase/knowledgeFiles.ts, line 233:

<comment>Compute `total` and the status counts from all attached files, not just the filtered matches.</comment>

<file context>
@@ -0,0 +1,250 @@
+
+      return {
+        matchedCount: metadata.length,
+        total: metadata.length,
+        ambiguous: isAmbiguous,
+        bestMatch,
</file context>
Fix with Cubic

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/server/src/automations/tests/steps/getRow.spec.ts">

<violation number="1" location="packages/server/src/automations/tests/steps/getRow.spec.ts:15">
P2: Add a matching `automation.shutdown()` in `afterAll`; this new `automation.init()` starts a long-lived queue worker and now leaves it running after the spec finishes.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread packages/server/src/automations/tests/steps/getRow.spec.ts
@Dakuan Dakuan force-pushed the feat/files-meta-tool branch from ca49532 to f5b882b Compare April 13, 2026 10:50
@github-actions github-actions bot added size/l and removed size/xl labels Apr 13, 2026
Copy link
Copy Markdown
Member

@adrinr adrinr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason this came as a source. In this case, the response is fine, but the "sources" should be empty

Image

Copy link
Copy Markdown
Member

@adrinr adrinr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this should be the default behaviour... This might leak some information to the end user

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/server/src/api/controllers/ai/chatConversations.ts">

<violation number="1" location="packages/server/src/api/controllers/ai/chatConversations.ts:448">
P2: Only suppress `ragSources` after a successful `list_knowledge_files` result. Marking the flag at tool-call time hides sources even when the tool fails.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread packages/server/src/api/controllers/ai/chatConversations.ts Outdated
@github-actions github-actions bot added size/xl and removed size/l labels Apr 13, 2026
Copy link
Copy Markdown
Member

@adrinr adrinr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice job. And it's great to see so many tests :)

if (!agentId) {
throw new Error("Agent _id is required")
}
const hasKnowledgeBases = agent.knowledgeBases?.some(Boolean) ?? false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this instead of just the classic agent.knowledgeBases?.length?

Copy link
Copy Markdown
Member

@adrinr adrinr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to tick it ✅

@Dakuan Dakuan enabled auto-merge April 14, 2026 12:47
@Dakuan Dakuan merged commit 85122e1 into master Apr 14, 2026
34 checks passed
@Dakuan Dakuan deleted the feat/files-meta-tool branch April 14, 2026 12:54
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants