Skip to content

[CRIT-01] Indentation Error in Active Tool Detection Mechanism #38

Description

@sheepdestroyer

Location

router/main.py (inside detect_active_tool loop block, lines 964-968)

Problem Description

In the function detect_active_tool, the variable assignment fn = tc.get("function") and its sub-block are improperly indented at the same level as the parent if statement. This introduces a fatal Python IndentationError, preventing the service from compiling or executing when backtracking assistant tool histories.

Fix Overview

Indent the inner function-resolution logic inside the tool_call_id match block.

Proposed Implementation Steps

  1. Open router/main.py.
  2. Locate detect_active_tool (around line 964).
  3. Indent lines 965-968 with 4 spaces.

Code Example / Diff

@@ -964,5 +964,5 @@
                                     if isinstance(tc, dict) and tc.get("id") == tool_call_id:
-                                    fn = tc.get("function")
-                                    if isinstance(fn, dict):
-                                        name = fn.get("name")
-                                    break
+                                        fn = tc.get("function")
+                                        if isinstance(fn, dict):
+                                            name = fn.get("name")
+                                        break

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjulesIssues for Jules

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions