[PR #31] [CLOSED] Fix: LLM analysis orchestrator ignores max findings option #42

Closed
opened 2026-03-02 04:08:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/gadievron/raptor/pull/31
Author: @sapran
Created: 12/9/2025
Status: Closed

Base: mainHead: bugfix/orchestrator-max-findings


📝 Commits (4)

  • 3e26816 Merge branch 'main' of github.com:sapran/raptor
  • b056d00 Merge branch 'main' of github.com:sapran/raptor
  • e7c11b7 Merge branch 'main' of github.com:sapran/raptor
  • 7bdb50e Fix: Orchestrator ignores --max-findings parameter

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 packages/llm_analysis/orchestrator.py (+2 -2)

📄 Description

Problem

The orchestrator was ignoring the --max-findings command-line parameter and always processing only 10 findings, regardless of what value the user specified.

Example:

# User requests 50 findings
$ python orchestrator.py --repo /path --max-findings 50

# But only 10 are processed (default value from agent.py)
Processed: 10 findings

Root Cause

In packages/llm_analysis/orchestrator.py:151, the orchestrator called agent.process_findings() without passing the max_findings parameter:

# ❌ Before: Missing parameter
results = agent.process_findings(sarif_paths)

The Issue:

  • The orchestrator receives max_findings from CLI args (line 361)
  • It logs the value and warns if limiting (lines 143-146)
  • But it never forwards the parameter to the agent
  • The agent uses its default value of 10 instead

Solution

Pass the max_findings parameter to agent.process_findings():

# ✅ After: Parameter passed correctly
results = agent.process_findings(sarif_paths, max_findings)

Impact

Before:

$ python orchestrator.py --repo /path --max-findings 50
# Processes only 10 findings (parameter ignored)

After:

$ python orchestrator.py --repo /path --max-findings 50
# Processes 50 findings (parameter respected)

Benefits:

  • Users can now control analysis scope with --max-findings
  • Default behavior unchanged (still 10)
  • Warning messages now match actual behavior
  • Allows processing large finding sets when needed

Testing

# Test default (10 findings)
python orchestrator.py --repo /path
# Expected: Processes 10 findings ✓

# Test custom limit (50 findings)
python orchestrator.py --repo /path --max-findings 50
# Expected: Processes 50 findings ✓

# Test with fewer findings than limit
python orchestrator.py --repo /path --max-findings 100
# If only 20 findings exist, processes 20 ✓

Files Changed

  • packages/llm_analysis/orchestrator.py - 1 file, +2 insertions, -2 deletions

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/gadievron/raptor/pull/31 **Author:** [@sapran](https://github.com/sapran) **Created:** 12/9/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `bugfix/orchestrator-max-findings` --- ### 📝 Commits (4) - [`3e26816`](https://github.com/gadievron/raptor/commit/3e26816073c4e61c59d8a720713e6cba8c09ea84) Merge branch 'main' of github.com:sapran/raptor - [`b056d00`](https://github.com/gadievron/raptor/commit/b056d00ce85566ce9bb42f5a2bc55c99a506c829) Merge branch 'main' of github.com:sapran/raptor - [`e7c11b7`](https://github.com/gadievron/raptor/commit/e7c11b7326972b527e10db66395d1f60f3d2ced6) Merge branch 'main' of github.com:sapran/raptor - [`7bdb50e`](https://github.com/gadievron/raptor/commit/7bdb50e1a63361ba9a2edf4831e88c0a46a9d610) Fix: Orchestrator ignores --max-findings parameter ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/llm_analysis/orchestrator.py` (+2 -2) </details> ### 📄 Description ## Problem The orchestrator was ignoring the `--max-findings` command-line parameter and always processing only 10 findings, regardless of what value the user specified. **Example:** ```bash # User requests 50 findings $ python orchestrator.py --repo /path --max-findings 50 # But only 10 are processed (default value from agent.py) Processed: 10 findings ``` ## Root Cause In `packages/llm_analysis/orchestrator.py:151`, the orchestrator called `agent.process_findings()` without passing the `max_findings` parameter: ```python # ❌ Before: Missing parameter results = agent.process_findings(sarif_paths) ``` **The Issue:** - The orchestrator receives `max_findings` from CLI args (line 361) - It logs the value and warns if limiting (lines 143-146) - But it **never forwards** the parameter to the agent - The agent uses its default value of `10` instead ## Solution Pass the `max_findings` parameter to `agent.process_findings()`: ```python # ✅ After: Parameter passed correctly results = agent.process_findings(sarif_paths, max_findings) ``` ## Impact **Before:** ```bash $ python orchestrator.py --repo /path --max-findings 50 # Processes only 10 findings (parameter ignored) ``` **After:** ```bash $ python orchestrator.py --repo /path --max-findings 50 # Processes 50 findings (parameter respected) ``` **Benefits:** - ✅ Users can now control analysis scope with `--max-findings` - ✅ Default behavior unchanged (still 10) - ✅ Warning messages now match actual behavior - ✅ Allows processing large finding sets when needed ## Testing ```bash # Test default (10 findings) python orchestrator.py --repo /path # Expected: Processes 10 findings ✓ # Test custom limit (50 findings) python orchestrator.py --repo /path --max-findings 50 # Expected: Processes 50 findings ✓ # Test with fewer findings than limit python orchestrator.py --repo /path --max-findings 100 # If only 20 findings exist, processes 20 ✓ ``` ## Files Changed - `packages/llm_analysis/orchestrator.py` - 1 file, +2 insertions, -2 deletions --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:08:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/raptor#42
No description provided.