Conversation
- Add AmpcodeAgentPlugin with full CLI integration - Support for execute mode (-x), agent modes (free/rush/smart) - --dangerously-allow-all for autonomous operation - Stream JSON output for structured responses - Register in built-in agent plugins Closes subsy#105
|
@carmandale is attempting to deploy a commit to the plgeek Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughAdds a new Ampcode agent plugin implementing CLI detection, streaming JSONL parsing and runtime/setup/validation hooks; registers and re-exports the plugin. Also adds related docs, daemon guidance, error catalogue, repo metadata and session handoff logs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User as User (CLI)
participant Agent as AmpcodeAgentPlugin
participant CLI as amp binary
participant Parser as Jsonl Parser
rect rgba(200,230,255,0.5)
User->>Agent: invoke agent (interactive / non-interactive)
Agent->>Agent: detect `amp` (which + --version w/ timeout)
end
rect rgba(220,255,200,0.5)
Agent->>CLI: spawn `amp` with built args (mode, flags, streaming)
CLI-->>Agent: stdout (streaming JSONL / text)
Agent->>Parser: push streaming chunks/lines
Parser-->>Agent: parsed `AmpcodeJsonlMessage` events
Agent->>User: stream parsed messages / final output
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/plugins/agents/builtin/ampcode.ts`:
- Around line 61-109: The plugin currently defaults dangerouslyAllowAll to true,
which is insecure; change the default value of the AmpcodeAgentPlugin instance
property dangerouslyAllowAll from true to false, and ensure the
initialize(config) logic still respects an explicit boolean
config.dangerouslyAllowAll to set it when provided; also update any other
occurrences of the same default (the second definition referenced around lines
198-231) to false so the opt-in behavior is consistent across the file.
- Around line 147-195: The runVersion function currently uses spawn(..., {
shell: true }) and a non-cleared setTimeout which risks shell injection/quoting
issues and event-loop leaks; replace spawn with child_process.execFile to run
the command directly without a shell (call execFile(command, ['--version'],
...)) and capture stdout/stderr from the callback, and store the timeout in a
variable so you can clearTimeout(timer) in both the error and close/finish paths
(or before resolving in the execFile callback) to ensure the timer is cleared
and the process resources are released; update any references to proc event
handlers to use the execFile callback error/stdout/stderr handling and resolve
with the same { success, version?, error? } shape.
|
Thanks for this @carmandale Im in the process of refactoring some of the code to improve the prompt templates, package them with tracker plugins and restructure the agent plugin paths. We also now have true built in sandboxing |
Addresses CodeRabbit security feedback: - Changed class property default from true to false - Updated setup question default to false - Added warning emoji to setup prompt - Improved help text to clarify security implications Users must now explicitly opt-in to autonomous mode.
Addressed CodeRabbit Security FeedbackFixed the
Commit: 9bb3069 Ready to rebase once 0.2.0 lands. Happy to add tests and docs as needed. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #120 +/- ##
==========================================
+ Coverage 41.95% 45.04% +3.08%
==========================================
Files 59 64 +5
Lines 12690 16312 +3622
==========================================
+ Hits 5324 7347 +2023
- Misses 7366 8965 +1599
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.learnings/ERRORS.md:
- Around line 15-16: The commit contains a personal/local filesystem path string
"Found JSONL file: /Users/dalecarman/Groove Jones Dropbox/Dale
Carman/Projects/dev/ralph-tui/.beads/issues.jsonl" in .learnings/ERRORS.md;
replace that exact path with a generic placeholder like "Found JSONL file:
/path/to/ralph-tui/.beads/issues.jsonl" (or sanitize programmatically where the
message is produced) and re-commit so no personal/local paths remain in the
repository.
- Line 84: Remove the personal filesystem path string "Ran in
/Users/dalecarman/Groove Jones Dropbox/Dale Carman/Projects/dev/ralph-tui" from
.learnings/ERRORS.md and replace it with a neutral placeholder (e.g., "Ran in
<project-path>" or simply remove the line); search the file for any other
occurrences of the same personal path and sanitize them the same way to avoid
leaking personal path information.
🧹 Nitpick comments (3)
.learnings/ERRORS.md (1)
1-122: Consider whether this file belongs in the repository.This appears to be internal development notes documenting transient errors encountered during development. Such notes are typically kept outside version control or in a personal notes directory. If the intent is to document common errors for other contributors, consider:
- Moving to a more appropriate location (e.g.,
docs/troubleshooting.md)- Generalising the content to be useful for all contributors rather than logging specific incidents
- Removing timestamps and incident-specific metadata
Additionally, this file appears unrelated to the Ampcode agent feature being added in this PR.
.claude/cache/agents/scout/latest-output.md (2)
232-232: Minor grammar: consider adding article.Per static analysis, "highest impact" should read "the highest impact" for correct grammar.
Suggested fix
-- **Intelligent selection** - picks tasks with highest impact +- **Intelligent selection** - picks tasks with the highest impact
507-510: Minor grammar improvements.A couple of small grammar refinements for clarity.
Suggested fixes
-2. **What happens if you edit prd.json while session is running?** - - Tasks are loaded at session start into `trackerState.tasks[]` - - Mid-session edits probably won't be picked up until next session +2. **What happens if you edit prd.json while the session is running?** + - Tasks are loaded at session start into `trackerState.tasks[]` + - Mid-session edits probably won't be picked up until the next session
Replaced personal filesystem paths with <project-root> placeholder per CodeRabbit review feedback.
|
Fixed the personal path leak in |
Per CodeRabbit feedback: - Replace spawn with execFile to avoid shell injection risks - Properly clear timeout to prevent event-loop leaks - Add resolved flag to prevent double-resolution
|
Fixed the
|
|
@carmandale do you want to try to refresh this PR to align with all the latest changes in the agent plugin system? |
Summary
Adds support for Ampcode as an agent in Ralph TUI.
Changes
AmpcodeAgentPlugininsrc/plugins/agents/builtin/ampcode.ts-x) for non-interactive executionfree,rush,smart)--dangerously-allow-allfor autonomous operationTesting
bun run typecheckpassesbun run lintpassesbun run buildpassesralph-tui plugins agentsshows Ampcode pluginUsage
Closes #105
Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.