Rollback Strategies
Safely rollback agent deployments when issues occur
Rollback Strategies
Learn how to quickly and safely rollback agent deployments when issues arise.
Automatic Rollback
SwiftClaw automatically rolls back deployments if:
- Health checks fail
- Error rate exceeds threshold
- Response time degrades significantly
- Memory or CPU usage spikes
Zero-Downtime: Automatic rollbacks maintain service availability during the rollback process.
Manual Rollback
Quick Rollback
Rollback to previous version:
# Rollback to last stable version
swiftclaw rollback my-agent
# Rollback to specific version
swiftclaw rollback my-agent --version v1.2.3Dashboard Rollback
- Navigate to agent in dashboard
- Click "Deployment History"
- Select version to rollback to
- Click "Rollback"
Version History
View deployment history:
# List all deployments
swiftclaw deployments my-agent
# Output:
# VERSION DATE STATUS DURATION
# v1.3.0 2024-03-08 10:30 active 2m 15s
# v1.2.3 2024-03-07 14:20 rolled-back 1m 45s
# v1.2.2 2024-03-06 09:15 stable 1m 30sRollback Verification
After rollback, verify:
# Check current version
swiftclaw status my-agent
# View recent logs
swiftclaw logs my-agent --tail 100
# Monitor metrics
swiftclaw metrics my-agent --liveRollback Triggers
Health Check Failures
Configure automatic rollback on health check failures:
{
"rollback": {
"enabled": true,
"triggers": {
"healthCheck": {
"failureThreshold": 3,
"timeWindow": "5m"
}
}
}
}Error Rate Threshold
Rollback if error rate exceeds threshold:
{
"rollback": {
"triggers": {
"errorRate": {
"threshold": 5,
"timeWindow": "10m"
}
}
}
}Response Time Degradation
Rollback if response time increases significantly:
{
"rollback": {
"triggers": {
"responseTime": {
"threshold": "2s",
"percentile": 95,
"timeWindow": "5m"
}
}
}
}Canary Rollback
Rollback canary deployment:
# Rollback canary to previous version
swiftclaw rollback my-agent --canary
# Abort canary and keep stable version
swiftclaw abort my-agent --canaryBlue-Green Rollback
Switch traffic back to previous slot:
# Switch from green back to blue
swiftclaw swap my-agent --from green --to blueRollback Best Practices
1. Test Before Deploying
Always test in staging:
# Deploy to staging first
swiftclaw deploy my-agent --env staging
# Run integration tests
npm run test:integration
# Deploy to production
swiftclaw deploy my-agent --env production2. Monitor After Deployment
Watch metrics closely after deployment:
# Monitor for 10 minutes
swiftclaw metrics my-agent --live --duration 10m3. Gradual Rollout
Use canary deployments for risky changes:
# Start with 5% traffic
swiftclaw deploy my-agent --canary 5
# Gradually increase
swiftclaw promote my-agent --canary 25
swiftclaw promote my-agent --canary 50
swiftclaw promote my-agent --canary 1004. Keep Version History
Maintain deployment history:
# Tag releases in git
git tag v1.3.0
git push origin v1.3.0
# Deploy with version tag
swiftclaw deploy my-agent --version v1.3.05. Document Changes
Keep changelog updated:
## v1.3.0 - 2024-03-08
### Added
- New tool for database queries
- Enhanced error handling
### Changed
- Updated model to GPT-4
- Improved response formatting
### Fixed
- Memory leak in long-running sessionsEmergency Rollback
For critical issues:
# Immediate rollback without health checks
swiftclaw rollback my-agent --force --immediate
# Disable agent temporarily
swiftclaw disable my-agent
# Re-enable after fix
swiftclaw enable my-agentUse with Caution: Force rollback skips safety checks and may cause brief downtime.
Next Steps
How is this guide ?
Last updated on