mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-21 14:08:11 +02:00
mode agent : toggle web pour désactiver la limite d'appels d'outils (config TOOL_LIMIT)
La limite iter<8 (message [stop: trop d'appels d'outils]) est désormais pilotée par TOOL_LIMIT dans config.env, exposée par un interrupteur sous Mode agent. Activée par défaut ; désactivée => plafond quasi illimité (l'anti-boucle sur appels répétés reste actif). Lu à chaque tour, pas de restart nécessaire. Tunnelé tel quel via /api/e2e/req pour ajean.link.
This commit is contained in:
1 parent
cc24074f69
commit
5ef02672d2
4 files changed
+55
-2
No files matched your search
@@ -139,6 +139,27 @@ func SetConfigKey(key, value string) error {
|
||||
return os.WriteFile(confPath(), []byte(content), 0o644)
|
||||
}
|
||||
|
||||
// toolLimitEnabled reports whether the per-turn tool-call cap is active.
|
||||
// Default: true (limité). Only an explicit "off"/"false"/"0"/"no" in config.env
|
||||
// (TOOL_LIMIT) disables it — anything else keeps the safety cap on.
|
||||
func toolLimitEnabled() bool {
|
||||
switch strings.ToLower(strings.TrimSpace(ReadConfig()["TOOL_LIMIT"])) {
|
||||
case "off", "false", "0", "no", "non":
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// toolCallLimit returns the max number of agentic tool-call iterations per turn.
|
||||
// 8 when the limit is on (default), a very high ceiling when the user disabled it
|
||||
// from the web UI — the repeated-call anti-loop still guards against runaways.
|
||||
func toolCallLimit() int {
|
||||
if toolLimitEnabled() {
|
||||
return 8
|
||||
}
|
||||
return 1000
|
||||
}
|
||||
|
||||
// LLMPort returns the configured server port (config.env PORT), default 8080.
|
||||
func LLMPort() int {
|
||||
if p, ok := ReadConfig()["PORT"]; ok {
|
||||
|
||||
Reference in new issue
Block a user