Skip to content

Conversation

@Nash0x7E2
Copy link
Member

@Nash0x7E2 Nash0x7E2 commented Dec 9, 2025

Note

Adds a scheduled GitHub Actions workflow that scans Python dependencies and opens separate PRs for patch/minor and major updates using Cursor Agent.

  • CI/Automation
    • New workflow: Adds .github/workflows/check_dependencies.yml.
      • Triggers: nightly cron and manual dispatch.
      • Sets up Python 3.12, uv, and Cursor CLI; configures git and required permissions.
      • Uses Cursor Agent to:
        • Discover pyproject.toml files and query PyPI for latest versions.
        • Create PRs for patch/minor updates and separate PRs for major updates, with standardized titles, labels, and summaries.

Written by Cursor Bugbot for commit 248e605. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Chores
    • Introduced automated dependency scanning that creates pull requests for outdated packages. Updates are categorized into patch/minor releases and major releases, with major updates flagged for manual review.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

A new GitHub Actions workflow is added that automatically scans dependencies in pyproject.toml files, categorizes updates into patch/minor and major versions, and creates separate pull requests for each category with appropriate labels and documentation.

Changes

Cohort / File(s) Summary
Dependency Check Workflow
.github/workflows/check_dependencies.yml
New workflow that runs daily and on manual dispatch to detect outdated dependencies, segregate updates by severity (patch/minor vs major), and automatically create categorized PRs with summaries and labels

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify YAML syntax and workflow trigger conditions (schedule and manual dispatch)
  • Review the dependency scanning logic and categorization strategy (patch/minor vs major)
  • Validate git operations and branch naming conventions (deps/patch-minor-YYYYMMDD, deps/major-YYYYMMDD)
  • Check PR creation logic and label assignment for both update categories
  • Ensure pyproject.toml formatting preservation during updates

Poem

Bell-jar sealed with dependencies bright,
Cursor's algorithm cuts through the night—
Patch and minor dance in one PR,
Major breaks alone, a warning star. 🌙
Automation's hollow bell rings clean.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: introducing an automated workflow for dependency updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/bot

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 and usage tips.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

- Number of major updates (and PR link if created)
- Any packages that were skipped and why

If no updates needed, print 'All dependencies are up to date'." --model gpt-4o
Copy link

Choose a reason for hiding this comment

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

Bug: Missing lockfile update after dependency version changes

The workflow prompts cursor-agent to update pyproject.toml files with new dependency versions but never instructs it to run uv lock to update the uv.lock lockfile. This project uses uv with UV_FROZEN: "1" in tests and --frozen flags, requiring the lockfile to be in sync with pyproject.toml. PRs created by this workflow will have mismatched pyproject.toml and uv.lock files, causing CI test failures when the lockfile check runs against the updated dependencies.

Fix in Cursor Fix in Web

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
.github/workflows/check_dependencies.yml (2)

11-14: Review and minimize permission scope.

The workflow requests write access to contents, pull-requests, and issues. While necessary for PR creation, ensure these are the minimum required. Consider whether issues: write is actually needed if the workflow only creates PRs and doesn't post comments on issues.

If issues: write is not needed:

     permissions:
       contents: write
       pull-requests: write
-      issues: write

1-95: Add documentation about required setup and expected behavior.

The workflow file lacks inline documentation explaining:

  • What secrets must be configured before running
  • Expected behavior (e.g., "creates up to 2 PRs per run")
  • How to troubleshoot failures
  • Known limitations or gotchas

Add a comment at the top of the file or in the repository README:

# This workflow automatically updates Python dependencies.
# 
# Required secrets:
# - CURSOR_API_KEY: API key for Cursor agent
# - VISION_AGENTS_GITHUB_TOKEN: GitHub token with write access to contents and pull-requests
#
# Behavior:
# - Runs daily at 02:00 UTC
# - Checks all pyproject.toml files for outdated dependencies
# - Creates separate PRs for patch/minor and major updates
# - Skips workspace packages (e.g., vision-agents-*)
#
# Known limitations:
# - Relies on AI agent interpretation; output should be manually reviewed
# - May create multiple PRs in a single run
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 210b64d and 248e605.

📒 Files selected for processing (1)
  • .github/workflows/check_dependencies.yml (1 hunks)
⏰ 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). (7)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Ruff
  • GitHub Check: unit / Mypy
  • GitHub Check: unit / Test "not integration"
  • GitHub Check: unit / Ruff
  • GitHub Check: unit / Mypy
🔇 Additional comments (2)
.github/workflows/check_dependencies.yml (2)

43-44: Verify required secrets exist and are configured correctly.

