Skip to content

🔒 [security fix] Inject NEXTAUTH_SECRET, SALT, and ENCRYPTION_KEY via env to avoid hardcoding#101

Merged
sheepdestroyer merged 8 commits into
masterfrom
jules-9740168748720773324-8a1008bb
Jun 30, 2026
Merged

🔒 [security fix] Inject NEXTAUTH_SECRET, SALT, and ENCRYPTION_KEY via env to avoid hardcoding#101
sheepdestroyer merged 8 commits into
masterfrom
jules-9740168748720773324-8a1008bb

Conversation

@sheepdestroyer

@sheepdestroyer sheepdestroyer commented Jun 24, 2026

Copy link
Copy Markdown
Owner

🎯 What: Hardcoded security secrets (NEXTAUTH_SECRET, SALT, and ENCRYPTION_KEY) in pod.yaml were replaced with placeholders. The start-stack.sh deployment script was updated to dynamically generate these cryptographically secure values (using openssl rand) and store them in .env.

⚠️ Risk: Hardcoded secrets in source control (like pod.yaml) can lead to unauthorized access, privilege escalation, or data decryption if the repository is compromised or accessed by unauthorized individuals.

🛡️ Solution: Implemented environment-based secret injection. The deployment script now ensures these keys are automatically and securely generated on first deployment if they are missing, appended to .env for persistence, and dynamically injected into the pod configuration at runtime, keeping them safely out of source control.


PR created automatically by Jules for task 9740168748720773324 started by @sheepdestroyer

Summary by CodeRabbit

  • New Features

    • Improved startup handling for secrets and configuration, including automatic generation of missing auth-related values and stricter permission handling for local environment files.
    • Added clearer readiness checks for services and expanded notebook-related documentation.
  • Bug Fixes

    • Strengthened validation for dashboard annotations and router configuration to catch invalid or missing values earlier.
    • Improved command execution so failures now surface instead of being silently ignored.
  • Tests

    • Added and updated automated coverage for startup, routing, entrypoint, latency, and tier behavior.
  • Documentation

    • Clarified health check behavior and added a new knowledge base reference.

… env to avoid hardcoding

Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @sheepdestroyer, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb8edee4-86c8-42fb-9158-32038c93a4e3

📥 Commits

Reviewing files that changed from the base of the PR and between d529159 and 9299998.

📒 Files selected for processing (10)
  • .github/workflows/test.yml
  • README.md
  • get_pr_status.py
  • litellm/tests/test_entrypoint.py
  • pod.yaml
  • router/Dockerfile
  • router/main.py
  • start-stack.sh
  • test_agy_tiers.py
  • test_stream_latency.py

📝 Walkthrough

Walkthrough

This PR generates and injects auth secrets (NEXTAUTH_SECRET, SALT, ENCRYPTION_KEY) via openssl in start-stack.sh, propagates them as placeholders into pod.yaml, tightens router API key resolution and annotation validation in router/main.py, pins pydantic to >=2.0,<3.0, refactors the AGY tier test harness and run_cmd helper, and applies minor whitespace/tooling fixes.

Changes

Secret Management and Deployment Config

Layer / File(s) Summary
Secret generation, env permissions, and pod rendering
start-stack.sh, pod.yaml
start-stack.sh ensures .env has chmod 600, generates missing NEXTAUTH_SECRET/SALT/ENCRYPTION_KEY via openssl, exports them into render_pod_yaml, and replaces new placeholders in the embedded Python renderer. pod.yaml switches langfuse-web env vars to *_PLACEHOLDER values and changes valkey-lf readiness from a tcpSocket probe to an exec probe running valkey-cli ping.
README health check and NotebookLM docs
README.md
Removes --user/--password from the clickhouse-db readiness probe command and adds a "NotebookLM Companion Knowledge Base" section.

Router Internals and Validation

Layer / File(s) Summary
Router API key env resolution
router/main.py
Removes the local-token default for router_api_key; startup raises if api_key config is absent or the referenced env var is empty, with a pytest-only fallback to local-token.
Annotation model constraints and payload validation
router/main.py, router/Dockerfile, .github/workflows/test.yml
Adds MAX_ANNOTATION_KEY_LENGTH and MAX_ANNOTATION_ITEM_BYTES constants, changes AnnotationItem to extra="forbid" and adds max_length=100 to ts, and extends AnnotationPayload validation to enforce key length, stable-key format, and per-item byte size. Pydantic is pinned to >=2.0,<3.0 in Dockerfile and CI.

