Skip to content
DashboardWebsite

Code Suggestions

Just want to do it in the dashboard? See the guide: Choose which findings get a code suggestion.

A finding tells the author what to do in its suggested next step. When code suggestions are enabled, OpenTremor can also post a replacement for lines the pull request added. The author reviews and applies each suggestion in the code host (Commit suggestion on GitHub, Apply suggestion on GitLab). OpenTremor never commits, pushes or opens a branch.

  1. For the organization. In the dashboard: Organization → Connections → Code Suggestions. Switch on Post code suggestions. Choose the minimum finding severity (High and above by default) and the limit per push (10 by default, up to 50).

  2. For a repository, if needed. In the dashboard, open the repository’s settings and find Code suggestions. Choose Always post or Never post to override the organization setting. Choose Organization setting to follow it again.

You can also manage organization settings with GET and PUT /v1/orgs/{org_id}/code-suggestions. The repository’s code_suggestions field controls its override. Terraform supports these settings in opentremor_organization_settings and opentremor_repository.

After a review publishes its report and commit status, OpenTremor considers open findings at or above the chosen severity, most severe first, up to the limit. For each finding, it asks the review’s model for the exact lines to replace and their replacement. A suggestion is posted only if:

  • The quoted lines appear exactly once in the file at the pull request’s head.
  • Every quoted line was added by the pull request.
  • The replacement changes the code.
  • The replacement passes the same agent-injection scan as the pull request’s added lines.

Otherwise, the finding keeps its written next step. A fix that belongs in another file or on unchanged lines stays prose.

Each suggestion starts with OpenTremor suggestion, followed by the rule, severity and finding title, with a link to triage it when available. GitHub gets one review containing the suggestions. GitLab gets one discussion per suggestion.

OpenTremor records a suggestion after it posts successfully, so it does not post it again on a later push. A finding the author fixed closes on the next push, like any other.

A pull request from an author without write access can still get suggestions. Each suggestion includes this warning:

This pull request comes from an author without write access. This suggestion was generated from content they control. Read it line by line before you apply it.

The model reads the pull request’s code before writing a suggestion. Text in the pull request could have steered it. The injection scan drops replacements that contain instructions to automated tools, but read the code before applying it.

  • Each suggestion uses one additional LLM call on the review’s connection and model. It counts against the organization’s monthly budget. OpenTremor stops generating suggestions when the budget is spent.
  • Only findings from OpenTremor’s server-run analysis get suggestions. Findings submitted by your own agent through the client-led loop do not.
  • Suggestions do not change the commit status. The check reflects the findings, not the suggestions.
  • A model or host error is logged, and the review stays done. If posting fails, OpenTremor can try again on the next push.