Skip to content

Unable to run due to "unterminated string literal" #223

@remot3

Description

@remot3

I am tryng to run CAI on a WSL instance and I am getting the following error:

ERROR:cai.cli:Error in main loop: unterminated string literal (detected at line 576) (codeagent.py, line 576) Traceback (most recent call last): File "/home/remot3/cai_env/lib/python3.11/site-packages/cai/cli.py", line 1288, in run_cai_cli if commands_handle_command(command, args): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/remot3/cai_env/lib/python3.11/site-packages/cai/repl/commands/base.py", line 154, in handle_command return cmd.handle(args) ^^^^^^^^^^^^^^^^ File "/home/remot3/cai_env/lib/python3.11/site-packages/cai/repl/commands/agent.py", line 136, in handle return handler(args[1:] if len(args) > 1 else None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/remot3/cai_env/lib/python3.11/site-packages/cai/repl/commands/agent.py", line 159, in handle_list agents_to_display = get_available_agents() ^^^^^^^^^^^^^^^^^^^^^^ File "/home/remot3/cai_env/lib/python3.11/site-packages/cai/agents/__init__.py", line 87, in get_available_agents module = importlib.import_module(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1206, in _gcd_import File "<frozen importlib._bootstrap>", line 1178, in _find_and_load File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 936, in exec_module File "<frozen importlib._bootstrap_external>", line 1074, in get_code File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/remot3/cai_env/lib/python3.11/site-packages/cai/agents/codeagent.py", line 576 f"❌ Code generation failed: { ^ SyntaxError: unterminated string literal (detected at line 576)

I checked the code and there are many instances of this such as the following:

Image

Is this a known issue and only affects WSL deployments or am I missing something here?

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions