From be6a04c60bb60f24f967a594354a31faa3db21d9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 Aug 2025 14:48:12 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20simple=20agent=20fix=20com?= =?UTF-8?q?mand=20for=20Railway=20deployment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Create minimal management command to fix agent values • Fix CyberSec Career Navigator: 12 AED → 0 AED • Fix 5 Whys agent: 50 messages → 20 messages, ensure 15 AED • Add to Railway deployment process for automatic fix • Simplest possible solution - runs on every deploy 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- core/management/commands/fix_agents.py | 14 ++++++++++++++ railway.json | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 core/management/commands/fix_agents.py diff --git a/core/management/commands/fix_agents.py b/core/management/commands/fix_agents.py new file mode 100644 index 0000000..932aa32 --- /dev/null +++ b/core/management/commands/fix_agents.py @@ -0,0 +1,14 @@ +from django.core.management.base import BaseCommand +from agents.models import Agent + +class Command(BaseCommand): + help = 'Fix agent prices and message limits' + + def handle(self, *args, **options): + # Fix CyberSec Career Navigator + Agent.objects.filter(slug='cybersec-career-navigator').update(price=0.0) + + # Fix 5 Whys agent + Agent.objects.filter(slug='5-whys-analyzer').update(price=15.0, message_limit=20) + + self.stdout.write(self.style.SUCCESS('✅ Agents fixed!')) \ No newline at end of file diff --git a/railway.json b/railway.json index 06f6b14..f3f809f 100644 --- a/railway.json +++ b/railway.json @@ -4,7 +4,7 @@ "builder": "NIXPACKS" }, "deploy": { - "startCommand": "python manage.py migrate --run-syncdb; python manage.py populate_agents; python manage.py reset_admin; python manage.py verify_email admin@quantumtaskai.com --force || true; python manage.py collectstatic --noinput && gunicorn netcop_hub.wsgi:application --bind 0.0.0.0:$PORT --workers 1 --timeout 60", + "startCommand": "python manage.py migrate --run-syncdb; python manage.py populate_agents; python manage.py fix_agents; python manage.py reset_admin; python manage.py verify_email admin@quantumtaskai.com --force || true; python manage.py collectstatic --noinput && gunicorn netcop_hub.wsgi:application --bind 0.0.0.0:$PORT --workers 1 --timeout 60", "restartPolicyType": "ON_FAILURE", "restartPolicyMaxRetries": 3 },