fix(hirag): Docker restart stability - Supabase realtime connection resilience - #333
Conversation
Add external network reference to Supabase CLI stack (pmoves-net) enabling direct container-to-container communication between PMOVES services and Supabase realtime. Changes: - Add supabase_net external network definition - Add supabase_net to hi-rag-gateway-v2 networks - Add supabase_net to hi-rag-gateway-v2-gpu networks This enables Hi-RAG to connect directly to supabase_realtime_PMOVES.AI without routing through host.docker.internal, reducing startup latency and improving reliability on Docker restarts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add entrypoint script that waits for Supabase realtime to be healthy before starting the Hi-RAG application, preventing startup errors on Docker restarts. New files: - scripts/wait-for-deps.sh: Health check script with configurable timeout Dockerfile changes: - Install curl for health checks - Add ENTRYPOINT to run wait-for-deps.sh before uvicorn - GPU variant: Create wrapper entrypoint for NVIDIA compatibility Environment variables: - WAIT_FOR_DEPS_MAX_WAIT: Maximum wait time (default: 120s) - WAIT_FOR_DEPS_INTERVAL: Check interval (default: 5s) - SUPABASE_REALTIME_DISABLED: Skip wait if set to true The script checks Supabase realtime health via HTTP ping before starting the application, eliminating the ~109 retry errors that occurred during cold starts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Improve Supabase realtime connection resilience with smarter retry logic and reduced log noise during startup. Changes to _geometry_realtime_worker: - Add exponential backoff: 5s → 10s → 20s → 40s → 60s (max) - Add startup grace period (120s) with WARNING level logging - Reset backoff on successful connection - Track elapsed time for grace period calculation New environment variables: - GEOMETRY_REALTIME_MAX_BACKOFF: Maximum retry delay (default: 60s) - GEOMETRY_REALTIME_STARTUP_GRACE: Grace period duration (default: 120s) Before: Fixed 5s retry, ERROR level for all failures After: Exponential backoff, WARNING during startup grace period This reduces log noise from ~109 ERROR entries to a handful of WARNING messages during normal startup scenarios. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. WalkthroughContainer startup infrastructure enhanced with Supabase realtime dependency management. Docker networking configured to enable cross-stack communication. Hi-RAG Gateway V2 service introduces startup sequencing via wait-for-dependencies script with exponential backoff logic. Ultimate TTS Studio Dockerfile refactored to use PyTorch base image. PMOVES-Ultimate-TTS-Studio added as Git submodule. Changes
Sequence DiagramsequenceDiagram
participant Container as Container Start
participant WaitScript as wait-for-deps.sh
participant SBRealtime as Supabase Realtime
participant App as uvicorn App
Container->>WaitScript: Execute entrypoint
loop Health Check Loop (interval: 5s, max: 120s)
WaitScript->>SBRealtime: curl health check to HTTP endpoint
alt Success
SBRealtime-->>WaitScript: HTTP 200
WaitScript->>WaitScript: Break loop
else Timeout/Failure
SBRealtime-->>WaitScript: Timeout or error
WaitScript->>WaitScript: Log warning, continue
Note over WaitScript: elapsed_time < grace_period<br/>log as warning, apply backoff
end
end
WaitScript->>App: Execute command (uvicorn)
App->>App: Start server on port 8086
App-->>Container: Ready
Note over App: During startup grace:<br/>connection failures use<br/>exponential backoff logic
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Areas requiring extra attention:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh (2)
1-19: Consider addingset -ufor safer script execution.The script uses
set -eto exit on errors, which is good. Consider also addingset -uto exit on undefined variables, which would catch configuration errors early.🔎 Proposed enhancement
-set -e +set -euThis will make the script exit if any undefined variable is referenced, catching configuration errors before they cause silent failures.
51-66: LGTM! Wait loop with graceful timeout handling.The script correctly:
- Checks health endpoint with curl
- Breaks immediately on success
- Logs progress during wait
- Continues after timeout with a warning (graceful degradation)
💡 Optional enhancement for debugging
Consider logging curl errors on failure for better diagnostics:
while true; do - if curl -sf "$HEALTH_URL" -o /dev/null 2>&1; then + if curl_output=$(curl -sf "$HEALTH_URL" 2>&1); then echo "[wait-for-deps] Supabase realtime is ready!" break + else + # Optional: log curl error for debugging (only in verbose mode) + if [ "${WAIT_FOR_DEPS_VERBOSE:-false}" = "true" ]; then + echo "[wait-for-deps] Health check failed: $curl_output" + fi fi
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
pmoves/docker-compose.yml(3 hunks)pmoves/services/hi-rag-gateway-v2/Dockerfile(3 hunks)pmoves/services/hi-rag-gateway-v2/Dockerfile.gpu(1 hunks)pmoves/services/hi-rag-gateway-v2/app.py(4 hunks)pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
pmoves/**/docker-compose.yml
📄 CodeRabbit inference engine (pmoves/AGENTS.md)
Use Compose profiles (
data,workers) to scope what runs locally in docker-compose.yml
Files:
pmoves/docker-compose.yml
pmoves/services/**/*.py
📄 CodeRabbit inference engine (pmoves/AGENTS.md)
pmoves/services/**/*.py: Keep modules small and single-purpose; share helpers inservices/common/
FastAPI routes: snake_case function names; path names kebab-case only in URLs
Validate payloads against schemas before publishing events usingservices/common/events.py
Files:
pmoves/services/hi-rag-gateway-v2/app.py
pmoves/**/*.py
📄 CodeRabbit inference engine (pmoves/AGENTS.md)
Python 3.11+, 4-space indentation, prefer type hints
Files:
pmoves/services/hi-rag-gateway-v2/app.py
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use Python 3.11+ with 4-space indentation and prefer type hints in all Python code
Files:
pmoves/services/hi-rag-gateway-v2/app.py
🧠 Learnings (7)
📚 Learning: 2025-12-07T11:03:53.415Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/AGENTS.md:0-0
Timestamp: 2025-12-07T11:03:53.415Z
Learning: Applies to pmoves/services/hi-rag-gateway/**/*.py : Hi-RAG gateway: after touching reranker or embedding code, run `make -C pmoves smoke-gpu` to validate FlagEmbedding/Qwen rerankers
Applied to files:
pmoves/services/hi-rag-gateway-v2/Dockerfile.gpupmoves/services/hi-rag-gateway-v2/Dockerfile
📚 Learning: 2025-12-15T12:04:26.230Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/docs/ARTSTUFF/realtime/AGENTS.md:0-0
Timestamp: 2025-12-15T12:04:26.230Z
Learning: Applies to pmoves/docs/ARTSTUFF/realtime/**/*.js : When a 3rd party package needs to be installed or repository downloaded, include them in the scripts
Applied to files:
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh
📚 Learning: 2025-12-15T12:01:31.388Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/docs/ARTSTUFF/realtime/CLAUDE.md:0-0
Timestamp: 2025-12-15T12:01:31.388Z
Learning: Applies to pmoves/docs/ARTSTUFF/realtime/**/{install,start,update,reset}.js : Scripts must be able to replicate install and launch steps 100% - include all 3rd party package installations and repository downloads in scripts, do not assume end user's system state, and make everything self-contained
Applied to files:
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh
📚 Learning: 2025-12-15T12:04:26.230Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/docs/ARTSTUFF/realtime/AGENTS.md:0-0
Timestamp: 2025-12-15T12:04:26.230Z
Learning: Applies to pmoves/docs/ARTSTUFF/realtime/**/*.js : Scripts must be able to replicate install and launch steps 100%. Make everything self-contained and do not assume end user's system state
Applied to files:
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh
📚 Learning: 2025-12-15T12:03:17.291Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T12:03:17.291Z
Learning: Applies to {Dockerfile,docker-compose.yml,docker-compose.*.yml,pmoves/docker-compose.*.override.yml} : Dockerfile and docker-compose.yml must follow multi-arch build practices (amd64+arm64) with Trivy scanning for HIGH/CRITICAL vulnerabilities
Applied to files:
pmoves/services/hi-rag-gateway-v2/Dockerfile
📚 Learning: 2025-12-15T12:03:17.291Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T12:03:17.291Z
Learning: Applies to services/**/README.md : Update services/*/README.md and pmoves/docs/PMOVES.AI PLANS/ runbooks when touching service operational code
Applied to files:
pmoves/services/hi-rag-gateway-v2/Dockerfile
📚 Learning: 2025-12-15T12:03:17.291Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-15T12:03:17.291Z
Learning: UI updates: run make -C pmoves notebook-workbench-smoke ARGS='--thread=<uuid>' to lint the Next.js bundle and validate Supabase connectivity; reference pmoves/docs/UI_NOTEBOOK_WORKBENCH.md
Applied to files:
pmoves/services/hi-rag-gateway-v2/Dockerfile
🧬 Code graph analysis (1)
pmoves/services/hi-rag-gateway-v2/app.py (3)
pmoves/services/hi-rag-gateway-v2/tests/test_swarm_meta.py (1)
get(82-86)pmoves/services/hi-rag-gateway-v2/tests/test_gan_sidecar.py (1)
get(162-166)pmoves/scripts/bootstrap_env.py (1)
get(165-170)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: tests (3.11)
- GitHub Check: Analyze (python)
🔇 Additional comments (14)
pmoves/services/hi-rag-gateway-v2/app.py (4)
209-210: LGTM! Configuration constants are well-defined.The new environment variables for backoff control and startup grace are properly configured with sensible defaults (60s max backoff, 120s startup grace).
890-891: LGTM! Startup timing and backoff initialization are correct.Using
time.monotonic()for startup tracking is the right choice as it's not affected by system clock changes. The backoff initialization ensures a minimum of 1.0s.
922-923: LGTM! Backoff reset on successful connection.Resetting the backoff to the base value after a successful connection is the correct behavior and prevents indefinite backoff growth.
961-976: LGTM! Exponential backoff with startup grace is well-implemented.The implementation correctly:
- Uses WARNING-level logging during the startup grace period to reduce noise
- Escalates to exception logging after the grace period expires
- Applies exponential backoff with a configurable cap (GEOMETRY_REALTIME_MAX_BACKOFF)
- Provides clear diagnostic information in logs (elapsed/grace times, backoff delay)
This should significantly reduce log noise during Docker restarts.
pmoves/services/hi-rag-gateway-v2/Dockerfile.gpu (1)
38-39: LGTM! Execute permission set correctly.Making the wait-for-deps.sh script executable is necessary for it to function as part of the entrypoint chain.
pmoves/docker-compose.yml (2)
577-577: LGTM! Network configuration enables direct Supabase connectivity.Adding
supabase_netto the hi-rag-gateway-v2 service networks allows direct container-to-container communication with Supabase realtime, which is essential for the startup health checks.
695-695: LGTM! GPU variant correctly configured for Supabase connectivity.The GPU variant also needs access to the Supabase network for health checks and realtime subscriptions.
pmoves/services/hi-rag-gateway-v2/Dockerfile (3)
5-7: LGTM! curl installation follows best practices.Installing curl for health checks and cleaning up apt lists to reduce image size is the correct approach.
21-22: LGTM! Execute permission set correctly.Making the wait-for-deps.sh script executable is necessary for it to function as the entrypoint.
33-35: LGTM! Entrypoint configuration is correct.Using wait-for-deps.sh as the entrypoint with the uvicorn command as CMD is the correct pattern. The script will wait for dependencies, then
execthe uvicorn command, properly replacing the shell process.pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh (4)
20-30: LGTM! Disabled and empty URL checks are correct.The script properly handles multiple disabled values and skips waiting when no URL is configured, proceeding directly to execute the main command.
32-46: LGTM! URL conversion logic handles both deployment modes.The script correctly converts WebSocket URLs to HTTP health check endpoints for both:
- Kong-proxied URLs (ending with
/realtime/v1)- Direct realtime container URLs (port 4000)
48-49: LGTM! Logging and timing setup are correct.The diagnostic logging will help troubleshoot connectivity issues, and using epoch time for elapsed calculation is appropriate.
68-69: LGTM! Command execution follows entrypoint best practices.Using
exec "$@"to replace the shell process with the main command is the standard and correct pattern for entrypoint scripts. This ensures proper signal handling and process management.
|
|
||
| # Bridge to Supabase CLI stack for direct container-to-container communication | ||
| # Enables services to connect directly to supabase_realtime without host.docker.internal | ||
| supabase_net: | ||
| external: true | ||
| name: pmoves-net |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find and inspect the pmoves/docker-compose.yml file
if [ -f "pmoves/docker-compose.yml" ]; then
# Get total line count
wc -l pmoves/docker-compose.yml
# Read lines around 1289-1294
echo "=== Lines 1285-1300 ==="
sed -n '1285,1300p' pmoves/docker-compose.yml | cat -n
else
echo "File not found"
fiRepository: POWERFULMOVES/PMOVES.AI
Length of output: 554
🏁 Script executed:
#!/bin/bash
# Search for all references to supabase_net in the compose file
echo "=== All references to supabase_net ==="
grep -n "supabase_net\|pmoves-net" pmoves/docker-compose.yml | head -20Repository: POWERFULMOVES/PMOVES.AI
Length of output: 314
🏁 Script executed:
#!/bin/bash
# Check file structure around networks section
echo "=== Network definitions in file ==="
grep -n "^networks:" pmoves/docker-compose.ymlRepository: POWERFULMOVES/PMOVES.AI
Length of output: 117
🏁 Script executed:
#!/bin/bash
# Look for any scripts or setup instructions
echo "=== Looking for setup/README files ==="
find pmoves -maxdepth 2 -type f \( -name "README*" -o -name "setup*" -o -name ".env*" \) 2>/dev/nullRepository: POWERFULMOVES/PMOVES.AI
Length of output: 525
🏁 Script executed:
#!/bin/bash
# Check which services use supabase_net
echo "=== Services using supabase_net ==="
sed -n '570,585p' pmoves/docker-compose.yml | cat -n
echo ""
sed -n '690,700p' pmoves/docker-compose.yml | cat -nRepository: POWERFULMOVES/PMOVES.AI
Length of output: 1137
🏁 Script executed:
#!/bin/bash
# Look at the services section structure and profiles
echo "=== Check for profiles in compose file ==="
grep -n "profiles:" pmoves/docker-compose.yml | head -20Repository: POWERFULMOVES/PMOVES.AI
Length of output: 1016
🏁 Script executed:
#!/bin/bash
# Look for documentation about network setup
echo "=== Checking README for network setup info ==="
grep -i "supabase\|network\|pmoves-net" pmoves/README.md | head -30Repository: POWERFULMOVES/PMOVES.AI
Length of output: 3067
Clarify the Supabase CLI network dependency in the setup documentation.
The external network pmoves-net (referenced as supabase_net) is only needed when services with profiles that require Supabase connectivity are active (e.g., workers, gateway, agents). When using external networks in Docker Compose, they must be created before attempting to connect services to them. This network is created by the Supabase CLI stack (supabase start or make supa-start).
Ensure the setup documentation (e.g., docs/FIRST_RUN.md) explicitly states that the Supabase CLI must be initialized before running compose profiles that include services requiring this network. Consider adding a startup order note or a pre-flight check in the Makefile to prevent confusion during deployment.
|
|
||
|
|
||
| async def _geometry_realtime_worker(ws_url: str, api_key: str) -> None: | ||
| import time |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Remove redundant import statement.
The time module is already imported at line 2. This duplicate import is unnecessary.
🔎 Proposed fix
- import time📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import time |
🤖 Prompt for AI Agents
In pmoves/services/hi-rag-gateway-v2/app.py around line 883, there is a
redundant "import time" statement (time is already imported at line 2); remove
the duplicate import at line 883 so the module is only imported once and update
any surrounding whitespace or grouping of imports to keep the file tidy.
Update PMOVES-Open-Notebook to include fix for UnboundLocalError in sources.py when creating sources via JSON API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GPU Dockerfile: add non-root user with video group (critical security fix) - wait-for-deps.sh: add curl timeout (--connect-timeout 5 --max-time 10) - app.py: add JSON parse failure logging at debug level - app.py: include exception type in grace period logging messages These changes address findings from the code-reviewer and silent-failure-hunter agents that reviewed PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pmoves/services/hi-rag-gateway-v2/app.py (1)
2-3: Consolidate duplicate top-level imports.Lines 2 and 3 duplicate many imports (os, time, math, json, logging, re, sys, contextlib, ipaddress). These should be consolidated into a single import statement.
🔎 Proposed fix
-import os, time, math, json, logging, re, sys, contextlib, ipaddress, copy, threading -import os, time, math, json, logging, re, sys, contextlib, ipaddress, importlib.util +import os, time, math, json, logging, re, sys, contextlib, ipaddress, copy, threading, importlib.util
♻️ Duplicate comments (2)
pmoves/services/hi-rag-gateway-v2/Dockerfile.gpu (1)
41-46: Critical: Wrapper entrypoint logic is flawed.The wrapper script has a logic error. The
wait-for-deps.shscript usesexec "$@"at the end (line 72 in wait-for-deps.sh), which replaces the current process. When called with/bin/true, it will wait for dependencies, thenexec /bin/true, which immediately exits. The subsequent lineexec /opt/nvidia/nvidia_entrypoint.sh "$@"will never execute.🔎 Proposed fix
The wrapper needs to be refactored to avoid the exec conflict. One approach is to inline the dependency wait logic directly in the wrapper:
-RUN printf '#!/bin/bash\nset -e\n/app/scripts/wait-for-deps.sh /bin/true\nexec /opt/nvidia/nvidia_entrypoint.sh "$@"\n' > /app/entrypoint-wrapper.sh && \ +RUN printf '#!/bin/bash\nset -e\n\n# Inline dependency wait logic\nSUPABASE_URL="${SUPABASE_REALTIME_URL:-ws://host.docker.internal:65421/realtime/v1}"\nDISABLED="${SUPABASE_REALTIME_DISABLED:-false}"\nMAX_WAIT="${WAIT_FOR_DEPS_MAX_WAIT:-120}"\nINTERVAL="${WAIT_FOR_DEPS_INTERVAL:-5}"\n\nif [ "$DISABLED" != "true" ] && [ "$DISABLED" != "1" ] && [ "$DISABLED" != "disabled" ] && [ "$DISABLED" != "none" ] && [ -n "$SUPABASE_URL" ]; then\n HEALTH_URL=$(echo "$SUPABASE_URL" | sed "s|^ws://|http://|;s|^wss://|https://|;s|/websocket.*||;s|/socket.*||;s|\\?.*||")\n if echo "$HEALTH_URL" | grep -q "/realtime/v1$"; then\n HEALTH_URL="${HEALTH_URL}/api/ping"\n elif echo "$HEALTH_URL" | grep -q ":4000"; then\n HEALTH_URL=$(echo "$HEALTH_URL" | sed "s|/socket/websocket||")\n HEALTH_URL="${HEALTH_URL}/api/ping"\n fi\n echo "[entrypoint] Waiting for Supabase realtime at $HEALTH_URL..."\n start_time=$(date +%s)\n while true; do\n if curl -sf --connect-timeout 5 --max-time 10 "$HEALTH_URL" -o /dev/null 2>&1; then\n echo "[entrypoint] Supabase realtime is ready!"\n break\n fi\n elapsed=$(($(date +%s) - start_time))\n if [ $elapsed -ge $MAX_WAIT ]; then\n echo "[entrypoint] Warning: Supabase realtime not ready after ${MAX_WAIT}s, starting anyway..."\n break\n fi\n echo "[entrypoint] Waiting... ($elapsed/${MAX_WAIT}s)"\n sleep $INTERVAL\n done\nfi\n\n# Now run the actual command via NVIDIA entrypoint\nexec /opt/nvidia/nvidia_entrypoint.sh "$@"\n' > /app/entrypoint-wrapper.sh && \ chmod +x /app/entrypoint-wrapper.shAlternatively, modify wait-for-deps.sh to accept a
--no-execflag that skips the final exec when used as a library.pmoves/services/hi-rag-gateway-v2/app.py (1)
883-883: Remove redundant import statement.The
timemodule is already imported at line 2. This duplicate import inside the function is unnecessary.🔎 Proposed fix
- import time
🧹 Nitpick comments (1)
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh (1)
20-30: Minor: Documentation inconsistency.The disabled check on line 21 accepts "none" as a valid value, but the documentation comment on line 9 doesn't mention "none". Consider updating the comment for completeness.
🔎 Proposed fix
-# SUPABASE_REALTIME_DISABLED - Set to "true" to skip the wait (default: false) +# SUPABASE_REALTIME_DISABLED - Set to "true", "1", "disabled", or "none" to skip the wait (default: false)
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
PMOVES-Open-Notebook(1 hunks)pmoves/services/hi-rag-gateway-v2/Dockerfile.gpu(1 hunks)pmoves/services/hi-rag-gateway-v2/app.py(4 hunks)pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- PMOVES-Open-Notebook
🧰 Additional context used
📓 Path-based instructions (3)
pmoves/services/**/*.py
📄 CodeRabbit inference engine (pmoves/AGENTS.md)
pmoves/services/**/*.py: Keep modules small and single-purpose; share helpers inservices/common/
FastAPI routes: snake_case function names; path names kebab-case only in URLs
Validate payloads against schemas before publishing events usingservices/common/events.py
Files:
pmoves/services/hi-rag-gateway-v2/app.py
pmoves/**/*.py
📄 CodeRabbit inference engine (pmoves/AGENTS.md)
Python 3.11+, 4-space indentation, prefer type hints
Files:
pmoves/services/hi-rag-gateway-v2/app.py
**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Use Python 3.11+ with 4-space indentation and prefer type hints in all Python code
Files:
pmoves/services/hi-rag-gateway-v2/app.py
🧠 Learnings (6)
📚 Learning: 2025-12-15T12:04:26.230Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/docs/ARTSTUFF/realtime/AGENTS.md:0-0
Timestamp: 2025-12-15T12:04:26.230Z
Learning: Applies to pmoves/docs/ARTSTUFF/realtime/**/*.js : When a 3rd party package needs to be installed or repository downloaded, include them in the scripts
Applied to files:
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh
📚 Learning: 2025-12-15T12:01:31.388Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/docs/ARTSTUFF/realtime/CLAUDE.md:0-0
Timestamp: 2025-12-15T12:01:31.388Z
Learning: Applies to pmoves/docs/ARTSTUFF/realtime/**/{install,start,update,reset}.js : Scripts must be able to replicate install and launch steps 100% - include all 3rd party package installations and repository downloads in scripts, do not assume end user's system state, and make everything self-contained
Applied to files:
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh
📚 Learning: 2025-12-15T12:04:26.230Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/docs/ARTSTUFF/realtime/AGENTS.md:0-0
Timestamp: 2025-12-15T12:04:26.230Z
Learning: Applies to pmoves/docs/ARTSTUFF/realtime/**/*.js : Scripts must be able to replicate install and launch steps 100%. Make everything self-contained and do not assume end user's system state
Applied to files:
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh
📚 Learning: 2025-12-07T11:03:53.415Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/AGENTS.md:0-0
Timestamp: 2025-12-07T11:03:53.415Z
Learning: Applies to pmoves/services/hi-rag-gateway/**/*.py : Hi-RAG gateway: after touching reranker or embedding code, run `make -C pmoves smoke-gpu` to validate FlagEmbedding/Qwen rerankers
Applied to files:
pmoves/services/hi-rag-gateway-v2/Dockerfile.gpu
📚 Learning: 2025-12-15T12:04:26.230Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/docs/ARTSTUFF/realtime/AGENTS.md:0-0
Timestamp: 2025-12-15T12:04:26.230Z
Learning: Applies to pmoves/docs/ARTSTUFF/realtime/**/*.js : Try to find development options to launch apps without Docker. Use automatic installation and launch for the user's platform via scripts instead of Docker
Applied to files:
pmoves/services/hi-rag-gateway-v2/Dockerfile.gpu
📚 Learning: 2025-12-07T11:03:53.415Z
Learnt from: CR
Repo: POWERFULMOVES/PMOVES.AI PR: 0
File: pmoves/AGENTS.md:0-0
Timestamp: 2025-12-07T11:03:53.415Z
Learning: Agents images: default uses published images set in `pmoves/env.shared`. For custom code, build a thin overlay FROM the published image and tag it
Applied to files:
pmoves/services/hi-rag-gateway-v2/Dockerfile.gpu
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: tests (3.11)
🔇 Additional comments (11)
pmoves/services/hi-rag-gateway-v2/Dockerfile.gpu (2)
38-39: LGTM!Correctly grants executable permission to the wait-for-deps.sh script.
48-53: LGTM!Proper non-root user setup with video group membership for GPU device access. Good security practice.
pmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.sh (4)
1-18: LGTM!Script header and environment variable setup are well-documented and correct.
32-46: LGTM!URL conversion logic correctly handles both Kong-proxied and direct container realtime endpoints.
48-69: LGTM!Health check loop with appropriate timeouts and graceful degradation when the service isn't ready.
71-72: LGTM!Standard entrypoint pattern to replace the shell with the main command.
pmoves/services/hi-rag-gateway-v2/app.py (5)
209-210: LGTM!New configuration constants for exponential backoff cap and startup grace period are correctly defined.
890-892: LGTM!Properly initializes startup timing and backoff for the retry loop.
922-923: LGTM!Correctly resets backoff delay to base value on successful connection, preventing unnecessarily long delays after transient failures.
929-931: LGTM!Appropriate debug-level logging for JSON decode errors on non-critical message parsing failures.
962-981: LGTM!Excellent startup grace period implementation:
- Reduces log noise with WARNING level during the initial grace period
- Shows remaining grace time for observability
- Escalates to ERROR after grace expires
- Implements exponential backoff with configurable cap
This directly addresses the PR objective of handling ~109 HTTP 502 errors during Docker restart without flooding logs.
- Add PMOVES-Ultimate-TTS-Studio as git submodule - Sync fork with upstream SUP3RMASS1VE/Ultimate-TTS-Studio-SUP3R-Edition: - VoxCPM fix and 1.5 update - Fish Speech checkpoint download fix - Vibevoice model name change - Flash attention support for VibeVoice - Chatterbox turbo and watermark removal - Update Dockerfile to clone from synced PMOVES fork - Use upstream requirements.txt with all 7 engine dependencies - Add test_all_tts_engines.py for comprehensive engine testing via gradio_client Engines: KittenTTS, Kokoro, F5-TTS, IndexTTS2, Fish Speech, ChatterboxTTS, VoxCPM 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- wait-for-deps.sh: add WAIT_FOR_DEPS_ALLOW_DEGRADED flag for explicit degraded mode opt-in - wait-for-deps.sh: log curl stderr on failure for better debugging - wait-for-deps.sh: add URL validation before health check - app.py: add debug-level stack traces during startup grace period - app.py: add inline documentation for retry configuration vars - Dockerfile.gpu: fix comment to accurately describe two-phase startup These improvements address all findings from the code-reviewer, silent-failure-hunter, and comment-analyzer review agents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove duplicate import line (lines 1-2 were near-identical) - Remove redundant `import time` inside function (already imported at module level) Addresses CodeRabbit review feedback from PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove duplicate import line (lines 1-2 were near-identical) - Remove redundant `import time` inside function (already imported at module level) Addresses CodeRabbit review feedback from PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents the two-phase startup pattern with exec in child scripts, explaining why CodeRabbit's "Critical" flag was incorrect. Key insight: exec in a called script only replaces the child process, not the parent wrapper. This is a valid pattern for GPU containers that need both dependency waiting and NVIDIA entrypoint initialization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GPU Dockerfile: add non-root user with video group (critical security fix) - wait-for-deps.sh: add curl timeout (--connect-timeout 5 --max-time 10) - app.py: add JSON parse failure logging at debug level - app.py: include exception type in grace period logging messages These changes address findings from the code-reviewer and silent-failure-hunter agents that reviewed PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove duplicate import line (lines 1-2 were near-identical) - Remove redundant `import time` inside function (already imported at module level) Addresses CodeRabbit review feedback from PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GPU Dockerfile: add non-root user with video group (critical security fix) - wait-for-deps.sh: add curl timeout (--connect-timeout 5 --max-time 10) - app.py: add JSON parse failure logging at debug level - app.py: include exception type in grace period logging messages These changes address findings from the code-reviewer and silent-failure-hunter agents that reviewed PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove duplicate import line (lines 1-2 were near-identical) - Remove redundant `import time` inside function (already imported at module level) Addresses CodeRabbit review feedback from PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(hirag): add wait-for-deps startup script Add entrypoint script that waits for Supabase realtime to be healthy before starting the Hi-RAG application, preventing startup errors on Docker restarts. New files: - scripts/wait-for-deps.sh: Health check script with configurable timeout Dockerfile changes: - Install curl for health checks - Add ENTRYPOINT to run wait-for-deps.sh before uvicorn - GPU variant: Create wrapper entrypoint for NVIDIA compatibility Environment variables: - WAIT_FOR_DEPS_MAX_WAIT: Maximum wait time (default: 120s) - WAIT_FOR_DEPS_INTERVAL: Check interval (default: 5s) - SUPABASE_REALTIME_DISABLED: Skip wait if set to true The script checks Supabase realtime health via HTTP ping before starting the application, eliminating the ~109 retry errors that occurred during cold starts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(hirag): add exponential backoff with startup grace period Improve Supabase realtime connection resilience with smarter retry logic and reduced log noise during startup. Changes to _geometry_realtime_worker: - Add exponential backoff: 5s → 10s → 20s → 40s → 60s (max) - Add startup grace period (120s) with WARNING level logging - Reset backoff on successful connection - Track elapsed time for grace period calculation New environment variables: - GEOMETRY_REALTIME_MAX_BACKOFF: Maximum retry delay (default: 60s) - GEOMETRY_REALTIME_STARTUP_GRACE: Grace period duration (default: 120s) Before: Fixed 5s retry, ERROR level for all failures After: Exponential backoff, WARNING during startup grace period This reduces log noise from ~109 ERROR entries to a handful of WARNING messages during normal startup scenarios. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): address PR review findings for restart stability - GPU Dockerfile: add non-root user with video group (critical security fix) - wait-for-deps.sh: add curl timeout (--connect-timeout 5 --max-time 10) - app.py: add JSON parse failure logging at debug level - app.py: include exception type in grace period logging messages These changes address findings from the code-reviewer and silent-failure-hunter agents that reviewed PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): implement PR review improvements - wait-for-deps.sh: add WAIT_FOR_DEPS_ALLOW_DEGRADED flag for explicit degraded mode opt-in - wait-for-deps.sh: log curl stderr on failure for better debugging - wait-for-deps.sh: add URL validation before health check - app.py: add debug-level stack traces during startup grace period - app.py: add inline documentation for retry configuration vars - Dockerfile.gpu: fix comment to accurately describe two-phase startup These improvements address all findings from the code-reviewer, silent-failure-hunter, and comment-analyzer review agents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): remove redundant imports in app.py - Remove duplicate import line (lines 1-2 were near-identical) - Remove redundant `import time` inside function (already imported at module level) Addresses CodeRabbit review feedback from PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): use container DNS for Supabase realtime instead of host.docker.internal (#335) The host.docker.internal hostname resolves to Docker Desktop's gateway IP (192.168.65.254) in WSL2, which doesn't properly route to host-bound ports. This caused Hi-RAG to fail connecting to Supabase realtime after Docker restarts. Changed default SUPABASE_REALTIME_URL from: ws://host.docker.internal:65421/realtime/v1 to: ws://supabase_kong_PMOVES.AI:8000/realtime/v1 Since both containers are on pmoves-net, direct container-to-container DNS resolution works reliably. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Codex Agent <codex-agent@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): restore EvoSwarm mode and HRM integration Fixes critical dead code in geometry_decode_text function: - Changed `else` to `elif mode == "swarm"` to make swarm mode reachable - Integrated HRM refinement in learned mode (maybe_refine) - Added HRM status in default geometry mode - Consistent response shape across all modes (namespace, modality, builder_pack) Before: swarm mode was unreachable due to early returns in if-else After: proper if-elif-else routing for learned/swarm/default modes Resolves CodeRabbit review finding in PR #334 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address PR #334 review issues across 4 files route.ts (Critical): - Import and use logError() instead of console.error - Return HTTP 503 for configuration errors - Return HTTP 502 for upstream/network failures app.py (Important): - Change except Exception to except (ImportError, ModuleNotFoundError) - Fix variable shadowing: use top_pts instead of re-declaring pts Dockerfile (Suggestions): - Remove duplicate comment block at Step 12b - Replace Pinokio line number references with descriptive names - Fix huggingface-hub version comment (0.30.0 → 0.25.0) sync.py (Suggestion): - Make offline mode opt-in via NOTEBOOK_SYNC_GRACEFUL_DEGRADATION env var - Fail explicitly if OPEN_NOTEBOOK_API_URL not set (unless env var enabled) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): remove extra_headers from WebSocket (uvloop incompatibility) (#400) The websockets library's extra_headers parameter is not supported by uvloop's create_connection(), which is used by uvicorn. Removed the extra_headers parameter and rely on the apikey URL parameter for Supabase realtime authentication. Also: - Add pmoves/vendor/python/ to .gitignore (unpacked packages) - Remove 275+ unpacked package files from git tracking Vendor submodules were already configured with POWERFULMOVES forks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Codex Agent <codex-agent@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Codex Agent <codex-agent@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat(hirag): add wait-for-deps startup script Add entrypoint script that waits for Supabase realtime to be healthy before starting the Hi-RAG application, preventing startup errors on Docker restarts. New files: - scripts/wait-for-deps.sh: Health check script with configurable timeout Dockerfile changes: - Install curl for health checks - Add ENTRYPOINT to run wait-for-deps.sh before uvicorn - GPU variant: Create wrapper entrypoint for NVIDIA compatibility Environment variables: - WAIT_FOR_DEPS_MAX_WAIT: Maximum wait time (default: 120s) - WAIT_FOR_DEPS_INTERVAL: Check interval (default: 5s) - SUPABASE_REALTIME_DISABLED: Skip wait if set to true The script checks Supabase realtime health via HTTP ping before starting the application, eliminating the ~109 retry errors that occurred during cold starts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(hirag): add exponential backoff with startup grace period Improve Supabase realtime connection resilience with smarter retry logic and reduced log noise during startup. Changes to _geometry_realtime_worker: - Add exponential backoff: 5s → 10s → 20s → 40s → 60s (max) - Add startup grace period (120s) with WARNING level logging - Reset backoff on successful connection - Track elapsed time for grace period calculation New environment variables: - GEOMETRY_REALTIME_MAX_BACKOFF: Maximum retry delay (default: 60s) - GEOMETRY_REALTIME_STARTUP_GRACE: Grace period duration (default: 120s) Before: Fixed 5s retry, ERROR level for all failures After: Exponential backoff, WARNING during startup grace period This reduces log noise from ~109 ERROR entries to a handful of WARNING messages during normal startup scenarios. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): address PR review findings for restart stability - GPU Dockerfile: add non-root user with video group (critical security fix) - wait-for-deps.sh: add curl timeout (--connect-timeout 5 --max-time 10) - app.py: add JSON parse failure logging at debug level - app.py: include exception type in grace period logging messages These changes address findings from the code-reviewer and silent-failure-hunter agents that reviewed PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): implement PR review improvements - wait-for-deps.sh: add WAIT_FOR_DEPS_ALLOW_DEGRADED flag for explicit degraded mode opt-in - wait-for-deps.sh: log curl stderr on failure for better debugging - wait-for-deps.sh: add URL validation before health check - app.py: add debug-level stack traces during startup grace period - app.py: add inline documentation for retry configuration vars - Dockerfile.gpu: fix comment to accurately describe two-phase startup These improvements address all findings from the code-reviewer, silent-failure-hunter, and comment-analyzer review agents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): remove redundant imports in app.py - Remove duplicate import line (lines 1-2 were near-identical) - Remove redundant `import time` inside function (already imported at module level) Addresses CodeRabbit review feedback from PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): use container DNS for Supabase realtime instead of host.docker.internal (#335) The host.docker.internal hostname resolves to Docker Desktop's gateway IP (192.168.65.254) in WSL2, which doesn't properly route to host-bound ports. This caused Hi-RAG to fail connecting to Supabase realtime after Docker restarts. Changed default SUPABASE_REALTIME_URL from: ws://host.docker.internal:65421/realtime/v1 to: ws://supabase_kong_PMOVES.AI:8000/realtime/v1 Since both containers are on pmoves-net, direct container-to-container DNS resolution works reliably. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Codex Agent <codex-agent@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): restore EvoSwarm mode and HRM integration Fixes critical dead code in geometry_decode_text function: - Changed `else` to `elif mode == "swarm"` to make swarm mode reachable - Integrated HRM refinement in learned mode (maybe_refine) - Added HRM status in default geometry mode - Consistent response shape across all modes (namespace, modality, builder_pack) Before: swarm mode was unreachable due to early returns in if-else After: proper if-elif-else routing for learned/swarm/default modes Resolves CodeRabbit review finding in PR #334 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address PR #334 review issues across 4 files route.ts (Critical): - Import and use logError() instead of console.error - Return HTTP 503 for configuration errors - Return HTTP 502 for upstream/network failures app.py (Important): - Change except Exception to except (ImportError, ModuleNotFoundError) - Fix variable shadowing: use top_pts instead of re-declaring pts Dockerfile (Suggestions): - Remove duplicate comment block at Step 12b - Replace Pinokio line number references with descriptive names - Fix huggingface-hub version comment (0.30.0 → 0.25.0) sync.py (Suggestion): - Make offline mode opt-in via NOTEBOOK_SYNC_GRACEFUL_DEGRADATION env var - Fail explicitly if OPEN_NOTEBOOK_API_URL not set (unless env var enabled) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hirag): remove extra_headers from WebSocket (uvloop incompatibility) (#400) The websockets library's extra_headers parameter is not supported by uvloop's create_connection(), which is used by uvicorn. Removed the extra_headers parameter and rely on the apikey URL parameter for Supabase realtime authentication. Also: - Add pmoves/vendor/python/ to .gitignore (unpacked packages) - Remove 275+ unpacked package files from git tracking Vendor submodules were already configured with POWERFULMOVES forks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Codex Agent <codex-agent@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Codex Agent <codex-agent@example.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- GPU Dockerfile: add non-root user with video group (critical security fix) - wait-for-deps.sh: add curl timeout (--connect-timeout 5 --max-time 10) - app.py: add JSON parse failure logging at debug level - app.py: include exception type in grace period logging messages These changes address findings from the code-reviewer and silent-failure-hunter agents that reviewed PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tability fix(hirag): Docker restart stability - Supabase realtime connection resilience
- Remove duplicate import line (lines 1-2 were near-identical) - Remove redundant `import time` inside function (already imported at module level) Addresses CodeRabbit review feedback from PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove duplicate import line (lines 1-2 were near-identical) - Remove redundant `import time` inside function (already imported at module level) Addresses CodeRabbit review feedback from PR #333. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents the two-phase startup pattern with exec in child scripts, explaining why CodeRabbit's "Critical" flag was incorrect. Key insight: exec in a called script only replaces the child process, not the parent wrapper. This is a valid pattern for GPU containers that need both dependency waiting and NVIDIA entrypoint initialization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Fixes Docker restart instability where Hi-RAG experienced ~109 HTTP 502 errors before successfully connecting to Supabase realtime.
Root Cause
Solution: Multi-Layer Fix
1. Network Bridge (
docker-compose.yml)supabase_netexternal network reference to PMOVES stacksupabase_realtime_PMOVES.AI:40002. Startup Health Check (
wait-for-deps.sh)3. Exponential Backoff (
app.py)Changes
pmoves/docker-compose.ymlsupabase_netexternal network + update Hi-RAG networkspmoves/services/hi-rag-gateway-v2/Dockerfilepmoves/services/hi-rag-gateway-v2/Dockerfile.gpupmoves/services/hi-rag-gateway-v2/scripts/wait-for-deps.shpmoves/services/hi-rag-gateway-v2/app.pyNew Environment Variables
WAIT_FOR_DEPS_MAX_WAITWAIT_FOR_DEPS_INTERVALGEOMETRY_REALTIME_MAX_BACKOFFGEOMETRY_REALTIME_STARTUP_GRACETest plan
Startup Logs (After Fix)
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Infrastructure
✏️ Tip: You can customize this high-level summary in your review settings.