Fix FunctionCall.Arguments (map[string]any) and Parameters
(json.RawMessage) type usage in new upstream providers (antigravity,
codex). Remove duplicate FallbackCandidate/StreamEvent from types.go.
Add cloneToolArgs, fix session Close signature, remove duplicate
functions from loop.go, and fix test type assertions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the LLM calls a non-existent tool, the error message now lists all
available tools so the LLM can self-correct on the next iteration instead
of blindly guessing names (observed 7+ wasted iterations in heartbeat).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace pseudo-syntax examples with JSON Tool:/Arguments: format in system
prompt and orchestration reminders. Add parameter hints to tool summaries,
improve error messages with usage examples, and strengthen delegation nudges.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enable long-running processes (dev servers, builds) to run in the background
without blocking the agent loop. Background processes are tracked with ring
buffers, auto-killed after 45min, and injected into the system prompt.
- Add StatusProvider interface and GetRuntimeStatus to ToolRegistry
- Extend exec tool with background=true, bg_action=output/kill
- Add bg_monitor tool with list/watch/tail actions
- Inject active bg process info into system prompt automatically
- Add dev-preview skill documentation
- Add comprehensive tests for all new functionality
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- normalizeAlpha / NormalizeToolName: keep only lowercase a-z
- Replace findToolCallOpenTag + findToolCallCloseTag with single
findToolCallBlock using regex + greedy close tag matching
- Both XML extraction and stripping use the same findToolCallBlock
- Edit distance still used for fuzzy "toolcall" tag identification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
LLMs (e.g. MiniMax) sometimes call "readfile" instead of "read_file".
Add NormalizeToolName to strip underscores/hyphens and lowercase, with
fuzzy fallback in ToolRegistry.Get(). Also normalize the interview
tool allow-list so blocked tools aren't bypassed by name variants.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add constants package with IsInternalChannel helper to centralize internal channel checks across agent, channels, and heartbeat services
- Add ToProviderDefs method to ToolRegistry to consolidate tool definition conversion logic used in agent loop and tool loop
- Refactor SubagentTool.Execute to use RunToolLoop for consistent tool execution with iteration tracking
- Remove duplicate inline map definitions and type assertion code throughout codebase
Remove .ralph/ directory files from git tracking.
These are no longer needed as the tool-result-refactor is complete.
Also removes root-level prd.json and progress.txt.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update ToolRegistry.ExecuteWithContext to accept asyncCallback parameter
- Check if tool implements AsyncTool and set callback if provided
- Define asyncCallback in AgentLoop.runLLMIteration
- Callback uses bus.PublishOutbound to send async results to user
- Update Execute method to pass nil for backward compatibility
- Add debug logging for async callback injection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update all Tool implementations to return *ToolResult instead of (string, error)
- ShellTool: returns UserResult for command output, ErrorResult for failures
- SpawnTool: returns NewToolResult on success, ErrorResult on failure
- WebTool: returns ToolResult with ForUser=content, ForLLM=summary
- EditTool: returns SilentResult for silent edits, ErrorResult on failure
- FilesystemTool: returns SilentResult/NewToolResult for operations, ErrorResult on failure
- Temporarily disable cronTool in main.go (will be re-enabled in US-016)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add adhocore/gronx dependency for cron expression parsing
- Fix CronService race conditions and add cron expression support
- Add CronTool with add/list/remove/enable/disable actions
- Add ContextualTool interface for tools needing channel/chatID context
- Add ProcessDirectWithChannel to AgentLoop for cron job execution
- Register CronTool in gateway and wire up onJob handler
- Fix slice bounds panic in addJob for short messages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add MemoryStore for persistent long-term and daily notes
- Add dynamic tool summary generation in system prompt
- Fix YAML frontmatter parsing for nanobot skill format
- Add GetSummaries() method to ToolRegistry
- Fix DebugCF logging to use structured metadata
- Improve web_search and shell tool descriptions