AGY Harness, PR Status Helper, and Classifier

Layer / File(s) Summary
run_cmd subprocess refactor
get_pr_status.py
Replaces run_cmd(cmd: str) + shlex.split with run_cmd(cmd_list) using subprocess.run(shell=False, check=True), so non-zero exits raise CalledProcessError.
AGY tier runner and scenarios
test_agy_tiers.py
Replaces test_tier with run_tier_test, adds quota-exhaustion detection via RESOURCE_EXHAUSTED/429 in stderr, and rewires independent-tier, continuation, and fallback-chain scenarios.
Classifier API key and entrypoint tests
test_classifier_accuracy.py, litellm/tests/test_entrypoint.py
test_classifier_accuracy.py sources bearer token from ROUTER_API_KEY env var and restructures calculate_metrics. litellm/tests/test_entrypoint.py adds sys.modules snapshot/restore and three check_tcp_port unit tests (success, connection-refused, exception).
Whitespace and formatting cleanup
test_agy_behavior.py, test_antigravity.py, test_circuit_breaker.py, test_stream_latency.py
Whitespace-only adjustments with no behavioral changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • sheepdestroyer/LLM-Routing#4: Both PRs modify router/main.py annotation validation logic, specifically AnnotationItem/AnnotationPayload constraints and persistence handling.
  • sheepdestroyer/LLM-Routing#61: Both PRs add pytest coverage for router internals, overlapping in test module structure and mocking patterns.

Poem

🐇 A rabbit hops through .env at dawn,
Spinning secrets with openssl flair,
Placeholders bloom where raw keys once shone,
The router now checks — no defaults to spare.
Extra fields? Forbidden! Byte limits hold.
Our warren grows tighter, secrets more bold! 🔐

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.63% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main security-focused change: moving NEXTAUTH_SECRET, SALT, and ENCRYPTION_KEY to environment injection instead of hardcoding.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jules-9740168748720773324-8a1008bb

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sheepdestroyer

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces hardcoded secrets in pod.yaml with placeholders and updates start-stack.sh to dynamically generate cryptographically secure values using openssl and store them in .env. It also renames test_tier to run_tier_test in test_agy_tiers.py. Feedback is provided to check for openssl availability before generating keys to prevent empty values, and to secure the .env file permissions with chmod 600.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread start-stack.sh
Comment on lines +82 to +98
if [ -z "$NEXTAUTH_SECRET" ]; then
NEXTAUTH_SECRET="$(openssl rand -base64 32)"
echo "NEXTAUTH_SECRET=\"$NEXTAUTH_SECRET\"" >> "$ENV_FILE"
echo "✓ Generated new NEXTAUTH_SECRET and saved to $ENV_FILE"
fi

if [ -z "$SALT" ]; then
SALT="$(openssl rand -hex 16)"
echo "SALT=\"$SALT\"" >> "$ENV_FILE"
echo "✓ Generated new SALT and saved to $ENV_FILE"
fi

if [ -z "$ENCRYPTION_KEY" ]; then
ENCRYPTION_KEY="$(openssl rand -hex 32)"
echo "ENCRYPTION_KEY=\"$ENCRYPTION_KEY\"" >> "$ENV_FILE"
echo "✓ Generated new ENCRYPTION_KEY and saved to $ENV_FILE"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

Security & Robustness Improvements

  1. Fail-Fast on Missing openssl:
    If openssl is not installed or fails, the script will silently write empty values to .env and proceed. This results in empty/weak cryptographic keys and salts in pod.yaml, which is a significant security risk. We should check for openssl availability before attempting generation.

  2. Secure .env File Permissions:
    The .env file stores highly sensitive secrets (including OPENROUTER_API_KEY, NEXTAUTH_SECRET, SALT, and ENCRYPTION_KEY). We should ensure the file is secured with chmod 600 (read/write by owner only) to prevent unauthorized local users from reading these secrets.

if [ -z "$NEXTAUTH_SECRET" ] || [ -z "$SALT" ] || [ -z "$ENCRYPTION_KEY" ]; then
    if ! command -v openssl &>/dev/null; then
        echo "❌ Error: 'openssl' is required to generate secure random keys but was not found in PATH."
        exit 1
    fi
fi

# Ensure the env file exists and has secure permissions (owner read/write only)
touch "$ENV_FILE"
chmod 600 "$ENV_FILE"

