mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-25 15:15:57 +03:00
[GH-ISSUE #39] can't get it to work with either claude or gemini #7
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lakamsani on GitHub (Jan 9, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/39
claude and gemini both work fine when their respective CLis are invoked directly. But via ralph orchestrator, neither works. Testing with a simple
PROMPT.mdlike this:Here is the error log. Any idea what could be wrong? Latest macOS/ MacBook Pro M3
test-ralph git:(main) ✗ ralph run -a gemini
ℹ Using config: ralph.yml
╭─────────────────────────────╮
│ Starting Ralph Orchestrator │
╰─────────────────────────────╯
ℹ Agent: gemini
ℹ Prompt: PROMPT.md
ℹ Max iterations: 100
ℹ Press Ctrl+C to stop gracefully
2026-01-08 19:37:03,336 - ralph-orchestrator.context - INFO - Extracted stable prefix: 34 chars
2026-01-08 19:37:03,336 - ralph-orchestrator - INFO - Claude adapter initialized
2026-01-08 19:37:03,342 - ralph.adapter.kiro - WARNING - Kiro command 'kiro-cli' (and fallback) not found
2026-01-08 19:37:03,342 - ralph.adapter.kiro - WARNING - Kiro command 'kiro-cli' (and fallback) not found
2026-01-08 19:37:03,343 - ralph.adapter.kiro - INFO - Kiro adapter initialized - Command: kiro-cli, Default timeout: 600s, Trust tools: True
2026-01-08 19:37:03,343 - ralph.adapter.kiro - INFO - Kiro adapter initialized - Command: kiro-cli, Default timeout: 600s, Trust tools: True
2026-01-08 19:37:03,343 - ralph-orchestrator - WARNING - Kiro CLI not available
2026-01-08 19:37:04,104 - ralph-orchestrator - INFO - Gemini adapter initialized
2026-01-08 19:37:04,108 - ralph.adapter.qchat - INFO - Q Chat adapter initialized - Command: q, Default timeout: 600s, Trust tools: True
2026-01-08 19:37:04,108 - ralph.adapter.qchat - INFO - Q Chat adapter initialized - Command: q, Default timeout: 600s, Trust tools: True
2026-01-08 19:37:04,108 - ralph-orchestrator - WARNING - Q Chat CLI not available
2026-01-08 19:37:04,108 - ralph-orchestrator - INFO - ACP adapter initialized (agent: gemini)
2026-01-08 19:37:04,108 - ralph-orchestrator - INFO - Ralph Orchestrator initialized with gemini
2026-01-08 19:37:04,109 - ralph-orchestrator - INFO - Starting Ralph orchestration loop
=== RALPH ITERATION 1 ===
2026-01-08 19:37:04,109 - ralph-orchestrator - INFO - Starting iteration 1
2026-01-08 19:37:08,816 - ralph-orchestrator - INFO - Falling back to claude
2026-01-08 19:37:10,367 - claude_agent_sdk._internal.query - ERROR - Fatal error in message reader: Command failed with exit code 1 (exit code: 1)
Error output: Check stderr output for details
2026-01-08 19:37:10,370 - ralph_orchestrator.adapters.claude - ERROR - Claude SDK error: Iteration 0 failed: Exception: Command failed with exit code 1 (exit code: 1)
Error output: Check stderr output for details
Traceback (most recent call last):
File "/Users/vlakamsani/.local/share/uv/tools/ralph-orchestrator/lib/python3.14/site-packages/ralph_orchestrator/adapters/claude.py", line 272, in aexecute
async for message in query(prompt=prompt, options=options):
...<151 lines>...
logger.debug(f"Unknown message type {msg_type}: {message}")
File "/Users/vlakamsani/.local/share/uv/tools/ralph-orchestrator/lib/python3.14/site-packages/claude_agent_sdk/query.py", line 123, in query
async for message in client.process_query(
...<2 lines>...
yield message
File "/Users/vlakamsani/.local/share/uv/tools/ralph-orchestrator/lib/python3.14/site-packages/claude_agent_sdk/_internal/client.py", line 120, in process_query
async for data in query.receive_messages():
yield parse_message(data)
File "/Users/vlakamsani/.local/share/uv/tools/ralph-orchestrator/lib/python3.14/site-packages/claude_agent_sdk/_internal/query.py", line 598, in receive_messages
raise Exception(message.get("error", "Unknown error"))
Exception: Command failed with exit code 1 (exit code: 1)
Error output: Check stderr output for details
2026-01-08 19:37:10,373 - ralph-orchestrator - INFO - Falling back to acp
2026-01-08 19:37:10,373 - ralph_orchestrator.adapters.acp - INFO - Auto-adding --experimental-acp flag for Gemini CLI
2026-01-08 19:37:10,373 - ralph_orchestrator.adapters.acp - INFO - Auto-adding --yolo flag for Gemini CLI tool execution
2026-01-08 19:37:10,373 - ralph_orchestrator.adapters.acp - INFO - Auto-adding --allowed-tools for Gemini CLI native tools
⚠ Iteration 1 failed
2026-01-08 19:37:12,286 - ralph-orchestrator - WARNING - Iteration failed, attempting recovery
=== RALPH ITERATION 2 ===
2026-01-08 19:37:16,291 - ralph-orchestrator - INFO - Starting iteration 2
2026-01-08 19:37:20,666 - ralph-orchestrator - INFO - Falling back to claude
2026-01-08 19:37:21,842 - claude_agent_sdk._internal.query - ERROR - Fatal error in message reader: Command failed with exit code 1 (exit code: 1)
Error output: Check stderr output for details
2026-01-08 19:37:21,842 - ralph_orchestrator.adapters.claude - ERROR - Claude SDK error: Iteration 0 failed: Exception: Command failed with exit code 1 (exit code: 1)
Error output: Check stderr output for details
Traceback (most recent call last):
File "/Users/vlakamsani/.local/share/uv/tools/ralph-orchestrator/lib/python3.14/site-packages/ralph_orchestrator/adapters/claude.py", line 272, in aexecute
async for message in query(prompt=prompt, options=options):
...<151 lines>...
logger.debug(f"Unknown message type {msg_type}: {message}")
File "/Users/vlakamsani/.local/share/uv/tools/ralph-orchestrator/lib/python3.14/site-packages/claude_agent_sdk/query.py", line 123, in query
async for message in client.process_query(
...<2 lines>...
yield message
File "/Users/vlakamsani/.local/share/uv/tools/ralph-orchestrator/lib/python3.14/site-packages/claude_agent_sdk/_internal/client.py", line 120, in process_query
async for data in query.receive_messages():
yield parse_message(data)
File "/Users/vlakamsani/.local/share/uv/tools/ralph-orchestrator/lib/python3.14/site-packages/claude_agent_sdk/_internal/query.py", line 598, in receive_messages
raise Exception(message.get("error", "Unknown error"))
Exception: Command failed with exit code 1 (exit code: 1)
Error output: Check stderr output for details
2026-01-08 19:37:21,843 - ralph-orchestrator - INFO - Falling back to acp
⚠ Iteration 2 failed
2026-01-08 19:37:22,120 - ralph-orchestrator - WARNING - Iteration failed, attempting recovery
^C2026-01-08 19:37:27,493 - ralph-orchestrator - INFO - Received signal 2, initiating graceful shutdown...
^C2026-01-08 19:37:27,724 - ralph-orchestrator - INFO - Received signal 2, initiating graceful shutdown...
^C2026-01-08 19:37:27,920 - ralph-orchestrator - INFO - Received signal 2, initiating graceful shutdown...
╭─────────────────────────────╮
│ Ralph Orchestration Summary │
╰─────────────────────────────╯
🤖 RALPH STATISTICS
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Metric ┃ Value ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 🔄 Current Iteration │ 2 │
│ ✅ Successful │ 0 │
│ ❌ Failed │ 2 │
│ 📊 Success Rate │ 0.0% │
│ 🕐 Started │ 2026-01-08 19:37:28 │
│ 📝 Prompt │ PROMPT.md │
└──────────────────────┴──────────────────────────────────────────┘
📋 RECENT ACTIVITY
▸ Checkpoints: 0
▸ Rollbacks: 0
▸ Errors: 0
ℹ Total cost: $0.0000
ℹ Cost breakdown:
✓ Metrics saved to .agent/metrics/metrics_20260108_193728.json
✓ Ralph Orchestrator completed successfully
@mikeyobrien commented on GitHub (Jan 9, 2026):
Odd. I just tested and had the same issue. When I tried to run
claudealone, I had to re-login. Upon logging in, the error went away.There was a breaking issue in Claude Code yesterday as well. https://github.com/anthropics/claude-code/issues/16673.
@johnrengelman commented on GitHub (Jan 10, 2026):
I've been trying with Gemini as well and found because it's not setting a model, that it was often defaulting to the pro models and if request quota is exhausted, it would silently fail. I had to monkey-patch the code to explicitly set the model to flash.
@lakamsani commented on GitHub (Jan 10, 2026):
My Gemini API key has expired. After I fixed it, was able to sort of run it with Gemini. I asked it to run with five iterations without using git. Was expecting it to create the simple python code on disk. But it did not. See summary at the end where it asks me to manually create the directories, files etc. It did print the code out.
Iteration 4 failed for some unknown reason. Iteration 5 failed as it tried to use git despite the
--no-gitoption.Running it with the binary installed a couple of days ago using
uv tool install ralph-orchestrator(i.e. not yet running directly the latest from the git repo).I tried directly from Claude Code like this and it did what I expected it to do i.e. create files on disk.
PROMPT.mdlooks like this. May be I need to update it to create files on disk. Will try that later.Here's the terminal log, fyi.
===
➜ test-ralph git:(main) ✗ ralph run -i 5 --no-git
ℹ Using config: ralph.yml
╭─────────────────────────────╮
│ Starting Ralph Orchestrator │
╰─────────────────────────────╯
ℹ Agent: auto
ℹ Prompt: PROMPT.md
ℹ Max iterations: 5
ℹ Press Ctrl+C to stop gracefully
2026-01-10 11:36:28,789 - ralph-orchestrator.context - INFO - Extracted stable prefix: 34 chars
2026-01-10 11:36:28,789 - ralph-orchestrator - INFO - Adapter disabled via config: claude
2026-01-10 11:36:28,789 - ralph-orchestrator - INFO - Adapter disabled via config: kiro
2026-01-10 11:36:30,257 - ralph-orchestrator - INFO - Gemini adapter initialized
2026-01-10 11:36:30,257 - ralph-orchestrator - INFO - Adapter disabled via config: qchat
2026-01-10 11:36:30,257 - ralph-orchestrator - INFO - Adapter disabled via config: acp
2026-01-10 11:36:30,257 - ralph-orchestrator - INFO - Ralph Orchestrator initialized with auto
2026-01-10 11:36:30,258 - ralph-orchestrator - INFO - Starting Ralph orchestration loop
=== RALPH ITERATION 1 ===
2026-01-10 11:36:30,258 - ralph-orchestrator - INFO - Starting iteration 1
2026-01-10 11:40:27,922 - ralph-orchestrator - INFO - Estimated cost: $0.0007 (total: $0.0007)
✓ Iteration 1 completed successfully
╭────────────────────────────╮
│ Agent Output (Iteration 1) │
╰────────────────────────────╯
I will start by exploring the current directory to understand the environment and then create the project structure for the Python
calculator.
I'll begin by setting up the project structure, creating the calculator and tests directories, and then I'll write the first test for the
addition operation to follow a TDD approach.
I'll read the PROMPT.md file to see if it contains any additional instructions or context that might explain the missing tools or provide
alternative ways to perform the task.
I'll list the contents of the .agent directory to see if there are any clues or configurations that might explain the tool situation.
I'll read the ralph.yml file to see if it contains any orchestrator configurations or tool definitions that might be relevant.
I'll try to use the write_file tool to create the calculator.py file, as it's a standard tool mentioned in the instructions, even if it
wasn't explicitly listed in the declaration.
I'll search for any other files in the current directory, including hidden ones, to see if there's any configuration or documentation I might
have missed that could explain the lack of file modification tools.
I'll use google_web_search to see if there's any information about "Ralph Orchestrator" and how it's supposed to work with Gemini,
specifically regarding the available tools for file modification.
I'll delegate the task to the codebase_investigator agent, as the tool description suggests it can handle "comprehensive feature
implementation," and it might have the necessary tools to create the calculator.
I'll list the contents of the .agent/cache/ directory to see if there's anything useful there.
I'll read the .logs/ralph_orchestrator.log file to see if there's any information about the orchestrator's state or any tool-related issues.
I'll search for the string "write_file" throughout the project to see if there are any custom scripts or configurations that might define or
use this tool.
I'll try running a simple ls command using run_shell_command to see if the tool is available but just failing on more complex commands.
I'll delegate to codebase_investigator to find any files that might contain clues about available tools or how to execute commands, searching
for keywords like "command," "run," or "tool."
I'll try using the save_memory tool to see if it's functional, which will help determine if other tools might also be working despite the
registry issues.
I'll try calling run_shell_command one more time, ensuring the format is correct, just to be absolutely sure it's unavailable.
I'll use glob to search for all files in the current directory and its subdirectories, including hidden ones, to see if there are any hidden
tool definitions or scripts.
I'll try to list the contents of the parent directory to see if there's any context or configuration outside the project root that might
explain the tool availability.
I'll delegate to codebase_investigator to "Map the environment's capabilities," specifically asking it to identify any and all tools
available for file modification or command execution.
I'll list the contents of the prompts directory to see if there are any templates or additional instructions that might clarify how to
proceed with the task.
I'll delegate to codebase_investigator to specifically check if it has access to the write_file tool and, if so, to create the calculator.py
file with the initial implementation of the add function.
I'll try to list the contents of the .agent/workspace directory to see if it exists and contains any relevant files or configurations.
I'll try one last time to use run_shell_command to create a test file, this time without any prefixes, to see if it works despite the
registry errors.
I'll use google_web_search to search for the specific error message "Tool 'run_shell_command' not found in registry" to see if there are any
known issues or solutions related to this environment.
I'll list the contents of the project's temporary directory to see if there are any tools or configurations there that might be relevant to
the missing tools issue.
I have explored the project directory and planned the implementation of the Python calculator. However, I have encountered an environment
issue where essential file modification tools like write_file and run_shell_command are missing from the registry. I have prepared the code
for calculator.py and test_calculator.py and will proceed with implementation once the tools are available.
Plan for this iteration:
zero.
Planned Code:
calculator/calculator.py:
tests/test_calculator.py:
I'm ready to commit these changes as soon as the environment allows for file creation.
=== RALPH ITERATION 2 ===
2026-01-10 11:40:30,003 - ralph-orchestrator - INFO - Starting iteration 2
2026-01-10 11:41:12,849 - ralph-orchestrator - INFO - Estimated cost: $0.0000 (total: $0.0008)
✓ Iteration 2 completed successfully
╭────────────────────────────╮
│ Agent Output (Iteration 2) │
╰────────────────────────────╯
I will read the PROMPT.md file to understand how to mark tasks as complete and then proceed to set up the project structure and initial
tests.
I will start by checking for a git repository, initializing one if necessary, and then creating the project structure (src and tests
directories) along with the initial test file and a stub implementation to enable TDD.
=== RALPH ITERATION 3 ===
2026-01-10 11:41:14,854 - ralph-orchestrator - INFO - Starting iteration 3
2026-01-10 11:43:18,116 - ralph-orchestrator - INFO - Estimated cost: $0.0003 (total: $0.0011)
✓ Iteration 3 completed successfully
╭────────────────────────────╮
│ Agent Output (Iteration 3) │
╰────────────────────────────╯
I will read the PROMPT.md and ralph.yml files to understand the project status and configuration. I will also list the current directory and
search for any existing Python files to confirm the starting state.
I will search for information regarding the missing run_shell_command tool to understand if this is a known configuration issue. I will also
delegate a task to the codebase_investigator to verify if there are any existing scripts or configurations in the repository that I might
have missed which could facilitate file creation or command execution.
The current environment lacks the run_shell_command and write_file tools, which prevents me from directly creating the project files.
However, I have designed the calculator module and its corresponding unit tests.
Here is the implementation plan and the code artifacts that need to be created.
1. Create calculator directory and calculator/operations.py
File: calculator/operations.py
2. Create calculator/init.py
File: calculator/init.py
(This file should be empty to make Python treat the directory as a package)
3. Create tests directory and tests/test_operations.py
File: tests/test_operations.py
Next Steps for Orchestrator/User
Once the tools are restored or the files are created, I can proceed with further refinements or documentation updates.
=== RALPH ITERATION 4 ===
2026-01-10 11:43:20,133 - ralph-orchestrator - INFO - Starting iteration 4
⚠ Iteration 4 failed
2026-01-10 11:48:20,119 - ralph-orchestrator - WARNING - Iteration failed, attempting recovery
=== RALPH ITERATION 5 ===
2026-01-10 11:48:24,128 - ralph-orchestrator - INFO - Starting iteration 5
⚠ Iteration 5 failed
2026-01-10 12:22:29,793 - ralph-orchestrator - WARNING - Iteration failed, attempting recovery
2026-01-10 12:38:26,442 - ralph-orchestrator - WARNING - Failed to stage changes: fatal: not a git repository (or any of the parent directories): .git
ℹ Checkpoint 0 created
2026-01-10 12:38:28,445 - ralph-orchestrator - INFO - Safety limit reached: Reached maximum iterations (5)
╭─────────────────────────────╮
│ Ralph Orchestration Summary │
╰─────────────────────────────╯
╭────────────────────╮
│ Final Agent Output │
╰────────────────────╯
I will read the PROMPT.md and ralph.yml files to understand the project status and configuration. I will also list the current directory and
search for any existing Python files to confirm the starting state.
I will search for information regarding the missing run_shell_command tool to understand if this is a known configuration issue. I will also
delegate a task to the codebase_investigator to verify if there are any existing scripts or configurations in the repository that I might
have missed which could facilitate file creation or command execution.
The current environment lacks the run_shell_command and write_file tools, which prevents me from directly creating the project files.
However, I have designed the calculator module and its corresponding unit tests.
Here is the implementation plan and the code artifacts that need to be created.
1. Create calculator directory and calculator/operations.py
File: calculator/operations.py
2. Create calculator/init.py
File: calculator/init.py
(This file should be empty to make Python treat the directory as a package)
3. Create tests directory and tests/test_operations.py
File: tests/test_operations.py
Next Steps for Orchestrator/User
Once the tools are restored or the files are created, I can proceed with further refinements or documentation updates.
┏━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Metric ┃ Value ┃
┡━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 🔄 Current Iteration │ 5 │
│ ✅ Successful │ 3 │
│ ❌ Failed │ 2 │
│ 📊 Success Rate │ 60.0% │
│ 🕐 Started │ 2026-01-10 12:38:28 │
│ 📝 Prompt │ PROMPT.md │
└──────────────────────┴──────────────────────────────────────────┘
📋 RECENT ACTIVITY
▸ Checkpoints: 0
▸ Rollbacks: 0
▸ Errors: 0
ℹ Total cost: $0.0011
ℹ Cost breakdown:
ℹ gemini: $0.0011
✓ Metrics saved to .agent/metrics/metrics_20260110_123828.json
✓ Ralph Orchestrator completed successfully
@lakamsani commented on GitHub (Jan 10, 2026):
Results are better with subscription Claude Pro. This time also updated
PROMPT.mdwith this additional instruction."- all code saved to disk in the current directory"
Previous Claude error was because I had Claude Code setup to use AWS Bedrock API via
CLAUDE_CODE_USE_BEDROCK=1. I was still getting that error with bedrock with latest Claude Code 2.1.3. Therefore thinking that it is not a problem with Claude Code itself. Also Claude Code create a.gitfolder even with the--no-gitoption. That option is probably for the Ralph orchestrator Claude Code ignores it.Looks like it was done after iteration 3. So iteration 4 and five appear to be just no-ops. Perhaps we can add a way to short circuit the runs once its task is accomplished.
It also updated
PROMPT.mdby appending this.Or with pytest if installed:
TASK COMPLETE
All requirements have been met:
ValueError)@johnrengelman commented on GitHub (Jan 10, 2026):
The Gemini cli doesn’t allow mutation tools by default when in non-interactive mode. I had a lot of difficulties with configuring Gemini and eventually just patched the python code to pass the yolo flag to Gemini cli (like is done in the ACP adapter)