ISSUE DESCRIPTION jarvis agents list Traceback Description Learning OpenJarvis on a…
- User
ISSUE DESCRIPTION
jarvis agents list Traceback
Description
Learning OpenJarvis on a Windows machine with WSL2. I was wondering what would happen on a clean reboot and listed the agents. This worked the first two times and listed the "... My Assistant │ deep_research ...". I even used the ID to ask it questions which worked (jarvis agents ask b0e6dece007b "How can I contribute to the OpenJarvis Project"). I had not loaded the model (Gemma 4 31b) into Ollama (this was direct from an open WSL Ubuntu window). My alias for jarvis is jarvis() { cd "@" }
Assistant
I'll start by exploring the repository structure and understanding the issue. The traceback shows a
rich.errors.MarkupErrorinagent_cmd.pyat line 91 where it tries to print an error message with Rich markup, but the error message itself contains characters that conflict with Rich's markup syntax.Assistant
The user is right - I need to use the correct tool calling format with bash_terminal. Let me fix that.
Assistant
Now I can see the issue clearly. The problem is on line 91 (and several other lines) where:
pythonconsole.print(f"[red]Error: {exc}[/red]")If the exception message (
exc) contains square brackets[or], Rich interprets them as markup tags. The error messageclosing tag '[/red]' at position 65 doesn't match any open tagindicates that the exception message itself contained a[/sequence that Rich tried to interpret as a closing tag.Let me first reproduce the issue, then fix it:
Assistant
Let me check if there's a virtual environment or install rich:
Assistant
The issue is confirmed. When
exccontains Rich markup characters like[or], Rich tries to interpret them, causing the error. The fix is to userich.markup.escape()to escape the exception message before embedding it in Rich markup.Now let me check the file more carefully and see all the places where this pattern is used:
Assistant
There are 11 occurrences of this pattern. I need to fix all of them by escaping the
excvariable. Let me also check the import section to see what's already imported:Assistant
Now I need to:
- Add
from rich.markup import escapeto the imports - Replace all occurrences of
{exc}with{escape(str(exc))}in the error print statements
Let me do this:
- Add
Assistant
The sed command failed because of the special characters. Let me use Python instead:
Assistant
Now let me verify the changes:
Assistant
All 11 occurrences have been fixed. Now let me create a test script to verify the fix works:
Assistant
The fix works correctly. Now let me check if there are any existing tests in the repository that I should run:
Assistant
Let me check if there are any tests specifically for the CLI agent commands:
Assistant
Let me check the agent_cmd test file to see if there are relevant tests:
Assistant
Good. Let me run these tests to make sure my changes don't break anything:
Assistant
All 17 tests pass. Now let me verify my changes are correct by looking at the final state of the modified file:
Assistant
The changes look correct. Let me also create a more comprehensive test to verify the fix handles the specific scenario from the issue:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.