Skip to main content

openhands.resolver.issue_definitions

IssueHandlerInterface Objects

class IssueHandlerInterface(ABC)

get_converted_issues

@abstractmethod
def get_converted_issues(issue_numbers: list[int] | None = None,
comment_id: int | None = None) -> list[GithubIssue]

Download issues from GitHub.

get_instruction

@abstractmethod
def get_instruction(
issue: GithubIssue,
prompt_template: str,
repo_instruction: str | None = None) -> tuple[str, list[str]]

Generate instruction and image urls for the agent.

guess_success

@abstractmethod
def guess_success(issue: GithubIssue,
history: list[Event]) -> tuple[bool, list[bool] | None, str]

Guess if the issue has been resolved based on the agent's output.

IssueHandler Objects

class IssueHandler(IssueHandlerInterface)

get_converted_issues

def get_converted_issues(issue_numbers: list[int] | None = None,
comment_id: int | None = None) -> list[GithubIssue]

Download issues from Github.

Arguments:

  • issue_numbers - The numbers of the issues to download
  • comment_id - The ID of a single comment, if provided, otherwise all comments

Returns:

List of Github issues.

get_instruction

def get_instruction(
issue: GithubIssue,
prompt_template: str,
repo_instruction: str | None = None) -> tuple[str, list[str]]

Generate instruction for the agent.

Arguments:

  • issue - The issue to generate instruction for
  • prompt_template - The prompt template to use
  • repo_instruction - The repository instruction if it exists

guess_success

def guess_success(issue: GithubIssue,
history: list[Event]) -> tuple[bool, None | list[bool], str]

Guess if the issue is fixed based on the history and the issue description.

Arguments:

  • issue - The issue to check
  • history - The agent's history

PRHandler Objects

class PRHandler(IssueHandler)

get_instruction

def get_instruction(
issue: GithubIssue,
prompt_template: str,
repo_instruction: str | None = None) -> tuple[str, list[str]]

Generate instruction for the agent.

guess_success

def guess_success(issue: GithubIssue,
history: list[Event]) -> tuple[bool, None | list[bool], str]

Guess if the issue is fixed based on the history and the issue description.