Skip to content

feat(eclipse): add known_human checkpoint plugin#1050

Open
svarlamov wants to merge 10 commits intomainfrom
feat/known-human-eclipse
Open

feat(eclipse): add known_human checkpoint plugin#1050
svarlamov wants to merge 10 commits intomainfrom
feat/known-human-eclipse

Conversation

@svarlamov
Copy link
Copy Markdown
Member

@svarlamov svarlamov commented Apr 11, 2026

Summary

  • New Java OSGi Eclipse plugin (agent-support/eclipse/) that fires git-ai checkpoint known_human --hook-input stdin on file save with 500ms debounce per git repo root
  • Uses IResourceChangeListener (POST_CHANGE events) — the standard Eclipse API for file-save tracking
  • No external dependencies — JSON is built with a small inline helper
  • New EclipseInstaller Rust struct that detects Eclipse and surfaces manual install instructions

Manual install steps (for docs site)

  1. Open Eclipse
  2. Go to Help → Install New Software
  3. Click Add… and enter the update site URL: https://github.com/git-ai-project/git-ai/releases (update site TBD — add actual URL when published)
  4. Select git-ai Eclipse Plugin and click Install
  5. Restart Eclipse when prompted

Or build from source:

cd agent-support/eclipse
mvn package
# Install the resulting .jar into Eclipse's dropins/ folder

Test plan

  • cargo clippy -- -D warnings passes
  • cargo test passes

🤖 Generated with Claude Code


Open with Devin

Adds a Java OSGi Eclipse plugin that fires git-ai checkpoint known_human
on file save with 500ms debounce per git repo root.
Auto-install is not supported; the installer surfaces manual steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

View 4 additional findings in Devin Review.

Open in Devin Review

try (OutputStream stdin = proc.getOutputStream()) {
stdin.write(json.getBytes(StandardCharsets.UTF_8));
}
proc.waitFor(10, TimeUnit.SECONDS);
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot Apr 11, 2026

Choose a reason for hiding this comment

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

🔴 Process leaked when waitFor times out or stdout pipe buffer fills

In fireCheckpoint, when proc.waitFor(10, TimeUnit.SECONDS) returns false (timeout), the spawned git-ai process is never destroyed and leaks. Additionally, redirectErrorStream(true) merges stderr into stdout, but nobody reads proc.getInputStream(). If the checkpoint command produces enough output to fill the OS pipe buffer (~64KB), the process will block on its stdout write, making the timeout inevitable. The combination of not consuming stdout and not destroying the process on timeout creates a resource leak that accumulates in a long-running Eclipse session. Compare with the VS Code extension at agent-support/vscode/src/known-human-checkpoint-manager.ts:127-131 which properly reads both stdout and stderr.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 8 additional findings in Devin Review.

Open in Devin Review

for (Map.Entry<String, Object> e : map.entrySet()) {
if (!first) sb.append(",");
first = false;
sb.append("\"").append(e.getKey()).append("\":");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 JSON map keys (file paths) are not escaped, producing invalid JSON on Windows

The toJson method at line 143 appends map keys directly without escaping: sb.append("\"")``.append(e.getKey()).append("\":"). The dirty_files map uses OS file paths as keys (from file.getLocation().toOSString() at line 61). On Windows, these paths contain backslashes (e.g., C:\Users\foo\bar.java), which produces invalid JSON like "C:\Users\foo\bar.java" where \U, \f, \b are interpreted as invalid or wrong JSON escape sequences. String values are properly escaped in appendValue (lines 153-156), but the same escaping is missing for keys. This causes the Rust-side JSON parser to reject the payload, silently failing every checkpoint on Windows.

Suggested change
sb.append("\"").append(e.getKey()).append("\":");
sb.append("\"")
.append(e.getKey()
.replace("\\", "\\\\")
.replace("\"", "\\\"")
.replace("\n", "\\n")
.replace("\r", "\\r")
.replace("\t", "\\t"))
.append("\":");
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant