OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug] [SIMPLE?]: Resolver fails at "Attempt to resolve issue" step due to resolve_issue.py: error: unrecognized arguments: --is-experimental false

Open oconnorjoseph opened this issue 1 month ago • 1 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Describe the bug and reproduction steps

The Resolver fails at the "Attempt to resolve issue" step due to the following error:

Run cd /tmp && python -m openhands.resolver.resolve_issue \
  cd /tmp && python -m openhands.resolver.resolve_issue \
    --repo BluMintInc/eslint-custom-rules \
    --issue-number 130 \
    --issue-type issue \
    --max-iterations [2](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12738962692/job/35501993737#step:10:2)50 \
    --comment-id None \
    --is-experimental false
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/[3](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12738962692/job/35501993737#step:10:3).12.8/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.8/x6[4](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12738962692/job/35501993737#step:10:4)/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.8/x64/lib
    ISSUE_NUMBER: 130
    ISSUE_TYPE: issue
    COMMENT_ID: None
    MAX_ITERATIONS: 2[5](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12738962692/job/35501993737#step:10:5)0
    SANDBOX_ENV_GITHUB_TOKEN: ***
    SANDBOX_ENV_BASE_CONTAINER_IMAGE: 
    TARGET_BRANCH: develop
    GITHUB_TOKEN: ***
    GITHUB_USERNAME: openhands-agent
    LLM_MODEL: anthropic/claude-3-5-sonnet-20241022
    LLM_API_KEY: ***
    LLM_BASE_URL: 
    PYTHONPATH: 
/opt/hostedtoolcache/Python/3.12.8/x[6](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12738962692/job/35501993737#step:10:6)4/lib/python3.12/site-packages/pydantic/_internal/_config.py:345: UserWarning: Valid config keys have changed in V2:
* 'fields' has been removed
  warnings.warn(message, UserWarning)
usage: resolve_issue.py [-h] --repo REPO [--token TOKEN] [--username USERNAME]
                        [--runtime-container-image RUNTIME_CONTAINER_IMAGE]
                        [--max-iterations MAX_ITERATIONS] --issue-number
                        ISSUE_NUMBER [--comment-id COMMENT_ID]
                        [--output-dir OUTPUT_DIR] [--llm-model LLM_MODEL]
                        [--llm-api-key LLM_API_KEY]
                        [--llm-base-url LLM_BASE_URL]
                        [--prompt-file PROMPT_FILE]
                        [--repo-instruction-file REPO_INSTRUCTION_FILE]
                        [--issue-type {issue,pr}]
                        [--target-branch TARGET_BRANCH]
resolve_issue.py: error: unrecognized arguments: --is-experimental false
Error: Process completed with exit code 2.

This appears to be a simple fix. Re-running OpenHands does not help.

OpenHands Installation

Development workflow

OpenHands Version

0.19.0

Operating System

None

Logs, Errors, Screenshots, and Additional Context

Attached below are the full logs: logs_32969936510.zip

And this likely creates the following error in the "Comment on issue" stage as well:

Run actions/github-script@v7
  with:
    github-token: ***
    script: const fs = require('fs');
  const path = require('path');
  const issueNumber = 130;
  const success = ;
  
  let prNumber = '';
  let branchName = '';
  let resultExplanation = '';
  
  try {
    if (success) {
      prNumber = fs.readFileSync('/tmp/pr_number.txt', 'utf8').trim();
    } else {
      branchName = fs.readFileSync('/tmp/branch_name.txt', 'utf8').trim();
    }
  } catch (error) {
    console.error('Error reading file:', error);
  }
  
  
  try {
    if (!success){
      // Read result_explanation from JSON file for failed resolution
      const outputFilePath = path.resolve('/tmp/output/output.jsonl');
      if (fs.existsSync(outputFilePath)) {
        const outputContent = fs.readFileSync(outputFilePath, 'utf8');
        const jsonLines = outputContent.split('\n').filter(line => line.trim() !== '');
  
        if (jsonLines.length > 0) {
          // First entry in JSON lines has the key 'result_explanation'
          const firstEntry = JSON.parse(jsonLines[0]);
          resultExplanation = firstEntry.result_explanation || '';
        }
      }
    }
  } catch (error){
    console.error('Error reading file:', error);
  }
  
  // Check "success" log from resolver output
  if (success && prNumber) {
    github.rest.issues.createComment({
      issue_number: issueNumber,
      owner: context.repo.owner,
      repo: context.repo.repo,
      body: `A potential fix has been generated and a draft PR #${prNumber} has been created. Please review the changes.`
    });
    process.env.AGENT_RESPONDED = 'true';
  } else if (!success && branchName) {
    let commentBody = `An attempt was made to automatically fix this issue, but it was unsuccessful. A branch named '${branchName}' has been created with the attempted changes. You can view the branch [here](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/${branchName}). Manual intervention may be required.`;
  
    if (resultExplanation) {
      commentBody += `\n\nAdditional details about the failure:\n${resultExplanation}`;
    }
  
    github.rest.issues.createComment({
      issue_number: issueNumber,
      owner: context.repo.owner,
      repo: context.repo.repo,
      body: commentBody
    });
    process.env.AGENT_RESPONDED = 'true';
  }
  
    debug: false
    user-agent: actions/github-script
    result-encoding: json
    retries: 0
    retry-exempt-status-codes: 400,401,403,404,4[2](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12748261713/job/35528050245#step:15:2)2
  env:
    pythonLocation: /opt/hostedtoolcache/Python/[3](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12748261713/job/35528050245#step:15:3).12.8/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.8/x6[4](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12748261713/job/35528050245#step:15:4)/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.8/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.8/x64/lib
    ISSUE_NUMBER: 130
    ISSUE_TYPE: issue
    COMMENT_ID: None
    MAX_ITERATIONS: 2[5](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12748261713/job/35528050245#step:15:5)0
    SANDBOX_ENV_GITHUB_TOKEN: ***
    SANDBOX_ENV_BASE_CONTAINER_IMAGE: 
    TARGET_BRANCH: develop
    AGENT_RESPONDED: false
SyntaxError: Unexpected token ';'
    at new AsyncFunction (<anonymous>)
    at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:1[6](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12748261713/job/35528050245#step:15:6))
    at main (/home/runner/work/_actions/actions/github-script/v[7](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12748261713/job/35528050245#step:15:7)/dist/index.js:35522:26)
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35497:1
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:35553:3
    at Object.<anonymous> (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35556:12)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:154[8](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12748261713/job/35528050245#step:15:8):10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1[10](https://github.com/BluMintInc/eslint-custom-rules/actions/runs/12748261713/job/35528050245#step:15:10)4:12)
Error: Unhandled error: SyntaxError: Unexpected token ';'

oconnorjoseph avatar Jan 13 '25 13:01 oconnorjoseph