Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danbarr opened this issue Mar 3, 2025 · 0 comments
Open

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

danbarr opened this issue Mar 3, 2025 · 0 comments
Labels

Comments

@danbarr
Copy link
Contributor

danbarr commented Mar 3, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants