feat(eclipse): add known_human checkpoint plugin#1050
feat(eclipse): add known_human checkpoint plugin#1050
Conversation
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>
agent-support/eclipse/plugin/src/io/gitai/eclipse/GitAiSaveListener.java
Outdated
Show resolved
Hide resolved
| try (OutputStream stdin = proc.getOutputStream()) { | ||
| stdin.write(json.getBytes(StandardCharsets.UTF_8)); | ||
| } | ||
| proc.waitFor(10, TimeUnit.SECONDS); |
There was a problem hiding this comment.
🔴 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
agent-support/eclipse/plugin/src/io/gitai/eclipse/GitAiSaveListener.java
Show resolved
Hide resolved
…cleanup, non-blocking IO, and JSON escaping Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| for (Map.Entry<String, Object> e : map.entrySet()) { | ||
| if (!first) sb.append(","); | ||
| first = false; | ||
| sb.append("\"").append(e.getKey()).append("\":"); |
There was a problem hiding this comment.
🔴 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.
| sb.append("\"").append(e.getKey()).append("\":"); | |
| sb.append("\"") | |
| .append(e.getKey() | |
| .replace("\\", "\\\\") | |
| .replace("\"", "\\\"") | |
| .replace("\n", "\\n") | |
| .replace("\r", "\\r") | |
| .replace("\t", "\\t")) | |
| .append("\":"); |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
agent-support/eclipse/) that firesgit-ai checkpoint known_human --hook-input stdinon file save with 500ms debounce per git repo rootIResourceChangeListener(POST_CHANGEevents) — the standard Eclipse API for file-save trackingEclipseInstallerRust struct that detects Eclipse and surfaces manual install instructionsManual install steps (for docs site)
https://github.com/git-ai-project/git-ai/releases(update site TBD — add actual URL when published)Or build from source:
Test plan
cargo clippy -- -D warningspassescargo testpasses🤖 Generated with Claude Code