Skip to content

fix(knowledge): expose create document ID output - #7278

Open
BillLeoutsakosvl346 wants to merge 2 commits into
stagingfrom
investigate/kb-create-document-output
Open

fix(knowledge): expose create document ID output#7278
BillLeoutsakosvl346 wants to merge 2 commits into
stagingfrom
investigate/kb-create-document-output

Conversation

@BillLeoutsakosvl346

@BillLeoutsakosvl346 BillLeoutsakosvl346 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restores the declared top-level documentId output for Knowledge Create Document.
  • Preserves the existing data.documentId path for backward compatibility.
  • Derives the identifier once with the existing documentId, legacy id, then empty-string fallback.
  • Confirms empty or omitted document tags remain omitted from the API request and tag-value secret provenance.

Type of Change

  • Bug fix
  • 新建 feature
  • Breaking change
  • Documentation
  • Other

Testing

  • Focused Vitest: 2 files passed, 18 tests passed.
  • App TypeScript check: passed.
  • Targeted Biome check: passed with no fixes required.
  • API validation audit: passed.

Reviewer focus:

  • output.documentId and output.data.documentId remain identical.
  • Legacy id responses still populate both paths.
  • Missing or empty created-document results retain the existing successful response with empty IDs.
  • Knowledge bases without tag definitions continue to omit the tag parameter from enriched schemas.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement

Screenshots/Videos

Not applicable; this is a tool response-shape fix with no UI changes.

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment 操作 Updated (UTC)
docs Skipped Skipped Aug 29, 2026 6:44pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restores the declared top-level document ID in the Knowledge Create Document response while preserving the nested compatibility path.

  • Derives the created document identifier once and returns it through both output.documentId and output.data.documentId.
  • Updates the response type to include the top-level identifier.
  • Adds coverage for current, legacy, missing, and empty identifier responses.
  • Verifies that empty or omitted document tags remain absent from requests and provenance metadata.

Confidence Score: 5/5

The PR appears safe to merge, with the response implementation, type, and tests consistently exposing the document ID through both supported paths.

The change aligns runtime output with the existing declared schema, preserves the prior nested field and fallback behavior, and introduces no accepted correctness or security issue.

Important Files Changed

Filename Overview
apps/sim/tools/knowledge/create_document.ts Reuses one identifier derivation for the newly restored top-level output and the existing nested output without changing fallback behavior.
apps/sim/tools/knowledge/types.ts Aligns the response interface with the declared and returned top-level documentId field.
apps/sim/tools/knowledge/knowledge.test.ts Covers identifier compatibility and omission of empty document-tag request and provenance data.
apps/sim/tools/schema-enrichers.test.ts Adds an assertion that knowledge bases without tag definitions produce no enriched tag schema.

Reviews (1): Last reviewed commit: "fix(knowledge): expose create document I..." | Re-trigger Greptile

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

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

Re-trigger cubic

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant