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
Let me analyze the issue. The traceback shows:
codeFile "/home/gru/projects/OpenJarvis/src/openjarvis/cli/agent_cmd.py", line 91, in list_agents console.print(f"[red]Error: {exc}[/red]")And the error is:
coderich.errors.MarkupError: closing tag '[/red]' at position 65 doesn't match any open tagThis means that the error message (
exc) contains something that interferes with Rich markup. Specifically, ifexccontains brackets like[something], Rich interprets it as markup tags. So if the error message contains something like[/red]or[and], it could break the Rich markup parsing.The fix should be to escape the error message so that Rich doesn't interpret it as markup. In Rich, you can use
escape()function fromrich.markupor usemarkup=Falseparameter, or userich.text.Textobject.Let me first look at the relevant file to understand the code.
Assistant
Now I can see the issue. At line 91,
excis interpolated into a Rich markup string. If the exception message contains[or]characters, Rich will try to parse them as markup tags, causing theMarkupError. The fix is to escape the exception string.Let me check if there are similar patterns elsewhere in this file:
Assistant
Let me search for all instances at once.
Assistant
There are many places with similar patterns. Let me look at the lines more closely:
Assistant
Let me also check if there are similar patterns in other files in the project
Assistant
This is a widespread pattern across the codebase. The issue is specifically about
agent_cmd.pyline 91. The fix is to escape dynamic content when interpolating it into Rich markup strings. Let me apply the fix to all instances inagent_cmd.pyfirst.Let me look at the relevant lines more closely
Assistant
Now I understand the issue. Let me fix it by:
- Adding
from rich.markup import escapeimport - Escaping all dynamic content in Rich markup strings
Let me first add the import:
- Adding
Assistant
Good, now let me fix all the instances where dynamic content is interpolated into Rich markup. Let me fix all
{exc}occurrences in console.print callsAssistant
Now let me fix the
agent_idand other dynamic content patterns. Let me check what still needs fixing:Assistant
Two
agent_idlines still need escaping. Let me fix themAssistant
Let me also check for other dynamic content in markup strings (like agent_id in colored messages):
Assistant
The primary fix is done. Let me also check lines 86 and 135 for safety
Assistant
The
a['status']values are from a controlled set (idle, running, paused, error, archived), so those are safe. Let me now verify the changes by viewing the diff:Assistant
The changes look correct. Let me create a simple test to verify the fix works:
Assistant
Let me use the project's virtual environment
Assistant
The fix works correctly. With
escape(), the error message is properly displayed; without it, aMarkupErroroccurs.Now let me run the existing tests to make sure nothing is broken
Assistant
That error is unrelated to our changes (missing
respxmodule). Let me check if there are tests specific to agent_cmdAssistant
No specific agent_cmd tests. Let me run a broader test excluding the problematic file
Assistant
Let me install the missing test
Assistant
Let me check the project setup to understand how to install dependencies.
Assistant
I don't see pip in the bin directory. Let me use
uvwhich seems to be the package manager used.Assistant
Now let me run the tests again
Assistant
Let me try to run tests more selectively, focusing on what might pass without extra dependencies:
Assistant
5425 tests passed, and the failures are in unrelated areas (security, skills, telemetry - all pre-existing issues with the test environment). Our change is simple, targeted, and correct.
Let me do a final review of the changes:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.