Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
e0293048
Commit
e0293048
authored
Mar 18, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FuzzyToolBreaker from coder CLI - now only in coderai server
parent
9013e23c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
32 deletions
+14
-32
coder
coder
+14
-32
No files found.
coder
View file @
e0293048
...
@@ -26,9 +26,6 @@ from datetime import datetime
...
@@ -26,9 +26,6 @@ from datetime import datetime
import
requests
import
requests
# Import FuzzyToolBreaker for circuit breaker functionality
from
codai.models.utils
import
FuzzyToolBreaker
# ANSI color codes
# ANSI color codes
class
Colors
:
class
Colors
:
...
@@ -541,8 +538,6 @@ class CoderClient:
...
@@ -541,8 +538,6 @@ class CoderClient:
self
.
session_manager
=
session_manager
self
.
session_manager
=
session_manager
self
.
session_name
:
Optional
[
str
]
=
None
self
.
session_name
:
Optional
[
str
]
=
None
self
.
input_history
:
List
[
str
]
=
[]
# Track user inputs for readline
self
.
input_history
:
List
[
str
]
=
[]
# Track user inputs for readline
# Initialize circuit breaker for detecting repetitive tool calls
self
.
tool_breaker
=
FuzzyToolBreaker
(
threshold
=
2
,
debug
=
self
.
config
.
debug
)
def
chat
(
self
,
message
:
str
,
stream
:
bool
=
True
)
->
str
:
def
chat
(
self
,
message
:
str
,
stream
:
bool
=
True
)
->
str
:
"""Send a message to the API and get response."""
"""Send a message to the API and get response."""
...
@@ -1000,12 +995,6 @@ class CoderClient:
...
@@ -1000,12 +995,6 @@ class CoderClient:
# Show tool call with colors: yellow "Calling tool:", red tool name, white args
# Show tool call with colors: yellow "Calling tool:", red tool name, white args
print
(
f
"
\n
{Colors.YELLOW}Calling tool:{Colors.RESET} {Colors.RED}{tool_name}{Colors.RESET} -> {args_str}"
)
print
(
f
"
\n
{Colors.YELLOW}Calling tool:{Colors.RESET} {Colors.RED}{tool_name}{Colors.RESET} -> {args_str}"
)
# Check circuit breaker first
should_stop
,
stop_message
=
self
.
tool_breaker
.
check
(
tool_name
,
arguments
)
if
should_stop
:
print
(
f
"{Colors.RED}{stop_message}{Colors.RESET}"
)
result
=
{
"error"
:
stop_message
,
"stopped_by_breaker"
:
True
}
else
:
# Check if confirmation is needed
# Check if confirmation is needed
needs_confirm
=
self
.
config
.
confirm_all
needs_confirm
=
self
.
config
.
confirm_all
if
tool_name
in
self
.
config
.
confirm_commands
:
if
tool_name
in
self
.
config
.
confirm_commands
:
...
@@ -1109,15 +1098,8 @@ class CoderClient:
...
@@ -1109,15 +1098,8 @@ class CoderClient:
except
json
.
JSONDecodeError
:
except
json
.
JSONDecodeError
:
arguments
=
{}
arguments
=
{}
# Check circuit breaker first
should_stop
,
stop_message
=
self
.
tool_breaker
.
check
(
tool_name
,
arguments
)
if
should_stop
:
print
(
f
"{Colors.RED}{stop_message}{Colors.RESET}"
)
result
=
{
"error"
:
stop_message
,
"stopped_by_breaker"
:
True
}
else
:
print
(
f
" → {tool_name}({arguments})"
)
print
(
f
" → {tool_name}({arguments})"
)
result
=
self
.
tool_executor
.
execute
(
tool_name
,
arguments
)
result
=
self
.
tool_executor
.
execute
(
tool_name
,
arguments
)
tool_results
.
append
({
tool_results
.
append
({
"tool_call_id"
:
tc
[
'id'
],
"tool_call_id"
:
tc
[
'id'
],
"role"
:
"tool"
,
"role"
:
"tool"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment