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
- Open
router/main.py.
- Locate
detect_active_tool (around line 964).
- 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
Location
router/main.py(insidedetect_active_toolloop block, lines 964-968)Problem Description
In the function
detect_active_tool, the variable assignmentfn = tc.get("function")and its sub-block are improperly indented at the same level as the parentifstatement. This introduces a fatal PythonIndentationError, preventing the service from compiling or executing when backtracking assistant tool histories.Fix Overview
Indent the inner function-resolution logic inside the
tool_call_idmatch block.Proposed Implementation Steps
router/main.py.detect_active_tool(around line 964).Code Example / Diff