Skip to content
TheChatArchiveThe Chat Archive
QwenQwen/Qwen3.6-27B· alibabaHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION jarvis agents list Traceback Description Learning OpenJarvis on a…

  1. 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 "OPENJARVISHOME"∣∣return1uvrunjarvis"OPENJARVIS_HOME" || return 1 uv run jarvis "@" }

    My config is terse # OpenJarvis configuration # Hardware: 13th Gen Intel(R) Core(TM) i9-13900K (32 cores, 62.6 GB RAM) # GPU: NVIDIA GeForce RTX 4090 (24.0 GB VRAM) # Full reference config: jarvis init --full

    [engine] default = "ollama"

    [engine.ollama] # host = "http://localhost:11434" # set to remote URL if engine runs elsewhere

    [intelligence] default_model = "gemma4:31b"

    [agent] default_agent = "simple"

    [tools] enabled = ["code_interpreter", "web_search", "file_read", "shell_exec"]

    Steps to Reproduce

    1. Start an initial WSL Ubuntu shell
    2. run "jarvis"
    3. this will list the --help command
    4. run "jarvis agents list"
    5. this will list a table with one agent b0e6dece007b │ My Assistant │ deep_research │ idle │ 0 │ 0
    6. run "jarvis agents ask b0e6dece007b "How are you""
    7. this will respond after it loads and starts the model, GPU memory is utilized
    8. run "ps -aux|grep ollama" in another shell window
    9. this will output two processes:
    10. ollama 196 0.0 0.3 3405152 220636 ? Ssl 11:29 0:01 /usr/local/bin/ollama serve
    11. ollama 1078 66.2 6.9 195616136 4544716 ? Sl 12:39 5:25 /usr/local/bin/ollama runner --ollama-engine --model usr/share/ollama/.ollama/models/blobs/sha256-280af6832eca23cb322c4dcc65edfea98a21b8f8ab07dc7553bd6f7e6e7a3313 --port 42291
    12. run "jarvis agents ask b0e6dece007b "How can I contribute to the OpenJarvis Project""
    13. This will respond
    14. Wait a bit, until GPU memory frees
    15. run the "ps -aux|grep ollama" in another shell window and see only the one ollam process for the "serve"
    16. run "jarvis agents list"
    17. see Traceback

    Expected Behavior

    Expected the table listing with one idle agent: b0e6dece007b │ My Assistant │ deep_research │ idle │ 0 │ 0

    Actual Behavior

    Traceback

    Operating System

    Linux

    Python Version

    3.12

    Hardware

    NVIDIA GPU

    Engine

    Ollama

    Logs / Traceback

    Traceback (most recent call last):
      File "/home/gru/projects/OpenJarvis/.venv/bin/jarvis", line 10, in <module>
        sys.exit(main())
                 ^^^^^^
      File "/home/gru/projects/OpenJarvis/src/openjarvis/cli/__init__.py", line 122, in main
        cli()
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
        return self.main(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/click/core.py", line 1406, in main
        rv = self.invoke(ctx)
             ^^^^^^^^^^^^^^^^
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
        return ctx.invoke(self.callback, **ctx.params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke
        return callback(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/gru/projects/OpenJarvis/src/openjarvis/cli/agent_cmd.py", line 91, in list_agents
        console.print(f"[red]Error: {exc}[/red]")
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/rich/console.py", line 1698, in print
        renderables = self._collect_renderables(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/rich/console.py", line 1558, in _collect_renderables
        self.render_str(
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/rich/console.py", line 1448, in render_str
        rich_text = render_markup(
                    ^^^^^^^^^^^^^^
      File "/home/gru/projects/OpenJarvis/.venv/lib/python3.12/site-packages/rich/markup.py", line 167, in render
        raise MarkupError(
    rich.errors.MarkupError: closing tag '[/red]' at position 65 doesn't match any open tag
    

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /OpenJarvis, current file: none) bash-$

  2. Qwen Assistant

    Let me analyze the issue. The error is:

    rich.errors.MarkupError: closing tag '[/red]' at position 65 doesn't match any open tag
    

    This happens in src/openjarvis/cli/agent_cmd.py at line 91:

    console.print(f"[red]Error: {exc}[/red]")
    

    The problem is that when an exception message (exc) contains Rich markup tags (like square brackets), Rich tries to interpret them as markup. If the exception message contains something like [/something], it could conflict with the closing [/red] tag.

    Actually, looking more carefully, the issue is that if exc contains a [ character that Rich interprets as the start of a tag, but the corresponding closing tag doesn't match properly, it causes this error.

    Let me first explore the repository structure and find the relevant file.

  3. Qwen Assistant

    Let me look at the agent_cmd.py file to understand the issue.

  4. Qwen Assistant

    Now I can see the issue. The error occurs at line 91 in the list_agents function:

    console.print(f"[red]Error: {exc}[/red]")
    

    The problem is that when an exception message contains square brackets (like [ or ]), Rich interprets them as markup tags. If the exception message contains something that looks like a closing tag (e.g., [/red]), it conflicts with the actual closing tag.

    Looking at the traceback again:

    rich.errors.MarkupError: closing tag '[/red]' at position 65 doesn't match any open tag
    

    The error message from the exception likely contains some text with brackets that Rich misinterprets. The fix is to escape the exception message so Rich treats it as literal text, not markup.

    In Rich, you can escape user content by using {exc!r} or by using the soft_wrap or escaping brackets. The proper way is to escape the markup by replacing [ with \\[ or by using a different approach.

    Let me check all the occurrences of this pattern in the file:

  5. Qwen Assistant

    There are 11 occurrences of the same pattern. The fix is to escape the exception message so Rich treats it as literal text, not markup. Rich provides rich.markup.escape() for this purpose, or we can escape the brackets manually.

    Let me first create a script to reproduce the issue:

  6. Qwen Assistant

    Interesting, it worked with a simple error. Let me try to find what kind of exception message would cause the specific issue mentioned in the traceback:

  7. Qwen Assistant

    Now I've reproduced the issue. The problem is that when an exception message contains [/red] or any Rich markup tag, it confuses Rich's parser. The fix is to escape the exception message before passing it to Rich.

    Let me check what Rich provides for escaping:

  8. Qwen Assistant

    The rich.markup.escape() function properly escapes the exception message. Now I need to fix all 11 occurrences in the file. Let me also check if there are similar patterns elsewhere:

  9. Qwen Assistant

    There are many occurrences of this pattern across multiple files. I need to fix them all. The best approach would be to:

    1. Fix the issue in all affected files by escaping the exception message using rich.markup.escape()
    2. Alternatively, use a simpler approach that doesn't require importing escape - just escape the brackets manually using string replacement

    Since there are many files, let me think about the best approach. The simplest fix that works in all cases without changing imports would be to replace {exc} with {str(exc).replace("[", "[[]")} or use rich.markup.escape().

    Actually, looking at the imports in agent_cmd.py, it already imports from rich:

    from rich.console import Console
    from rich.table import Table
    

    So I could add from rich.markup import escape to the import. But this needs to be done for all files.

    Let me check if each file already imports from rich, and what the cleanest fix would be. Actually, the simplest and most robust approach is to use str(exc).replace("[", "[[]") which escapes the brackets for Rich markup without requiring additional imports.

    Wait, let me think about this more carefully. The Rich escape syntax uses [[] for literal [. Let me verify:

    <tool_call> <function=bash_terminal> <parameter=command> cd /OpenJarvis && uv run python3 -c " from rich.console import Console

    exc = Exception('some error with [/red] tag') console = Console(stderr=True)

    Test escaping brackets manually

    console.print(f'[red]Error: {str(exc).replace("[", "[[]")}') " </tool_call>

  10. Qwen Assistant

    The issue is that I need to properly escape the shell command with the quotes. Let me try a different approach.

  11. Qwen Assistant

    The [[] escape doesn't work correctly - it shows [[] literally. Let me check the correct escape sequence for Rich.

  12. Qwen Assistant

    Now I need to fix all files. The fix requires:

    1. Adding from rich.markup import escape import
    2. Replacing {exc} with {escape(str(exc))} in error print statements

    Let me start with the file from the traceback (agent_cmd.py):

  13. Qwen Assistant

    The file already imports from rich. I need to:

    1. Add escape to the imports from rich.markup
    2. Replace all console.print(f"[red]Error: {exc}[/red]") with console.print(f"[red]Error: {escape(str(exc))}[/red]")

    Let me do this for agent_cmd.py first, then for all other files.

  14. Qwen Assistant

    The user seems to have sent an empty message or just whitespace. I should continue with my work on fixing the Rich markup error issue. I was in the process of fixing the files. Let me check the current state and continue.

  15. Qwen Assistant

    Good, the import was added. Now I need to replace all the error print statements in agent_cmd.py with the escaped version.

  16. Qwen Assistant

    The sed command failed because of the special characters. Let me use a different approach with Python to do the replacement.

  17. Qwen Assistant

    No matches found, which means all occurrences were replaced. Let me verify the replacement worked correctly:

  18. Qwen Assistant

    Now I need to fix all the other files that have the same pattern. Let me create a script to automate this:

  19. Qwen Assistant

    Now let me verify the changes were applied correctly:

  20. Qwen Assistant

    All 46 occurrences have been replaced. Now let me verify the fix works by testing with a simulated error:

  21. Qwen Assistant

    The fix works. Now let me check if there are any tests I should run to make sure nothing is broken:

  22. Qwen Assistant

    Let me check if there are any CLI-related tests I can run:

  23. Qwen Assistant

    There's a test_agent_cmd.py which is directly related to the file I modified. Let me run it to verify my changes don't break existing tests.

  24. Qwen Assistant

    There's an indentation error in optimize_cmd.py. My script must have corrupted the import section of some files. Let me check and fix it.

  25. Qwen Assistant

    The imports look fine at the top. Let me check around line 460 where the error is:

  26. Qwen Assistant

    I see the issue. The script added from rich.markup import escape after the local import from rich.console import Console inside the function, but with wrong indentation. This happened because my script found a from rich.console import Console line that was inside a function, not at module level.

    Let me fix this file:

  27. Qwen Assistant

    Now let me check if there are any other files that might have the same issue. My script might have inserted the import incorrectly in files that have from rich.console import Console inside functions.

  28. Qwen Assistant

    Let me check all files that have from rich.console import Console inside a function (not at the module level) to see if my script may have caused issues:

  29. Qwen Assistant

    These look correct - they're at the module level. Let me check for any indentation issues in all the files I modified:

  30. Qwen Assistant

    All files compile correctly now. Let me run the test again:

  31. Qwen Assistant

    All 17 tests pass. Let me also run some of the other CLI tests to make sure I haven't broken anything:

  32. Qwen Assistant

    Excellent! All 38 tests pass. Let me now also verify my fix handles the edge cases correctly by writing a quick test script:

  33. Qwen Assistant

    All edge cases pass. Now let me review the checklist and summarize what I've done:

    Checklist Review:

    1. If an error was reported in the issue description, I have successfully reproduced it.

      • ✅ I reproduced the rich.errors.MarkupError: closing tag '[/red]' at position 65 doesn't match any open tag error by simulating an exception message containing Rich markup tags like [/red].
    2. If an error was reported in the issue description, I have confirmed that my fix resolves the error.

      • ✅ I confirmed the fix by:
        • Testing that the error occurs without the fix
        • Testing that the fix using rich.markup.escape() prevents the error
        • Testing multiple edge cases with various problematic exception messages
    3. I have thought about edge cases and made sure my fix handles them as well.

      • ✅ I tested edge cases including:
        • Normal error messages
        • Messages with square brackets like [brackets]
        • Messages with Rich tags like [/red], [bold], [link=...]
        • Messages that look like connection errors [Errno 111]
        • Messages with multiple closing tags
    4. I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.

      • ✅ I ran tests in:
        • tests/cli/test_agent_cmd.py - 17 tests passed
        • tests/cli/test_tool_cmd.py - 18 tests passed
        • tests/cli/test_workflow_cmd.py - 4 tests passed
        • tests/cli/test_config_cmd.py - 16 tests passed
      • All 55 tests passed successfully.

    Let me do a final verification by checking the diff of my changes:

  34. Qwen Assistant

    The uv.lock file changed during the build process but that's not part of my fix. Let me restore that file:

  35. Qwen Assistant

    I have successfully resolved the issue. Here's a summary of the fix:

    Problem

    The jarvis agents list command was throwing a rich.errors.MarkupError when an exception occurred and the exception message contained square brackets (like [/red]). Rich interprets square brackets as markup tags, causing a parsing error when the exception message contains tags that conflict with the surrounding markup.

    Root Cause

    In src/openjarvis/cli/agent_cmd.py line 91 (and similar patterns in other CLI files):

    console.print(f"[red]Error: {exc}[/red]")
    

    When exc contains Rich markup-like strings (e.g., connection errors with [Errno 111]), Rich's parser fails.

    Fix

    Added from rich.markup import escape import and changed all occurrences to:

    console.print(f"[red]Error: {escape(str(exc))}[/red]")
    

    The escape() function properly escapes square brackets in the exception message so Rich treats them as literal text.

    Files Modified

    • src/openjarvis/cli/agent_cmd.py (11 occurrences fixed)
    • src/openjarvis/cli/compose_cmd.py (7 occurrences fixed)
    • src/openjarvis/cli/config_cmd.py (5 occurrences fixed)
    • src/openjarvis/cli/eval_cmd.py (1 occurrence fixed)
    • src/openjarvis/cli/feedback_cmd.py (4 occurrences fixed)
    • src/openjarvis/cli/operators_cmd.py (9 occurrences fixed)
    • src/openjarvis/cli/optimize_cmd.py (3 occurrences fixed)
    • src/openjarvis/cli/registry_cmd.py (1 occurrence fixed)
    • src/openjarvis/cli/scheduler_cmd.py (1 occurrence fixed)
    • src/openjarvis/cli/tool_cmd.py (2 occurrences fixed)
    • src/openjarvis/cli/workflow_cmd.py (2 occurrences fixed)

    Checklist

    • ✅ Reproduced the error: Confirmed the MarkupError occurs with exception messages containing Rich markup tags
    • ✅ Confirmed fix works: Tested that escape(str(exc)) prevents the error for various problematic exception messages
    • ✅ Edge cases handled: Tested normal messages, brackets, Rich tags, connection errors, and multiple closing tags
    • ✅ Existing tests pass: Ran 55 related CLI tests, all passed

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.