-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(kb-upload): fix and consolidate KB file uploads logic #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Consolidates and fixes knowledge base file upload functionality by implementing a new centralized approach with dedicated configurations and endpoints.
- Added new
useKnowledgeUploadhook inapps/sim/app/workspace/[workspaceId]/knowledge/hooks/use-knowledge-upload.tsto centralize upload logic - Created KB-specific presigned URL endpoint in
apps/sim/app/api/knowledge/presigned/route.tsusing dedicated storage configs - Fixed
base.tsxto properly use presigned URL endpoints for KB file uploads - Added KB-specific download handling in
apps/sim/app/api/files/serve/[...path]/route.tswith support for both Azure Blob and S3 - Improved separation of concerns by moving file processing logic from components to the hook
5 files reviewed, 9 comments
Edit PR Review Bot Settings | Greptile
apps/sim/app/workspace/[workspaceId]/knowledge/hooks/use-knowledge-upload.ts
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/knowledge/hooks/use-knowledge-upload.ts
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/knowledge/hooks/use-knowledge-upload.ts
Show resolved
Hide resolved
|
✅ No security or compliance issues detected. Reviewed everything up to f7ecf47. Security Overview
Detected Code Changes
Reply to this PR with |
…v to next/prev chunk on edit chunk modal
* feat(function): added more granular error logs for function execution for easier debugging (#593) * added more granular error logs for function execution * added tests * fixed syntax error reporting * feat(models): added temp controls for gpt-4.1 family of models (#594) * improvement(knowledge-upload): create and upload document to KB (#579) * improvement: added knowledge upload * improvement: added greptile comments (#579) * improvement: changed to text to doc (#579) * improvement: removed comment (#579) * added input validation, tested persistence of KB selector * update docs --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> Co-authored-by: Waleed Latif <walif6@gmail.com> * fix(remove workflow.state usage): no more usage of deprecated state column in any routes (#586) * fix(remove workflow.state usage): no more usage of deprecated state col in routes * fix lint * fix chat route to only use deployed state * fix lint * better typing * remove useless logs * fix lint * restore workflow handler file * removed all other usages of deprecated 'state' column from workflows table, updated tests --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local> Co-authored-by: Waleed Latif <walif6@gmail.com> * fix(doc-selector-kb): enable doc selector when kb is selected (#596) Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan> * fix(unload): remove beforeunload warning since we communicate via wss (#597) * fix(executor): fix dependency resolution, allow blocks with multiple inputs to execute (#598) * feat(billing): added migrations for usage-based billing (#601) * feat(billing): added migrations for usage-based billing * lint * lint * feat(logging): add new schemas + types for new logging system (#599) * feat(logging): add new schemas + types for logging * fix lint * update migration * fix lint * Remove migration 48 to avoid conflict with staging * fixed merge conflict * fix lint --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net> * fix(createWorkflow): cleanup create workflow to prevent re-renders (#607) * fix(createWorkflow): no more client side id, duplicate schedules calls * fix lint * more cleanup * fix lint * fix spamming of create button causing issues * fix lint * add more colors + default workflow name changed * Update apps/sim/stores/workflows/registry/utils.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(telegram): added markdown text rendering (#611) * fix: added proper markdown * fix: reverted route.ts file --------- Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local> * fix(kb-upload): fix and consolidate KB file uploads logic (#610) * fix(kb-upload): fix and consolidate logic * fix lint * consolidated presigned routes, fixed temp id kb store issue, added nav to next/prev chunk on edit chunk modal * fix ci test --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan> Co-authored-by: Waleed Latif <walif6@gmail.com> --------- Co-authored-by: Waleed Latif <walif6@gmail.com> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
* feat(function): added more granular error logs for function execution for easier debugging (simstudioai#593) * added more granular error logs for function execution * added tests * fixed syntax error reporting * feat(models): added temp controls for gpt-4.1 family of models (simstudioai#594) * improvement(knowledge-upload): create and upload document to KB (simstudioai#579) * improvement: added knowledge upload * improvement: added greptile comments (simstudioai#579) * improvement: changed to text to doc (simstudioai#579) * improvement: removed comment (simstudioai#579) * added input validation, tested persistence of KB selector * update docs --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> Co-authored-by: Waleed Latif <walif6@gmail.com> * fix(remove workflow.state usage): no more usage of deprecated state column in any routes (simstudioai#586) * fix(remove workflow.state usage): no more usage of deprecated state col in routes * fix lint * fix chat route to only use deployed state * fix lint * better typing * remove useless logs * fix lint * restore workflow handler file * removed all other usages of deprecated 'state' column from workflows table, updated tests --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local> Co-authored-by: Waleed Latif <walif6@gmail.com> * fix(doc-selector-kb): enable doc selector when kb is selected (simstudioai#596) Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan> * fix(unload): remove beforeunload warning since we communicate via wss (simstudioai#597) * fix(executor): fix dependency resolution, allow blocks with multiple inputs to execute (simstudioai#598) * feat(billing): added migrations for usage-based billing (simstudioai#601) * feat(billing): added migrations for usage-based billing * lint * lint * feat(logging): add new schemas + types for new logging system (simstudioai#599) * feat(logging): add new schemas + types for logging * fix lint * update migration * fix lint * Remove migration 48 to avoid conflict with staging * fixed merge conflict * fix lint --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net> * fix(createWorkflow): cleanup create workflow to prevent re-renders (simstudioai#607) * fix(createWorkflow): no more client side id, duplicate schedules calls * fix lint * more cleanup * fix lint * fix spamming of create button causing issues * fix lint * add more colors + default workflow name changed * Update apps/sim/stores/workflows/registry/utils.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(telegram): added markdown text rendering (simstudioai#611) * fix: added proper markdown * fix: reverted route.ts file --------- Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local> * fix(kb-upload): fix and consolidate KB file uploads logic (simstudioai#610) * fix(kb-upload): fix and consolidate logic * fix lint * consolidated presigned routes, fixed temp id kb store issue, added nav to next/prev chunk on edit chunk modal * fix ci test --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan> Co-authored-by: Waleed Latif <walif6@gmail.com> --------- Co-authored-by: Waleed Latif <walif6@gmail.com> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@vikhyaths-air.lan> Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-Air.attlocal.net> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
Description
base.tsx was not using presigned URL endpoint. Also the KB configs were not being used by regular upload endpoint. So separate endpoint for KB uploads now. Accessible client function via a shared hook so there's no difference in upload location.
Type of change
How Has This Been Tested?
PLEASE TEST WITH S3. I tested with Azure Blob KB config.
Screen.Recording.2025-07-03.at.11.28.23.AM.mov
Checklist:
bun run test)Security Considerations: