fix(shell): separate wait, idle, and runtime limits (#6228)
* fix(shell): separate wait, idle, and runtime limits * fix(shell): separate wait, idle, and runtime limits * fix(exec): preserve settings aliases and reclaim completed sessions * fix(webui): make shell runtime limits explicit
This commit is contained in:
1 parent
70ac000ad9
commit
6310a39bac
36 files changed
+2392
-564
No files matched your search
@@ -60,6 +60,9 @@ RUNTIME_CONFIG_PATHS = (
|
||||
|
||||
|
||||
def _parent(config: Config, path: str) -> tuple[BaseModel, str]:
|
||||
# Keep the existing WebUI editor on the canonical hard-runtime field.
|
||||
if path == "tools.exec.timeout":
|
||||
path = "tools.exec.max_runtime"
|
||||
parent: BaseModel = config
|
||||
*parts, leaf = path.split(".")
|
||||
for part in parts:
|
||||
@@ -128,6 +131,12 @@ def update_runtime_config(
|
||||
raise WebUISettingsError("gateway.port: must be at most 65535")
|
||||
if "api.timeout" in values and validated.api.timeout > 3600:
|
||||
raise WebUISettingsError("api.timeout: must be at most 3600 seconds")
|
||||
if "tools.exec.timeout" in values:
|
||||
limit = validated.tools.exec.max_runtime_limit
|
||||
if validated.tools.exec.max_runtime > limit:
|
||||
raise WebUISettingsError(
|
||||
f"tools.exec.timeout: enter 1–{limit} seconds, or 0 for no time limit"
|
||||
)
|
||||
for path in ("gateway.host", "api.host", "tools.image_generation.save_dir"):
|
||||
if path in values:
|
||||
parent, leaf = _parent(validated, path)
|
||||
|
||||
@@ -144,6 +144,7 @@ def system_settings_payload(
|
||||
**network_safety_payload(config),
|
||||
"mcp_server_count": len(config.tools.mcp_servers),
|
||||
"exec_enabled": exec_config.enable,
|
||||
"exec_max_runtime_limit": exec_config.max_runtime_limit,
|
||||
"exec_sandbox": exec_config.sandbox or None,
|
||||
"exec_path_prepend_set": bool(exec_config.path_prepend),
|
||||
"exec_path_append_set": bool(exec_config.path_append),
|
||||
|
||||
Reference in new issue
Block a user