fix: address pr_reviewer findings (data loss, memory, prompt injection)

- CI/CD: stop deleting the steward namespace on every deploy; use
  kubectl apply (dry-run -> apply) so the PVC and conversation memory
  survive deployments.
- core: bound _histories with an LRU eviction (max 1000 active threads)
  to prevent unbounded memory growth.
- core: wrap knowledge-base context in KB START/END delimiters and
  instruct the LLM to treat it as data, mitigating indirect prompt
  injection.
- matrix: wrap message processing in try/except so failures are logged
  instead of silently dropped.
- telegram: remove now-dead flush/tags prompt constants (centralized in
  core).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-08-18 22:01:59 +10:00
co-authored by Sisyphus
parent 9c36b373d2
commit f79214bb22
4 changed files with 41 additions and 33 deletions
+5 -5
View File
@@ -56,10 +56,10 @@ jobs:
chmod 644 /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install kubectl
kubectl delete namespace steward --ignore-not-found
kubectl create namespace steward
kubectl create secret docker-registry regcred --docker-server=${{ vars.DOCKER_SERVER }} --docker-username=${{ vars.DOCKER_USERNAME }} --docker-password='${{ secrets.DOCKER_PASSWORD }}' --docker-email=${{ vars.DOCKER_EMAIL }} --namespace=steward
kubectl create secret generic steward-env \
kubectl create namespace steward --dry-run=client -o yaml | kubectl apply -f -
kubectl create secret docker-registry regcred --dry-run=client -o yaml \
--docker-server=${{ vars.DOCKER_SERVER }} --docker-username=${{ vars.DOCKER_USERNAME }} --docker-password='${{ secrets.DOCKER_PASSWORD }}' --docker-email=${{ vars.DOCKER_EMAIL }} --namespace=steward | kubectl apply -f -
kubectl create secret generic steward-env --dry-run=client -o yaml \
--from-literal=TELEGRAM_BOT_TOKEN=${{ secrets.TELEGRAM_BOT_TOKEN }} \
--from-literal=TELEGRAM_ALLOWED_USER_IDS=${{ vars.TELEGRAM_ALLOWED_USER_IDS }} \
--from-literal=OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \
@@ -74,6 +74,6 @@ jobs:
--from-literal=STEWARD__MATRIX__LISTEN_PORT=8000 \
--from-literal=STEWARD__MATRIX__ALLOWED_ROOM_IDS=${{ vars.MATRIX_ALLOWED_ROOM_IDS }} \
--from-literal=STEWARD__MATRIX__ALLOWED_USER_IDS=${{ vars.MATRIX_ALLOWED_USER_IDS }} \
--namespace=steward
--namespace=steward | kubectl apply -f -
kubectl apply -f kube/steward_deployment.yaml && kubectl apply -f kube/steward_service.yaml
kubectl set image deployment/steward-deployment steward=git.aridgwayweb.com/armistace/steward:${{ gitea.sha }} --namespace=steward