Skip to content

Update inline MCP #81

Merged
nikitaBarkov merged 6 commits into
mainfrom
nikita.barkov/inline
Feb 17, 2026
Merged

Update inline MCP #81
nikitaBarkov merged 6 commits into
mainfrom
nikita.barkov/inline

Conversation

@nikitaBarkov

Copy link
Copy Markdown
Collaborator

No description provided.

- Added functionality to locate code lines automatically based on `code_block`.
- Introduced support for GitHub suggestion blocks with optional `code_suggestion`.
- Refined parameter validation for `code_block` and `code_suggestion`.
- Enhanced inline comment creation to dynamically determine line ranges.
- Streamlined initialization by reusing Octokit instance across methods.
@junie-github-actions

junie-github-actions Bot commented Feb 17, 2026

Copy link
Copy Markdown

Junie successfully finished!

Result: Review PR Diff and Update Documentation Accuracy

Summary

  • Reviewed PR diff for branch nikita.barkov/inline against current README.md documentation
  • All changes in the PR are internal implementation details that do not require documentation updates

Changes

  • No changes made to README.md - documentation is accurate and up-to-date

Verification

  • Confirmed all action.yml inputs/outputs are correctly documented in README.md
  • Verified PR changes: action.yml adds internal debug flag, src/mcp files refactor inline comment implementation
  • Validated that inline code review feature is properly documented with correct descriptions
  • All code examples and configuration examples remain accurate

Notes

  • PR changes are internal only: JUNIE_DEBUG_REASONING_SUMMARY env var, inline comment server refactoring, and internal prompt adjustments
  • No new user-facing inputs, outputs, or features were added
  • Existing documentation correctly describes inline code review functionality

@nikitaBarkov

Copy link
Copy Markdown
Collaborator Author

junie-agent code-review

@junie-github-actions

junie-github-actions Bot commented Feb 17, 2026

Copy link
Copy Markdown

Junie successfully finished!

Pull Request Diff Code Style Review

  • src/mcp/github-inline-comment-server.ts:158: Current validation blocks empty suggestions; allow empty strings to support suggesting code deletions.
  • src/mcp/github-inline-comment-server.ts:98: Line search returns the first match; provide enough context in code_block to avoid targeting the wrong lines.
  • src/mcp/github-inline-comment-server.ts:260: Update code_block description to emphasize that providing context and indentation is required for unique matching.
  • src/mcp/github-inline-comment-server.ts:267: Missing warning that suggestions replace the entire line range, which can lead to lost indentation or broken code. Commit sha: ef9015e

Comment thread src/mcp/github-inline-comment-server.ts Outdated
};
}
// If code_suggestion is provided, validate it
if (params.code_suggestion !== undefined && !params.code_suggestion.trim()) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if (params.code_suggestion !== undefined && !params.code_suggestion.trim()) {
// If code_suggestion is provided, validate it (allow empty string for deletion)
if (params.code_suggestion !== undefined && params.code_suggestion.length > 0 && !params.code_suggestion.trim()) {

Empty suggestion blocks are valid in GitHub for suggesting deletions. The current check prevents this.

const numLines = searchLines.length;

// Try to find exact match
for (let i = 0; i <= fileLines.length - numLines; i++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The algorithm returns the first match found. In files with repeated code blocks (e.g., closing braces or common utility calls), this may result in comments appearing on the wrong line. Suggestion: encourage providing unique context in code_block.

Comment thread src/mcp/github-inline-comment-server.ts Outdated
.describe("The file path to comment on (e.g., 'src/utils/helper.ts')"),
code_block: z
.string()
.describe("The exact code block to comment on (can be multiple lines). Must match existing code in the file exactly. This is used to find the line numbers."),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
.describe("The exact code block to comment on (can be multiple lines). Must match existing code in the file exactly. This is used to find the line numbers."),
code_block: z
.string()
.describe("The exact code block to comment on. Must match existing code in the file exactly (including indentation). Provide enough context to make it unique within the file."),

Adding a reminder about uniqueness and indentation helps avoid targeting the wrong lines or losing formatting.

Comment thread src/mcp/github-inline-comment-server.ts Outdated
.string()
.optional()
.describe("Side of the diff to comment on: LEFT (old code) or RIGHT (new code). Defaults to RIGHT."),
.describe("Optional: The suggested replacement code (can be multiple lines). If provided, creates a GitHub suggestion block. If omitted, creates a regular comment without suggestion."),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
.describe("Optional: The suggested replacement code (can be multiple lines). If provided, creates a GitHub suggestion block. If omitted, creates a regular comment without suggestion."),
code_suggestion: z
.string()
.optional()
.describe("Optional: The suggested replacement code. IMPORTANT: GitHub suggestions replace the entire line range. You must provide full lines including current indentation."),

Removing the warning about entire line replacement increases the risk of the AI producing broken suggestions (e.g., partial line replacements or lost indentation).

junie-agent and others added 3 commits February 17, 2026 11:03
Pull Request Diff Code Style Review

Co-authored-by: nikitaBarkov <144887964+nikitaBarkov@users.noreply.github.com>
- Adjust `code_suggestion` validation to simplify condition check.
- Simplify multi-line detection logic for comments.
- Update `code_block` and `code_suggestion` descriptions to clarify requirements and ensure proper usage.
@nikitaBarkov nikitaBarkov merged commit f702dcf into main Feb 17, 2026
2 checks passed
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.

2 participants