-
Notifications
You must be signed in to change notification settings - Fork 4
Prompt config module #218
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
base: wip
Are you sure you want to change the base?
Prompt config module #218
Conversation
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
Streaming response formatting
Encrypt llm keys
…G-Module into encrypt-llm-keys
Sync rootcodelabs/RAG-Module wip with buerokratt/RAG-Module wip
… encrypt-llm-keys
…G-Module into encrypt-llm-keys
Refactor docker-compose-ec2.ym l file with new vault agent containers
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.
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:8202in its CSP policy but has nodepends_onconfiguration to ensure vault-agent-gui is started before the GUI service. This could lead to connection failures during startup. Add adepends_onsection 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.
| extract_request_data: | ||
| assign: | ||
| prompt: ${incoming.body.prompt ?? ""} |
Copilot
AI
Jan 20, 2026
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.
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.
| export const savePromptConfiguration = async (prompt: string): Promise<PromptConfiguration[]> => { | ||
| const { data } = await apiDev.post(promptConfigurationEndpoints.SAVE_PROMPT_CONFIGURATION(), { | ||
| prompt, | ||
| }); | ||
| return data?.response; |
Copilot
AI
Jan 20, 2026
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.
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.
| command: | ||
| - -c | ||
| - | | ||
| apk add --no-cache curl jq uuidgen openssl |
Copilot
AI
Jan 20, 2026
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.
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.
| apk add --no-cache curl jq uuidgen openssl | |
| apk add --no-cache curl jq util-linux openssl |
| return ( | ||
| <div className="prompt-configurations"> | ||
| <div className="container"> | ||
| <div className="title_container"> |
Copilot
AI
Jan 20, 2026
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.
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.
| <div className="title_container"> | |
| <div className="title-container"> |
| disabled={saveMutation.isLoading || !promptText.trim()} | ||
| > | ||
| {saveMutation.isLoading |
Copilot
AI
Jan 20, 2026
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.
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.
| disabled={saveMutation.isLoading || !promptText.trim()} | |
| > | |
| {saveMutation.isLoading | |
| disabled={saveMutation.isPending || !promptText.trim()} | |
| > | |
| {saveMutation.isPending |
|
|
||
| -- changeset Erangi Ariyasena:rag-script-v5-changeset1 | ||
| CREATE TABLE public.prompt_configuration ( | ||
| id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
Copilot
AI
Jan 20, 2026
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.
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.
| id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, |
No description provided.