Skip to content

Conversation

@Prasad2291
Copy link
Contributor

Description

Testing

Additional Notes

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 26, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch main

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Prasad2291, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a suite of significant improvements across the application, enhancing both developer experience and user functionality. It standardizes commit practices, refines deployment strategies for core services like Vespa and Prometheus, and expands the frontend's ability to display diverse document types. The workflow builder is now more robust with dynamic agent creation and better change management, while new features for user and API key administration provide greater control and security. A core focus has also been placed on improving the accuracy and relevance of AI interactions through comprehensive timezone awareness.

Highlights

  • Commitizen and Husky Integration: Introduced Husky hooks and Commitizen configuration to enforce conventional commit messages, ensuring consistent commit formatting and enabling automated release management.
  • Vespa Deployment and Configuration Updates: Updated Vespa Dockerfiles and Docker Compose configurations to use specific Vespa image versions, streamlined ONNX runtime installation, and added advanced JVM arguments for better memory management and GPU resource allocation. Prometheus configurations were also updated to support dynamic port injection using envsubst.
  • Enhanced Frontend Document Viewers: Added new frontend components for viewing CSV, Excel, and plain text files. The PDF viewer was refactored to use react-pdf with virtualized scrolling and improved navigation, along with a new debug modal for inspecting Vespa document data.
  • Improved ChatBox Functionality: Refactored the ChatBox component to use a new SmartTooltip component, directly utilize useToast for notifications, and implement more robust model selection logic with localStorage persistence. The Enter key behavior was refined, and clipboard copy now cleans citation numbers from the response text.
  • Workflow Builder Enhancements: The Workflow Builder received significant updates, including dynamic agent creation for AI agent tools, a workflow hashing mechanism to track unsaved changes, and integration of Snackbar and ConfirmationPopup for user feedback. The header component was also refactored to support saving and refreshing workflows with proper change management.
  • Comprehensive User and API Key Management: New API endpoints and a dedicated frontend page were introduced for managing users, including listing logged-in and ingested users, updating user roles, and triggering manual syncs for Google Workspace and Slack. A robust API key management system was implemented, allowing users to generate, list, and revoke API keys with granular scope and agent access controls.
  • Timezone Awareness in AI Interactions: Implemented timezone handling across various AI prompts and context builders, ensuring that all date and time mentions in AI responses and internal processing respect the user's local timezone.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a wide range of significant features and refactorings across the deployment, frontend, and backend. Key changes include the integration of Commitizen for standardized commits, major enhancements to deployment scripts for better configuration and robustness, and a complete overhaul of the PDF viewer on the frontend for improved performance and features. The backend sees substantial updates with new user management APIs, API key scope enforcement for security, and more sophisticated handling of data context in chat and agent interactions, including timezone awareness. While the overall changes are impressive and move the project forward, I've identified a critical issue in the workflow logic where AI agents are created on every execution, which needs to be addressed. I've also noted a few areas for improvement in code clarity and potential performance optimizations.

Comment on lines 2375 to 2424
if (tool.type === "ai_agent") {
processedConfig = {
...processedConfig,
inputType: "form"
try {
Logger.info(`Creating agent for AI agent tool: ${JSON.stringify(tool.value)}`)

// Extract agent data from tool configuration
const agentData: CreateAgentPayload = {
name: tool.value?.name || `Workflow Agent - ${template.name}`,
description: tool.value?.description || "Auto-generated agent for workflow execution",
prompt: tool.value?.systemPrompt || "You are a helpful assistant that processes workflow data.",
model: tool.value?.model || "googleai-gemini-2-5-flash", // Use model from tool config
isPublic: false, // Workflow agents are private by default
appIntegrations: [], // No app integrations for workflow agents
allowWebSearch: false, // Disable web search for workflow agents
isRagOn: false, // Disable RAG for workflow agents
uploadedFileNames: [], // No uploaded files for workflow agents
docIds: [], // No document IDs for workflow agents
userEmails: [] // No additional users for permissions
}

Logger.info(`Creating agent with data: ${JSON.stringify(agentData)}`)

// Create the agent using createAgentForWorkflow
const newAgent: SelectAgent = await createAgentForWorkflow(agentData, userId, workspaceInternalId)

Logger.info(`Successfully created agent: ${newAgent.externalId} for workflow tool`)

// Store the agent ID in the tool config for later use
processedConfig = {
...processedConfig,
inputType: "form",
agentId: newAgent.externalId, // ← This replaces the hardcoded agent ID
createdAgentId: newAgent.externalId, // Store backup reference
agentName: newAgent.name,
dynamicallyCreated: true // Flag to indicate this was auto-created
}

Logger.info(`Tool config updated with agent ID: ${newAgent.externalId}`)

} catch (agentCreationError) {
Logger.error(agentCreationError, `Failed to create agent for workflow tool, using fallback config`)

// Fallback to original behavior if agent creation fails
processedConfig = {
...processedConfig,
inputType: "form",
agentCreationFailed: true,
agentCreationError: agentCreationError instanceof Error ? agentCreationError.message : String(agentCreationError)
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

A new AI agent is created every time this tool is executed in a workflow. This will lead to a large number of agents being created, which is inefficient and will quickly pollute the agents table. This could also incur unnecessary costs and management overhead.

Consider implementing a strategy to reuse agents. For example, you could create a single, dedicated agent for this workflow tool when the workflow template is created, and then reuse that agent's ID for all subsequent executions. Alternatively, you could search for an existing agent with a specific name or tag before creating a new one.

Comment on lines +43 to 48
// Ensure unique names per owner (excluding soft-deleted items)
uniqueOwnerName: uniqueIndex(
"unique_owner_collection_name_not_deleted",
)
.on(table.workspaceId, table.name)
.on(table.ownerId, table.name)
.where(sql`${table.deletedAt} IS NULL`),
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The unique constraint for collection names has been changed from (workspaceId, name) to (ownerId, name). This is a significant semantic change. It implies that collection names must now be unique per user across the entire system, rather than unique within a workspace. This could prevent different users in the same workspace from creating collections with the same name (e.g., "My Documents"). Please confirm if this change was intentional, as it might impact user experience.

Comment on lines 145 to 152
{isNumericChild ? !(citation && citation.title?.endsWith(".pdf") && citation.chunkIndex !== undefined) ? (
<span
className="inline-flex items-center justify-center min-w-[18px] h-[18px] px-[6px] py-[2px] mx-[2px] bg-gray-200 hover:bg-gray-300 dark:bg-gray-900 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300 rounded-full text-[10px] font-mono font-medium cursor-pointer transition-colors duration-150 no-underline"
style={{ textDecoration: "none" }}
>
{children}
</span>
) : (
children
)}
) : undefined : ( children )}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The nested ternary operator here makes the logic difficult to follow. Consider refactoring this for better readability by extracting the condition into a boolean variable. This will make the component's rendering logic clearer and easier to maintain.

        const shouldRenderStyledCitation = isNumericChild && !(citation && citation.title?.endsWith(".pdf") && citation.chunkIndex !== undefined);

        return shouldRenderStyledCitation ? (
          <span
            className="inline-flex items-center justify-center min-w-[18px] h-[18px] px-[6px] py-[2px] mx-[2px] bg-gray-200 hover:bg-gray-300 dark:bg-gray-900 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300 rounded-full text-[10px] font-mono font-medium cursor-pointer transition-colors duration-150 no-underline"
            style={{ textDecoration: "none" }}
          >
            {children}
          </span>
        ) : ( children );

Comment on lines +661 to 683
const collectionitems = await getAllCollectionAndFolderItems(
collectionFolderIds,
db,
)
const collectionPgFileIds = collectionitems.fileIds
const collectionPgFolderIds = collectionitems.folderIds

if (collectionFolderIds.length > 0) {
const ids = await getCollectionFilesVespaIds(collectionFileIds, db)
const vespaIds = ids
const ids = await getCollectionFilesVespaIds(collectionPgFileIds, db)
const vespaFileIds = ids
.filter((item) => item.vespaDocId !== null)
.map((item) => item.vespaDocId!)
fileIds.push(...vespaIds)
fileIds.push(...vespaFileIds)
const folderVespaIds = await getCollectionFoldersItemIds(
collectionPgFolderIds,
db,
)

const vespaFolderIds = folderVespaIds
.filter((item) => item.id !== null)
.map((item) => item.id!)
collectionIds.push(...vespaFolderIds)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This function recursively fetches all items within specified folders. For deeply nested or very large collections, this could lead to performance issues due to multiple database queries in a loop. Consider adding safeguards like a depth limit or fetching items in a more optimized way, perhaps with a recursive CTE if the database supports it, to prevent potential performance bottlenecks.

Comment on lines 1806 to 1960
const toEmail = emailConfig.to_email || emailConfig.recipients || []
const fromEmail = emailConfig.from_email || "[email protected]"
const subject = emailConfig.subject || "Workflow Results"

const contentType = emailConfig.content_type || "html"
const [execution] = await db
.select()
.from(workflowExecution)
.where(eq(workflowExecution.id, executionId))

const workflowName = execution?.name || "Unknown Workflow"
const subject = emailConfig.subject || `Results of Workflow: ${workflowName}`
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Fetching the workflowName from the database inside a loop can be inefficient, especially if the same workflow is processed multiple times. It would be more performant to fetch the execution details, including the name, once outside the loop and pass it down or access it from a shared context.

Aayushjshah and others added 22 commits October 1, 2025 12:17
* build(scripts): add circular dependency check to dev and build workflows

- Introduce `check-deps` script using madge to detect circular imports.
- Wire `check-deps` into the default `dev` and `build` npm scripts.
- Add `check-deps:unsafe` variants that skip the circular dependency check for optional bypass.

* refactor(server): centralise shared services

- Extract PgBoss queue client into `boss.ts` and replace duplicated configuration in `queue/index.ts` and other files with a single exported instance.
- Create `vespaService.ts` that provides a shared Vespa service, imported by `search/vespa.ts` and `search/utils.ts`.
- Remove repeated configuration and schema imports across modules.
- Simplify dependency management and reduce code duplication throughout the server.

* fix: XYN-302 addressed bot comments

* refactor(config): centralise database URL extraction

- Replace placeholder DB URL in config.ts with real Postgres connection string
- Expose getDatabaseUrl() to provide the connection string
- Update boss.ts to use getDatabaseUrl() instead of hard‑coded URL
- Keeps queue configuration DRY and provides a single source of truth for the DB URL
…#1021)

* fix(agentPathSupport): path referenced folder are now consider as source to that agent

* fix(agentPathSupport): resolved comments

* fix(agentPathSupport): resolved comments

* fix(agentPathSupport): resolved comments
* fix(livekit-script): added livekit script in infra

* fix(livekit-script): made the suggested changes

* fix(livekit-script): made the suggested changes
* fix(file-upload): trigger upload of file on file select

* chore(file-upload): resolved comments

* chore(file-upload): resolved comments

* chore(file-upload): resolved comments

* chore(file-upload): resolved comments

---------

Co-authored-by: Ravishekhar Yadav <[email protected]>
* fix(fileProcessing-status): updated backend for upload-status

* fix(fileProcessing-status): quick changes

* fix(fileProcessing-status): quick changes

* fix(fileProcessing-status): quick changes
* feat(metadataPaddle): resolving commentsD

* feat(paddle): removing selectedFiles

* Update vespa package

* feat(paddle): resolving comments

---------

Co-authored-by: Junaid <[email protected]>
* fix(upload-state): frontend changes to catter poll

* fix(upload-state): frontend changes to catter poll
semantic-release-bot and others added 30 commits October 29, 2025 13:01
## [3.23.7](v3.23.6...v3.23.7) (2025-10-29)

### Bug Fixes

* **migrate-datasource:** Migrate datasource to knowledgeBase ([#1136](#1136)) ([3fa075b](3fa075b))
…djust proxy settings (#1146)

- Raise NGINX `client_max_body_size` to 1 GB.
- Expand CSP to allow Google Fonts and generic WebSocket/HTTPS connections.
- Switch main application backend from env‑controlled port 3001 to hard‑coded port 3002.
- Remove upstream documentation and location blocks.
- Update proxy settings for primary app routes: 600‑second timeouts, buffering disabled.
- Simplify backend configuration and improve handling of heavy or streaming requests.
## [3.23.8](v3.23.7...v3.23.8) (2025-10-30)

### Bug Fixes

* **nginx:** increase upload limit, update CSP, switch backend port, adjust proxy settings ([#1146](#1146)) ([a8181a0](a8181a0))
* fix: XYNE-254 fixed followup in kb chat

* chore: XYNE-254 resolved comments

* chore: XYNE-254 resolved comments

---------

Co-authored-by: Ravishekhar Yadav <[email protected]>
## [3.23.9](v3.23.8...v3.23.9) (2025-10-30)

### Bug Fixes

* XYNE-254 fixed followup in kb chat ([#1170](#1170)) ([a1ba643](a1ba643))
…1172)

* feat: XYN-263 implented enhanced chatting and notification mechanism

* feat(directMessages): made the suggested changes
# [3.24.0](v3.23.9...v3.24.0) (2025-10-30)

### Features

* XYN-263 implented enhanced chatting and notification mechanism ([#1172](#1172)) ([6beb54f](6beb54f))
* chore: XYNE-112 Modified server/health files for paddleOCRHealthcheck

* chore: XYNE-112 modified files for paddle health check

* chore: XYNE-112 Modified code for health check

* chore: XYNE-112 added code

* fix: XYNE-112 Modified code WRT PR comments

* chore: XYNE-112 Modified server/health files for paddleOCRHealthcheck

* chore: XYNE-112 modified files for paddle health check

* chore: XYNE-112 Modified code for health check

* chore: XYNE-112 added code

* fix: XYNE-112 Modified code WRT PR comments

* chore: XYNE-112 Made change WRT PR comments
## [3.24.1](v3.24.0...v3.24.1) (2025-10-31)

### Bug Fixes

* XYNE-260 fixed the UI to show correct button during google ingestion post oauth ([#1171](#1171)) ([8a641a3](8a641a3)), closes [Chinmay-Sin#FQX1](https://github.com/Chinmay-Sin/issues/FQX1)
…app (#1168)

* feat: Add endpoint for handling Apple Login

* feat: Refactor validateAppleToken using jose

* fix: Fix handleAppleAppValidation AI comments

* fix: Resolve comments
# [3.25.0](v3.24.1...v3.25.0) (2025-10-31)

### Features

* **apple-signin:** Add Apple Sign-in validation endpoint for mobile app ([#1168](#1168)) ([40810a8](40810a8))
## [3.25.1](v3.25.0...v3.25.1) (2025-10-31)

### Bug Fixes

* XYNE-156 tool box disappear fix ([#1157](#1157)) ([ae16427](ae16427))
)

* fix: XYNE-270 fixed chat button state in basis of poll status

* refactor: XYNE-270 resolved comment
## [3.25.2](v3.25.1...v3.25.2) (2025-10-31)

### Bug Fixes

* **kb:** XYNE-270 fixed chat button state in basis of poll status ([#1177](#1177)) ([43d516f](43d516f))
* fix: XYNE-259 fixed chunk index load error

* fix: XYNE-259 fixed import
## [3.25.3](v3.25.2...v3.25.3) (2025-10-31)

### Bug Fixes

* XYNE-259 fixed chunk index load error ([#1178](#1178)) ([6e79a73](6e79a73))
* fix(search): Add attendees email if display name is empty

* fix(event): changes based on comment
## [3.25.4](v3.25.3...v3.25.4) (2025-10-31)

### Bug Fixes

* **search:** Add attendees email if display name is empty ([#1167](#1167)) ([c861801](c861801))
* fix: XYNE-218 fixed rag on pdf tables

* fix: XYNE-218 resolved ai comments

* fix: XYNE-218 removed dead code and added a length guard

n
#1071)

* feat: Webhook Registration and execution service with dynamic webhook handlers and UI

* feat: Webhook authentication handling for basic bearer and api-key with none

* feat: Webhook handler and api security reforms

* feat: comments resolved

* feat: HTTP Node addition in Workflow Xyne

* feat: Credentials fixed webhook url workflow added and changes

* feat: Webhook E2E working form not working completely

* feat: Webhook E2E working with all types of workflows

* remove the void methods

---------

Co-authored-by: Aman Asrani <[email protected]>
# [3.26.0](v3.25.4...v3.26.0) (2025-10-31)

### Features

* Webhook Registration and execution service with dynamic webhook… ([#1071](#1071)) ([5478db1](5478db1))
* fix(fix/Sync-1): inserting single user job in queue

* fix(fix/Sync-1): inserting single user job in queue-2

* fix(fix/Sync-1): inserting single user job in queue-3

* fix(fix/Sync-1): inserting single user job in queue-4

---------

Co-authored-by: Mohd Shoaib <[email protected]>
## [3.26.1](v3.26.0...v3.26.1) (2025-10-31)

### Bug Fixes

* **fix/Sync-1:** inserting single user job in queue ([#1175](#1175)) ([8c8008d](8c8008d))
…plicate dependencies (#1180)

* fix: XYNE-284 removed caret from breaking dependencies and removed duplicate dependencies

* fix: XYNE-284 added bun.lock for build

---------

Co-authored-by: Chinmay Singh <[email protected]>
## [3.26.2](v3.26.1...v3.26.2) (2025-11-03)

### Bug Fixes

* XYNE-284 removed caret from breaking dependencies and removed duplicate dependencies ([#1180](#1180)) ([76f6095](76f6095))
* feat(langfuse): Initial langfuse testing (UAT)

* feat(langfuse): Initial langfuse testing (UAT)w

* feat(langfuse): Initial langfuse testing (UAT)w
# [3.27.0](v3.26.2...v3.27.0) (2025-11-03)

### Features

* **langfuse:** Initial langfuse testing (UAT) ([#1182](#1182)) ([5e6b8b3](5e6b8b3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.