The workflow references two secrets: CURSOR_API_KEY (for the Cursor agent CLI) and VISION_AGENTS_GITHUB_TOKEN (for git authentication and API access). If these are not configured, the workflow will fail when the cursor-agent tool attempts to run.

Confirm both secrets are registered:

  • GitHub UI: Settings → Secrets and variables → Actions
  • Or use: gh secret list --repo GetStream/Vision-Agents

Verify that VISION_AGENTS_GITHUB_TOKEN has write permissions for contents, pull-requests, and issues (matching the job's declared permissions at line 11-14).


34-35: The review comment is incorrect. Lines 34 and 45 are in separate GitHub Actions steps, not the same step. Line 34 appends to $GITHUB_PATH in the "Install Cursor CLI" step, while cursor-agent is invoked in the subsequent "Check and update dependencies with Cursor Agent" step. GitHub Actions automatically makes $GITHUB_PATH updates available to all subsequent steps in the job, so the cursor binary will be in the PATH when cursor-agent is invoked. The proposed diff is unnecessary.

Likely an incorrect or invalid review comment.

Comment on lines +4 to +6
schedule:
- cron: '0 2 * * *'
workflow_dispatch: {}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Adjust schedule frequency and add human safeguards.

The workflow runs daily at 02:00 UTC. Depending on the repository size and number of dependencies, this could generate many PRs. Without safeguards (e.g., draft PRs, auto-merge restrictions, max PR limits), the workflow could overwhelm reviewers.

Consider:

  1. Increasing frequency to weekly or less often
  2. Restricting PR creation to draft status initially
  3. Adding a step to check if recent PRs already exist before creating new ones
   schedule:
-    - cron: '0 2 * * *'
+    - cron: '0 2 * * 0'  # Weekly instead of daily
🤖 Prompt for AI Agents
In .github/workflows/check_dependencies.yml around lines 4-6, the schedule runs
daily and lacks safeguards; change the cron to a weekly cadence (e.g., once a
week), modify the PR-creation step to open dependency PRs as draft by default,
and add a pre-check step that queries the GitHub API for existing open
dependency update PRs (or PRs created in the last N days) and exits early if
such PRs exist to enforce a max-one-open policy; also ensure any automatic merge
action is disabled or gated behind a label/review check.


- name: Install Cursor CLI
run: |
curl https://cursor.com/install -fsS | bash
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

⚠️ Replace unsafe script execution with secure installation method.

Piping curl output directly to bash is a security anti-pattern and vulnerable to MITM attacks. Additionally, there's no verification that the installation succeeded before proceeding.

Replace this with a secure installation method:

-          curl https://cursor.com/install -fsS | bash
-          echo "$HOME/.cursor/bin" >> $GITHUB_PATH
+          # Use a package manager or verify checksum instead of piping to bash
+          # For example, if available via package managers:
+          # sudo apt-get install cursor
+          # Or manually verify the binary before execution
+          curl -fsSL https://cursor.com/install -o /tmp/cursor-install.sh
+          # TODO: Add checksum verification here before executing
+          bash /tmp/cursor-install.sh
+          echo "$HOME/.cursor/bin" >> $GITHUB_PATH

Alternatively, check if Cursor provides a published package in standard package managers or a tarball with published checksums.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
.github/workflows/check_dependencies.yml around line 33: the workflow uses an
unsafe pattern "curl ... | bash" to install Cursor; replace it with a secure
installation sequence that either (1) uses an official package from a system
package manager or the project's published installer package, or (2) downloads a
release tarball/installer to a temporary file, fetches and verifies its checksum
or GPG signature against the project's published value, then executes the
installer from disk; after installation, explicitly verify the installed
binary/version and fail the job if verification or installation fails so the
workflow does not continue on an untrusted or incomplete install.

Comment on lines +42 to +95
env:
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
GH_TOKEN: ${{ secrets.VISION_AGENTS_GITHUB_TOKEN }}
run: |
cursor-agent -p "You are a dependency update bot. Your task is to check for outdated Python dependencies and create PRs to update them.

## Step 1: Discover pyproject.toml files
Find all pyproject.toml files in this repository, excluding .venv directories.

## Step 2: Check for outdated dependencies
For each pyproject.toml, extract dependencies from:
- [project].dependencies
- [project].optional-dependencies
- [dependency-groups]

Skip packages that are workspace packages (listed in [tool.uv.sources] with workspace = true or path references like vision-agents-*, etc.).

For each external package, query PyPI (https://pypi.org/pypi/{package}/json) to get the latest version.

Categorize updates into:
- PATCH/MINOR: e.g., 1.2.0 -> 1.2.5 or 1.2.0 -> 1.3.0
- MAJOR: e.g., 1.2.0 -> 2.0.0

## Step 3: Create PR for patch/minor updates
If there are patch/minor updates:
1. Create branch: deps/patch-minor-YYYYMMDD
2. Update pyproject.toml files with patch/minor version bumps only
3. Preserve exact formatting, extras, and markers
4. Respect override-dependencies in root pyproject.toml
5. Commit with message: 'chore: update dependencies (patch/minor)'
6. Push and create PR with:
- Title: 'chore: update dependencies (patch/minor)'
- Body: Table of updated packages with old -> new versions
- Labels: dependencies, automated

## Step 4: Create separate PR for major updates
If there are major updates:
1. Reset to main branch
2. Create branch: deps/major-YYYYMMDD
3. Update pyproject.toml files with major version bumps only
4. Preserve exact formatting, extras, and markers
5. Commit with message: 'chore: update dependencies (major) - BREAKING'
6. Push and create PR with:
- Title: 'chore: update dependencies (major) ⚠️ BREAKING'
- Body: Table of updated packages with old -> new versions, note that these are major updates requiring manual review
- Labels: dependencies, automated, breaking

## Step 5: Summary
Print a summary of what was done:
- Number of patch/minor updates (and PR link if created)
- Number of major updates (and PR link if created)
- Any packages that were skipped and why

If no updates needed, print 'All dependencies are up to date'." --model gpt-4o
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

⚠️ Reliance on AI agent for critical PR automation is unreliable and risky.

The workflow offloads all dependency checking, version categorization, and PR creation logic to a natural language prompt sent to cursor-agent. This approach has several systemic risks:

  1. Unverifiable logic: The AI agent's interpretation of the prompt cannot be audited before execution. If it misinterprets instructions (e.g., incorrectly categorizes versions, skips packages, or modifies unrelated dependencies), the damage is already done post-merge.
  2. No error recovery: There's no validation that PRs were created correctly, commits match expectations, or files were modified as intended.
  3. Dependency on external service: If Cursor's API is down, rate-limited, or changes behavior, the workflow silently fails or produces unexpected results.
  4. PR spam risk: Without explicit safeguards, the workflow could create many PRs in a single run, overwhelming the review queue.
  5. Timeout hazard: No timeout is specified; a hanging cursor-agent command could consume runner resources indefinitely.

Recommendation: Replace this with a deterministic, auditable approach using established dependency update tools:

-      - name: Check and update dependencies with Cursor Agent
+      - name: Check and update dependencies
         env:
-          CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
           GH_TOKEN: ${{ secrets.VISION_AGENTS_GITHUB_TOKEN }}
-        run: |
-          cursor-agent -p "..." --model gpt-4o
+        uses: dependabot/fetch-metadata@v2
+        # OR use Renovate for more advanced categorization
+        # OR implement a custom Python script with explicit error handling

If cursor-agent is required, at minimum add:

  • Explicit timeout (e.g., timeout 600)
  • Exit code validation
  • Output validation (check created PRs exist)
  • Rate limiting (skip if PRs already exist from recent runs)

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
.github/workflows/check_dependencies.yml lines 42-95: the workflow currently
delegates all dependency discovery, version categorization, and PR creation to
cursor-agent via a long natural-language prompt (unreliable and unauditable);
replace this with a deterministic dependency-updater (e.g., dependabot,
poetry-lock-update, pip-upgrade-action or a custom script) that explicitly finds
pyproject.toml files, queries PyPI, classifies semver changes, and creates PRs,
or — if cursor-agent must remain — wrap the call with strict safeguards: enforce
a hard timeout (e.g., timeout 600s), check the cursor-agent exit code and fail
the job on nonzero, validate output by confirming created PRs via the GitHub API
before pushing commits/labels, rate-limit and skip if recent automated PRs
already exist, and add explicit logging and retry/error-handling to ensure
auditable, recoverable behavior.

@dangusev
Copy link
Contributor

@Nash0x7E2
Copy link
Member Author

Do you think it's a better option, @dangusev? If so then let's go with that

@dangusev
Copy link
Contributor

@Nash0x7E2, if we want to get notified about the new deps release, Dependabot works quite well.
It scans requirements files on schedule and automatically generates PRs with updates.

@Nash0x7E2
Copy link
Member Author

Nash0x7E2 commented Dec 10, 2025 via email

@dangusev dangusev closed this Dec 10, 2025
@Nash0x7E2 Nash0x7E2 deleted the chore/bot branch December 12, 2025 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants