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 look at the issue. The traceback shows that in
agent_cmd.pyline 91, there's aMarkupErrorbecause the error message contains something that Rich interprets as markup tags. The fix is to escape the error string or use a different rendering approach.Let me explore the relevant file.
Assistant
The issue is clear. The error message
{exc}can contain text that Rich interprets as markup tags (like[red]or[/something]), causing aMarkupError. The fix is to escape the dynamic content usingrich.markup.escape().Let me find all similar patterns in the codebase:
Assistant
There are many occurrences. The root cause is that
{exc}(and other dynamic content) can contain[and]characters that Rich interprets as markup tags. The fix is to escape dynamic content usingrich.markup.escape().Let me first check what other dynamic content is embedded inside markup tags that could also trigger this issue:
Assistant
Let me check which files already import from
rich.markup:Assistant
Let me write a Python script to fix all the
{exc}and{exc.message}occurrences in markup strings by escaping them, and add the necessary import:Assistant
Let me verify the changes in
agent_cmd.py:Assistant
I notice the script also replaced
{exc}inclick.echocalls (lines 330, 538) which don't need escaping — that would add literal backslashes. Let me check and fix those:Assistant
Good, the
click.echolines are fixed. Let me check if there are any other non-console.printcontexts that got escaped incorrectly:Assistant
Let me check the context of each non-console.print case to determine whether escaping is appropriate (Rich rendering) or harmful (plain click output):
Assistant
Let me check how
CheckResult.messageis rendered:Assistant
The
doctor_cmd.pyCheckResult.messageis rendered through a Rich table, so escaping is correct there. Now let me check the other non-console cases:Assistant
Let me check how
_test_queryresult is used in quickstart:Assistant
The
quickstart_cmd.pyresult is rendered viaconsole.print, so escaping is correct. Now let me revert themine_cmd.pyClickExceptioncase (click doesn't parse Rich markup):Assistant
Now let me verify the imports were added correctly across all affected files and that there are no syntax issues:
Assistant
Let me check
mine_cmd.pysince I reverted one line — does it still useescapeelsewhere?Assistant
mine_cmd.pyhas the import but no longer usesescape. That's an unused import - not a problem functionally but it's a lint issue. Let me check if there are other uses of escape in mine_cmd.py.Assistant
No other uses. Let me remove the unused import from
mine_cmd.py:Assistant
I notice the import was inserted BEFORE
from __future__ import annotations, which would cause a SyntaxError. Let me check which files have this problem:Assistant
Only
mine_cmd.pyhas this issue, and since it no longer usesescape, I'll remove the import line:Assistant
Now let me verify all affected files compile without syntax errors:
Assistant
Let me check if
init_cmd.py(which already had the import) has any{exc}that got replaced:Assistant
Now let me create a reproduction script to confirm the fix resolves the MarkupError:
Assistant
The reproduction confirms the fix. The old behavior crashes with the exact
MarkupErrorfrom the issue, and the new behavior works correctly. Now let me run the existing test suite to make sure nothing broke:Assistant
One test failed. Let me check if this is a pre-existing failure unrelated to my change by stashing my changes:
Assistant
The test fails on original code too — it's a pre-existing failure (the self-update message appended to JSON output), unrelated to my change. Let me restore my stashed changes:
Assistant
Let me restore
uv.lock(modified byuv run) and run the broader CLI test suite excluding the pre-existing failure:Assistant
Let me verify these failures are pre-existing by running the same tests on the original code:
Assistant
All 13 failures are pre-existing on the original code — my changes introduce no new failures. Let me restore
uv.lockand run the agent command tests specifically (the area related to the issue):Assistant
All agent command tests pass. Let me restore
uv.lockand review my complete diff:Assistant
Let me do a final review of a couple of key diffs to ensure correctness:
Assistant
Let me do a final broad check for any remaining unescaped
{exc}insideconsole.print/table.add_rowmarkup contexts across the whole codebase:Assistant
Two more in
evals/cli.py. Let me fix those too:Assistant
I need to add the import after the rich.console import (line 12), and replace the two
{exc}with{escape(str(exc))}.Assistant
The sed for replacing FAILED didn't match (escaping issues). Let me check what happened. The grep for 'FAILED:.*{exc' returned nothing, which means either it was replaced or the pattern didn't match. Let me check the actual lines.
Assistant
The replacement worked. Let me verify the file compiles:
Assistant
No remaining unescaped
{exc}in markup contexts. Let me run the eval CLI tests to confirm nothing broke:Assistant
Let me do a final review of a few more changed files to ensure correctness:
Assistant
All diffs look clean. Let me do a final compile check across all modified files and run the full CLI agent/doctor/registry/connect/ask test suites one more time:
Assistant
All tests pass. Let me verify the final git status to ensure
uv.lockisn't included in my changes:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.