Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Mux error on certain files and workspace with multiple rules #1195

@danbarr

Description

@danbarr

Describe the issue

Certain files are causing a "404 status code (no body)" error when I include them as context, along with a workspace that has multiple muxing filter rules. This is using Continue's chat function:

2025-03-03T18:05:24.521167Z [error    ] Error getting active workspace muxes: 'str' object has no attribute 'get' lineno=57 module=router pathname=/app/src/codegate/muxing/router.py
Traceback (most recent call last):
  File "/app/src/codegate/muxing/router.py", line 51, in _get_model_route
    model_route = await mux_registry.get_match_for_active_workspace(thing_to_match)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/codegate/muxing/rulematcher.py", line 216, in get_match_for_active_workspace
    if rule.match(thing_to_match):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/codegate/muxing/rulematcher.py", line 136, in match
    is_rule_matched = self._is_matcher_in_filenames(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/codegate/muxing/rulematcher.py", line 123, in _is_matcher_in_filenames
    filenames_to_match = self._extract_request_filenames(detected_client, data)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/codegate/muxing/rulematcher.py", line 111, in _extract_request_filenames
    return body_extractor.extract_unique_filenames(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/codegate/extract_snippets/body_extractor.py", line 88, in extract_unique_filenames
    return self._extract_from_list_user_messages(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/codegate/extract_snippets/body_extractor.py", line 49, in _extract_from_list_user_messages
    if msg_content.get("type", "") == "text":
       ^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'

Steps to Reproduce

It doesn't seem to be specific to file type, for example I get the error on some files in the codegate-docs repo, like docs/index.md causes an error, but docs/how-to/configure.md doesn't cause it.

But then if I remove all my mux rules besides the catch-all, the index.md file gets a response without error.

Happens with all models. And as soon as I add a second filter rule, the error returns.

Operating System

MacOS (Arm)

IDE and Version

VS Code 1.97.2

Extension and Version

Continue v1.0.1

Provider

Other

Model

Any

Codegate version

v0.1.26

Logs

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions