Skip to content

Conversation

@erangi-ar
Copy link
Collaborator

No description provided.

Thirunayan22 and others added 30 commits December 16, 2025 12:33
Pulling changes from Burokratt WIP to rootcodelabs/RAG-Module wip
Get update from RAG-201-Fix into encrypt-llm-keys
update cron manager vault script
Sync rootcodelabs/RAG-Module wip with buerokratt/RAG-Module wip
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces a prompt configuration module that allows administrators to manage prompt templates through a new UI page. Additionally, it refactors the vault-agent architecture to use separate agents for GUI, CronManager, and LLM services with dedicated tokens and network isolation.

Changes:

  • Added prompt configuration UI with create/update functionality and database persistence
  • Refactored vault-agent architecture from single shared agent to three dedicated agents (gui, cron, llm) with isolated network security
  • Fixed namespace inconsistencies in vault secret endpoints from "classifier" to "rag-search"

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
docker-compose-ec2.yml Refactored vault-agent architecture with separate agents for GUI, CronManager, and LLM; added vault-network isolation; updated CSP policy
README.md Minor formatting change (trailing spaces)
GUI/translations/et/common.json Added Estonian translations for prompt configuration UI and nested menu structure
GUI/translations/en/common.json Added English translations for prompt configuration UI and nested menu structure
GUI/src/utils/queryKeys.ts Added query keys for prompt configuration caching
GUI/src/utils/endpoints.ts Added API endpoints for prompt configuration
GUI/src/services/promptConfiguration.ts Added service layer for prompt configuration API calls
GUI/src/pages/PromptConfigurations/index.tsx New page component for managing prompt templates
GUI/src/pages/PromptConfigurations/PromptConfigurations.scss Styles for prompt configuration page
GUI/src/components/MainNavigation/index.tsx Updated navigation to include nested menu with prompt configurations
GUI/src/App.tsx Added route for prompt configurations page
DSL/Ruuter.private/rag-search/POST/vault/secret/delete.yml Fixed namespace from "classifier" to "rag-search"
DSL/Ruuter.private/rag-search/POST/vault/secret/create.yml Fixed namespace from "classifier" to "rag-search"
DSL/Ruuter.private/rag-search/POST/prompt-configuration/save.yml New endpoint for saving/updating prompt configuration
DSL/Ruuter.private/rag-search/GET/prompt-configuration/get.yml New endpoint for retrieving prompt configuration
DSL/Resql/rag-search/POST/update-prompt-configuration.sql SQL query for updating prompt configuration
DSL/Resql/rag-search/POST/insert-prompt-configuration.sql SQL query for inserting prompt configuration
DSL/Resql/rag-search/GET/get-prompt-configuration.sql SQL query for retrieving prompt configuration
DSL/Liquibase/master.yml Added reference to new migration file
DSL/Liquibase/changelog/rag-search-script-v5-prompt-config.sql Database migration creating prompt_configuration table
Comments suppressed due to low confidence (1)

docker-compose-ec2.yml:155

  • The GUI service references vault-agent-gui:8202 in its CSP policy but has no depends_on configuration to ensure vault-agent-gui is started before the GUI service. This could lead to connection failures during startup. Add a depends_on section to the GUI service with vault-agent-gui as a dependency.
  gui:
    container_name: gui
    environment:
      - NODE_ENV=development
      - REACT_APP_RUUTER_API_URL=https://est-rag-rtc.rootcode.software/ruuter-public
      - REACT_APP_RUUTER_PRIVATE_API_URL=https://est-rag-rtc.rootcode.software/ruuter-private  
      - REACT_APP_CUSTOMER_SERVICE_LOGIN=https://est-rag-rtc.rootcode.software/authentication-layer/et/dev-auth
      - REACT_APP_CSP=upgrade-insecure-requests; default-src 'self'; font-src 'self' data:; img-src 'self' data:; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self' http://localhost:8086 http://localhost:8088 http://localhost:3004 http://localhost:3005 ws://localhost https://vault-agent-gui:8202 https://est-rag-rtc.rootcode.software;
      - DEBUG_ENABLED=true
      - CHOKIDAR_USEPOLLING=true
      - PORT=3001
      - REACT_APP_SERVICE_ID=conversations,settings,monitoring
      - REACT_APP_ENABLE_HIDDEN_FEATURES=TRUE
      - VITE_HOST=0.0.0.0
      - VITE_PORT=3001
      - HOST=0.0.0.0
      - VITE_ALLOWED_HOSTS=localhost,127.0.0.1,est-rag-rtc.rootcode.software
      - HMR=false
      - FAST_REFRESH=false
    build:
      context: ./GUI
      dockerfile: Dockerfile.dev
    ports:
      - "3003:3001"
    volumes:
      - /app/node_modules
      - ./GUI:/app
    networks:
      - bykstack
    cpus: "0.5"
    mem_limit: "1G"
    restart: unless-stopped

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +17
extract_request_data:
assign:
prompt: ${incoming.body.prompt ?? ""}
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The endpoint doesn't validate that the prompt field is non-empty before attempting to save. While the frontend performs trim validation, the backend should also validate that the prompt is not empty or only whitespace to prevent storing invalid data.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +22
export const savePromptConfiguration = async (prompt: string): Promise<PromptConfiguration[]> => {
const { data } = await apiDev.post(promptConfigurationEndpoints.SAVE_PROMPT_CONFIGURATION(), {
prompt,
});
return data?.response;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The return type of savePromptConfiguration is Promise<PromptConfiguration[]> but based on the Ruuter endpoint implementation, it returns a single object (either update_result.response.body[0] or insert_result.response.body[0]), not an array. The return type should be Promise<PromptConfiguration> to match the actual response structure.

Copilot uses AI. Check for mistakes.
command:
- -c
- |
apk add --no-cache curl jq uuidgen openssl
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The command tries to install uuidgen via apk, but uuidgen is not a valid Alpine Linux package name. The utility is provided by the util-linux package in Alpine. The command should be apk add --no-cache curl jq util-linux openssl instead.

Suggested change
apk add --no-cache curl jq uuidgen openssl
apk add --no-cache curl jq util-linux openssl

Copilot uses AI. Check for mistakes.
return (
<div className="prompt-configurations">
<div className="container">
<div className="title_container">
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The class name in JSX is title_container (line 69) but the SCSS file defines .title-container with a hyphen (line 9). This naming mismatch will cause the styles not to be applied. The class name should be consistent between JSX and SCSS.

Suggested change
<div className="title_container">
<div className="title-container">

Copilot uses AI. Check for mistakes.
Comment on lines +86 to +88
disabled={saveMutation.isLoading || !promptText.trim()}
>
{saveMutation.isLoading
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The deprecated property isLoading is being used for both useQuery and useMutation. In newer versions of @tanstack/react-query (v4+), this property has been renamed to isPending for mutations. Consider updating to use isPending for the mutation or ensure the code is compatible with the version being used.

Suggested change
disabled={saveMutation.isLoading || !promptText.trim()}
>
{saveMutation.isLoading
disabled={saveMutation.isPending || !promptText.trim()}
>
{saveMutation.isPending

Copilot uses AI. Check for mistakes.

-- changeset Erangi Ariyasena:rag-script-v5-changeset1
CREATE TABLE public.prompt_configuration (
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY,
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The database migration is missing a PRIMARY KEY constraint on the id column. While the column is defined as an IDENTITY column, it should explicitly be marked as PRIMARY KEY to ensure proper indexing and prevent duplicate IDs.

Suggested change
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY,
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,

Copilot uses AI. Check for mistakes.
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.

3 participants