Skip to content

Add optional CodeGraph structural context tool #210

Description

@GenjiCy

Problem

OpenCodeReview currently has text-oriented context tools such as code_search, file_read, and file_read_diff. These work well for literal lookup, but they do not expose structural relationships such as symbol definitions, callers, callees, or impact radius.

That makes it harder for the review agent to reason about changes like:

  • public function or method signature changes
  • interface / type / data model changes
  • shared utility behavior changes
  • route handler, auth, security, concurrency, or lifecycle logic changes
  • cross-file impact where the risk depends on callers or callees

Proposal

Add an optional CodeGraph-backed context tool that is only exposed when CodeGraph is actually available for the checked-out repository.

Important constraints:

  • The tool must be hidden when .codegraph/codegraph.db is missing.
  • The tool must be hidden when the codegraph executable is not installed in the CI/job environment.
  • The tool must be hidden for incompatible CodeGraph versions.
  • In range/commit review modes, the CodeGraph index must correspond to the same checkout as --to / --commit; otherwise structural context may describe a different revision than the diff being reviewed.

CI/CD note

The current GitHub Actions and GitLab CI examples install OpenCodeReview, but they do not install CodeGraph or build a .codegraph index. In those default CI/CD setups, the CodeGraph tool should therefore remain unavailable and should not affect existing review behavior.

Teams that want this in CI can opt in by using a runner image that includes CodeGraph and by building/syncing the index after checkout, before running ocr review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions