Skip to content

Agentic approach#5

Open
vineeshah wants to merge 5 commits into
devfrom
agentic-approach
Open

Agentic approach#5
vineeshah wants to merge 5 commits into
devfrom
agentic-approach

Conversation

@vineeshah
Copy link
Copy Markdown
Contributor

  • Replaces the OpenAI diff-only review with a full agentic approach running inside an isolated E2B microVM
  • Agent clones the PR's repo (shallow, branch-only), explores the codebase using a bash tool (grep, git, cat, linters, etc.), and posts up to 3 inline or overall comments(can work around the prompt and quality of comments)
  • Uses claude-haiku-4-5 as its main model(can experiment and change later).

@vineeshah vineeshah closed this Apr 8, 2026
@vineeshah vineeshah reopened this Apr 8, 2026
Comment thread agent.py Outdated
@sce-pr-review-bot
Copy link
Copy Markdown

[CRITICAL] review.py (line 244): Invalid OpenAI model name 'gpt-4.1-mini'. This model does not exist. Use 'gpt-4o-mini' or 'gpt-4-turbo' instead. This will cause API errors during the consolidation pass.

Comment thread server.py
@sce-pr-review-bot
Copy link
Copy Markdown

[CRITICAL] review.py (line 244): Invalid model name 'gpt-4.1-mini' used in OpenAI API call. This model does not exist. Should be 'gpt-4-turbo' or 'gpt-4o-mini'. This will cause runtime failures when the code attempts to call the OpenAI API. Same issue appears on line 319.

Comment thread server.py
print(f"[E2B] Starting review for PR #{pr_number} in {repo}")

# Acquire semaphore to limit concurrent sandboxes
acquired = False
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[HIGH] Semaphore resource leak: acquired is initialized to False but only released if it remains False. If acquire() returns True or raises an exception, the semaphore may never be released due to the early return statements on lines 42 and 46. The semaphore should only be released if acquire() succeeded.

Comment thread agent.py
safe_env = {
"PATH": os.environ.get("PATH", "/usr/bin:/bin:/usr/local/bin"),
"HOME": os.environ.get("HOME", "/root"),
"LANG": os.environ.get("LANG", "en_US.UTF-8"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[HIGH] Security concern: Passing GITHUB_TOKEN via environment variable to subprocess with shell=True (line 18) in run_bash() is a vulnerability vector. Although safe_env is used to strip most env vars, the function signature doesn't prevent callers from modifying env. Additionally, running arbitrary git/bash commands with token access could enable exfiltration despite the stated intent to prevent prompt injection.

@vineeshah vineeshah closed this Apr 9, 2026
@vineeshah vineeshah reopened this Apr 9, 2026
@vineeshah vineeshah closed this Apr 9, 2026
@vineeshah vineeshah reopened this Apr 9, 2026
@vineeshah vineeshah closed this Apr 9, 2026
@vineeshah vineeshah reopened this Apr 9, 2026
@vineeshah vineeshah closed this Apr 9, 2026
@vineeshah vineeshah reopened this Apr 9, 2026
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