if [ -z "$NEXTAUTH_SECRET" ]; then
    NEXTAUTH_SECRET="$(openssl rand -base64 32)"
    echo "NEXTAUTH_SECRET=\"$NEXTAUTH_SECRET\"" >> "$ENV_FILE"
    echo "✓ Generated new NEXTAUTH_SECRET and saved to $ENV_FILE"
fi

if [ -z "$SALT" ]; then
    SALT="$(openssl rand -hex 16)"
    echo "SALT=\"$SALT\"" >> "$ENV_FILE"
    echo "✓ Generated new SALT and saved to $ENV_FILE"
fi

if [ -z "$ENCRYPTION_KEY" ]; then
    ENCRYPTION_KEY="$(openssl rand -hex 32)"
    echo "ENCRYPTION_KEY=\"$ENCRYPTION_KEY\"" >> "$ENV_FILE"
    echo "✓ Generated new ENCRYPTION_KEY and saved to $ENV_FILE"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent points! I've added a check for the openssl command before attempting to generate any missing secrets and ensure the .env file exists with chmod 600 permissions (read/write by owner only) to secure it from unauthorized access.

@sheepdestroyer

Copy link
Copy Markdown
Owner Author

@jules
There are unaddressed Reviews & Comments on this PR#101
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
@sheepdestroyer

Copy link
Copy Markdown
Owner Author

@jules resolve conflicts

@google-labs-jules

Copy link
Copy Markdown
Contributor

@jules resolve conflicts

I've successfully merged master into the PR branch, resolved the conflicts in start-stack.sh, and verified that the tests still pass.

Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New security issues found

Comment thread get_pr_status.py Outdated
# 1. Provide a static list of strings for args rather than a single string.
# 2. Use shell=False
args = shlex.split(cmd)
result = subprocess.run(args, shell=False, capture_output=True, text=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security (python.lang.security.audit.dangerous-subprocess-use-audit): Detected subprocess function 'run' without a static string. If this data can be controlled by a malicious actor, it may be an instance of command injection. Audit the use of this call to ensure it is not controllable by an external resource. You may consider using 'shlex.escape()'.

Source: opengrep

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test_agy_tiers.py (1)

73-76: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Await the child after kill() on timeout.

Line 74 kills the subprocess, but the function returns before reaping it. In repeated runs this can leave zombie children behind and make the test harness flaky.

Suggested fix
     except asyncio.TimeoutError:
         proc.kill()
+        await proc.communicate()
         print(f"❌ TIMEOUT (30s)")
         return False, None, None
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test_agy_tiers.py` around lines 73 - 76, The timeout cleanup in the
subprocess handling path needs to reap the child after proc.kill() before
returning. Update the timeout branch in the function that catches
asyncio.TimeoutError to await the terminated process (using the existing proc
handle) after killing it, then preserve the existing timeout return path so
repeated runs do not leave unreaped children behind.
🧹 Nitpick comments (1)
test_stream_latency.py (1)

73-73: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove unnecessary f-string prefix.

Line 73 uses an f-string without any placeholders. Drop the f prefix for clarity.

-        print(f"\n\nStream Finished!")
+        print("\n\nStream Finished!")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test_stream_latency.py` at line 73, The print statement in the stream
completion message is using an f-string even though it has no placeholders, so
simplify it by removing the unnecessary string interpolation prefix. Update the
statement in the stream-finished output block to use a plain string literal,
keeping the existing message text unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@get_pr_status.py`:
- Around line 8-10: The subprocess call in get_pr_status.py currently discards
failures because run() is used without checking the return code, so a bad
command looks like empty output. Update the logic around shlex.split(cmd) and
subprocess.run(...) to surface non-zero exits, either by checking
result.returncode and raising an error or by enabling failure handling, and keep
the stdout.strip() path only for successful commands.

In `@router/config.yaml`:
- Line 9: The `ROUTER_API_KEY` handling still falls back to `local-token` in
`router/main.py`, which allows a missing or mistyped environment variable to
silently use a hardcoded bearer token. Update the API key resolution path in
`main` (and any related startup/config loading logic that reads `api_key` from
`router/config.yaml`) so it fails closed: if `ROUTER_API_KEY` is absent or
empty, raise an error and stop startup instead of applying the fallback. Use the
existing `ROUTER_API_KEY`/`api_key` symbols to locate the env lookup and remove
the default token behavior.

In `@start-stack.sh`:
- Around line 362-363: The password substitution in the DSN templating logic is
injecting POSTGRES_PASSWORD directly, which can break postgresql:// URLs when
the value contains reserved characters. Update the replacement logic in the
script around the postgres password handling to URL-encode the
environment-provided password before inserting it into any DSN, and keep the
existing placeholders in sync for the postgres connection strings.
- Around line 45-49: The code has two security and prerequisite issues: First,
the openssl command at line 47 is executed before checking if openssl is
available as a prerequisite, which could fail silently or unexpectedly. Second,
the chmod 600 permission change at line 49 happens after the file is created and
written to at line 48, meaning the file could be created with default umask
permissions (potentially world-readable) for a brief moment. Fix this by adding
a prerequisite check for openssl availability before this section, and by
creating the ENV_FILE with secure permissions (600) immediately when it's first
created, before writing any secrets to it. You can do this by using a redirect
operator that creates the file with proper permissions or by creating the file
with touch and explicit mode before appending the password.

In `@test_agy_tiers.py`:
- Around line 58-62: The tier quota handling in run_tier_test currently returns
conv_id even on failure, which later lets the test flow reuse a stale
conversation ID. Update the conv_id caching/selection logic in the Test 2
continuation path so it only stores or reuses IDs from successful tier runs, and
guard the resume logic with the success flag before seeding continuation tests.
Use the run_tier_test result tuple and the downstream selection code around the
continuation test flow to ensure failed runs never become cached sources.
- Around line 22-24: The default-tier case in the test setup still inherits
CASCADE_DEFAULT_MODEL_OVERRIDE from the parent environment because env is copied
before the tier-specific logic. Update the environment preparation in the test
around the tier loop so the no-override path explicitly removes
CASCADE_DEFAULT_MODEL_OVERRIDE from env, while still setting it for the override
case; use the existing tier["override"] branch in test_agy_tiers.py to keep the
runs independent.

In `@test_classifier_accuracy.py`:
- Line 127: Remove the placeholder-free f-strings in the classifier accuracy
test script so Ruff no longer raises F541. Update the affected print calls in
the evaluation setup/output flow (including the one that prints “Starting
Classifier Accuracy Evaluation Suite...” and the other matching print at the
later location) to plain string literals, keeping the messages unchanged.

---

Outside diff comments:
In `@test_agy_tiers.py`:
- Around line 73-76: The timeout cleanup in the subprocess handling path needs
to reap the child after proc.kill() before returning. Update the timeout branch
in the function that catches asyncio.TimeoutError to await the terminated
process (using the existing proc handle) after killing it, then preserve the
existing timeout return path so repeated runs do not leave unreaped children
behind.

---

Nitpick comments:
In `@test_stream_latency.py`:
- Line 73: The print statement in the stream completion message is using an
f-string even though it has no placeholders, so simplify it by removing the
unnecessary string interpolation prefix. Update the statement in the
stream-finished output block to use a plain string literal, keeping the existing
message text unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d754b9cd-a31e-441e-ac18-fc6493bad119

📥 Commits

Reviewing files that changed from the base of the PR and between d48f1a6 and edb07c6.

📒 Files selected for processing (25)
  • get_pr_status.py
  • patch_comment.diff
  • pod.yaml
  • pr_description.txt
  • raw_output.txt
  • router/config.yaml
  • router/main.py
  • router/memory_mcp.py
  • router/test_memory_mcp.py
  • router/tests/test_agy_proxy.py
  • router/tests/test_dashboard_data.py
  • router/tests/test_estimate_prompt_tokens.py
  • scripts/benchmark_classifier.py
  • scripts/classify_direct.py
  • scripts/reclassify_all.py
  • start-stack.sh
  • test_agy_behavior.py
  • test_agy_tiers.py
  • test_antigravity.py
  • test_circuit_breaker.py
  • test_classifier_accuracy.py
  • test_compute_free_model_score.py
  • test_pie_chart_gradient.py
  • test_record_tool_usage.py
  • test_stream_latency.py
💤 Files with no reviewable changes (5)
  • patch_comment.diff
  • router/tests/test_agy_proxy.py
  • raw_output.txt
  • pr_description.txt
  • test_compute_free_model_score.py

Comment thread get_pr_status.py Outdated
Comment thread router/config.yaml
Comment thread start-stack.sh
Comment thread start-stack.sh Outdated
Comment thread test_agy_tiers.py
Comment thread test_agy_tiers.py Outdated
Comment thread test_classifier_accuracy.py Outdated
… get_pr_status.py

Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
@sheepdestroyer

Copy link
Copy Markdown
Owner Author

@jules
There are unaddressed Reviews & Comments on this PR#101
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate.

Resolve conflicts before continuing :
get_pr_status.py
start-stack.sh

@google-labs-jules

Copy link
Copy Markdown
Contributor

@jules
There are unaddressed Reviews & Comments on this PR#101
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate.

Resolve conflicts before continuing :
get_pr_status.py
start-stack.sh

I have successfully merged master to resolve conflicts in start-stack.sh and get_pr_status.py, and addressed the remaining CodeRabbit feedback on test robustness and linting.

…-strings

Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@litellm/tests/test_entrypoint.py`:
- Around line 21-22: The dynamic import in test_entrypoint.py leaves
sys.modules["litellm"] pointing at MagicMock, which can affect later tests.
Update the test around spec.loader.exec_module(entrypoint) to save the original
litellm module state, assign mock_litellm only for the import, and then restore
or remove sys.modules["litellm"] afterward so the test does not leak the fake
module globally.
- Around line 13-23: The import-time PostgreSQL readiness loop in entrypoint is
still making real TCP attempts because only time.sleep is stubbed during
exec_module; update the test setup to also mock the socket used by the wait loop
in litellm/entrypoint.py so no network connection is attempted at import. Locate
the readiness-loop logic in entrypoint and ensure the test patches the socket
creation/connect path alongside the existing os.path.exists, time.sleep, and
exec_module stubs.

In `@pod.yaml`:
- Around line 238-240: The readinessProbe for the Valkey-LF instance currently
checks only tcpSocket on port 6380, which can report ready before AUTH/PING
succeeds. Update the probe to perform an authenticated Redis/Valkey check
instead, using the existing Valkey-LF configuration and secrets so readiness
only passes when the passworded queue is actually usable. Keep the change
localized to the readinessProbe block in the pod spec and preserve the current
port while switching to an auth-aware health check.

In `@README.md`:
- Line 83: The ClickHouse readiness description in README.md is inaccurate
because it says “Same” as liveness, but the readiness probe uses a different
command in pod.yaml. Update the table entry for clickhouse-db so it matches the
actual readiness check by referencing the clickhouse-client invocation used by
the readinessProbe, and keep the wording consistent with the probe definitions
to avoid implying the same user/password flags are used.

In `@router/main.py`:
- Around line 3332-3368: The AnnotationItem model currently allows arbitrary
extra fields via extra="allow", which lets oversized annotation payloads bypass
the existing note and count checks before persistence. Update AnnotationItem
and/or AnnotationPayload validation to either reject unknown fields or enforce
bounds on extra keys and the serialized size of each item, using the
AnnotationItem and validate_payload validators as the main enforcement points.
Make sure the new checks cap both per-annotation field lengths and overall item
payload size before annotations.json is written.
- Line 19: router/main.py already relies on Pydantic v2-only symbols like
ConfigDict, field_validator, model_validator, and RootModel, so pin the runtime
dependency set to Pydantic v2 to avoid breaking startup when dependencies
resolve differently. Update the dependency declaration used by router/Dockerfile
so FastAPI installation brings in a compatible Pydantic v2 version, and make
sure any lockfile or requirement used by the app explicitly constrains Pydantic
to v2 rather than leaving the major version unconstrained.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 285183ea-c2db-4536-ba8b-bf74890c7f20

📥 Commits

Reviewing files that changed from the base of the PR and between edb07c6 and d529159.

📒 Files selected for processing (8)
  • .agents/AGENTS.md
  • README.md
  • get_pr_status.py
  • litellm/tests/test_entrypoint.py
  • pod.yaml
  • router/main.py
  • test_agy_tiers.py
  • test_classifier_accuracy.py
✅ Files skipped from review due to trivial changes (1)
  • .agents/AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • test_classifier_accuracy.py
  • test_agy_tiers.py

Comment thread litellm/tests/test_entrypoint.py Outdated
Comment thread litellm/tests/test_entrypoint.py Outdated
Comment thread pod.yaml Outdated
Comment thread README.md Outdated
Comment thread router/main.py
Comment thread router/main.py
@sheepdestroyer

Copy link
Copy Markdown
Owner Author

@jules

  • There are unaddressed Reviews & Comments on this PR#
    Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate.

  • This branch has conflicts that must be resolved. Merge master changes & Resolve conflicts before continuing.

google-labs-jules Bot and others added 2 commits June 30, 2026 17:07
Co-authored-by: sheepdestroyer <1377479+sheepdestroyer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant