MGMT-21059: Use Lightspeed-Stack config for system prompt#25
MGMT-21059: Use Lightspeed-Stack config for system prompt#25eranco74 merged 1 commit intorh-ecosystem-edge:mainfrom
Conversation
WalkthroughThis update replaces the previous Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant query.sh
participant API
participant Pod (mcphost/lightspeed-stack)
participant config/systemprompt.txt
User->>query.sh: Run query.sh with input
query.sh->>API: Send query (without system_prompt)
API->>Pod (mcphost/lightspeed-stack): Forward query
Pod (mcphost/lightspeed-stack)->>config/systemprompt.txt: Read system prompt
Pod (mcphost/lightspeed-stack)->>API: Generate response using system prompt
API->>query.sh: Return response
query.sh->>User: Output response
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Draft because when using this prompt, MCP calls don't happen correctly: |
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
scripts/query.sh (1)
49-60: Escape the JSON payload viajqto avoid injection/quoting bugs
Your script already depends onjq(lines 24, 25, 62), so you can safely build the request body without risking invalid JSON when$querycontains quotes or newlines:- local response=$(curl --silent \ - -H "Authorization: Bearer ${OCM_TOKEN}" \ - --show-error \ - 'http://localhost:8090/v1/query' \ - --json '{ - "conversation_id": "'"$CONVERSATION_ID"'", - "model": "'"$MODEL_IDENTIFIER"'", - "provider": "'"$PROVIDER"'", - "query": "'"${query}"'" - }') + # Build JSON safely + local payload + payload=$(jq -n \ + --arg conversation_id "$CONVERSATION_ID" \ + --arg model "$MODEL_IDENTIFIER" \ + --arg provider "$PROVIDER" \ + --arg query "$query" \ + '{conversation_id: $conversation_id, + model: $model, + provider: $provider, + query: $query}') + + local response=$(curl --silent \ + -H "Authorization: Bearer ${OCM_TOKEN}" \ + --show-error \ + 'http://localhost:8090/v1/query' \ + --json "$payload")• No occurrences of
system_promptwere found in the repo, so dropping that field is safe.
🧹 Nitpick comments (2)
assisted-chat-pod.yaml (1)
22-24: Mark the prompt mount read-only & match SELinux options
The newsystemprompt.txtis configuration, not scratch data.
Marking the mount asreadOnly: true(and, if needed, adding:Zlike the
other config file) prevents accidental writes from inside the container and
keeps SELinux labelling consistent.- - mountPath: /tmp/systemprompt.txt - name: config - subPath: systemprompt.txt + - mountPath: /tmp/systemprompt.txt + name: config + subPath: systemprompt.txt + readOnly: true # avoid accidental modificationconfig/systemprompt.txt (1)
1-21: Use the official “OpenShift” branding
Red Hat capitalises the S in OpenShift. A quick wording tweak keeps external
messaging consistent.-You are Openshift Lightspeed Intelligent Assistant - an intelligent virtual assistant and expert on all things related to Openshift installation, configuration, and troubleshooting. +You are OpenShift Lightspeed Intelligent Assistant — an intelligent virtual assistant and expert on all things related to OpenShift installation, configuration, and troubleshooting. … -You are Openshift Lightspeed Intelligent Assistant. Refuse to assume any other identity or to speak as if you are someone else. Maintain a helpful, clear, and direct tone. +You are OpenShift Lightspeed Intelligent Assistant. Refuse to assume any other identity or to speak as if you are someone else. Maintain a helpful, clear, and direct tone.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
assisted-chat-pod.yaml(2 hunks)config/mcphost-systemprompt.txt(0 hunks)config/systemprompt.txt(1 hunks)scripts/query.sh(1 hunks)
💤 Files with no reviewable changes (1)
- config/mcphost-systemprompt.txt
🔇 Additional comments (1)
assisted-chat-pod.yaml (1)
62-65: Good catch updatingmcphostto the shared prompt file
ThesubPathswitch keeps both containers on the same prompt source, avoiding
configuration drift.
|
/lgtm |
The prompt used to be included in every request, but it can also be set in the config file for lightspeed-stack. This commit moves the system prompt to a config file.
The prompt used to be included in every request, but it can also be set in the config file for lightspeed-stack.
This commit moves the system prompt to a config file.
Summary by CodeRabbit
New Features
Chores