Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix: add default config for tool sandbox

zhaozixuan04c658864074
diff --git a/deploy/yuanrong/conf/gateway-config-yuanrong.template.yaml b/deploy/yuanrong/conf/gateway-config-yuanrong.template.yaml
index f172b2e7b6..468a193cbb 100644
--- a/deploy/yuanrong/conf/gateway-config-yuanrong.template.yaml
+++ b/deploy/yuanrong/conf/gateway-config-yuanrong.template.yaml
@@ -377,21 +377,48 @@ react:
enable_reload: true
enabled: true
message_summary_offloader_config:
- add_message_threshold_ratio: 0.1
- ttl_seconds: 300
- ttl_context_occupancy_ratio: 0.5
- ttl_message_threshold_ratio: 0.05
+ messages_threshold: null
+ large_message_threshold: 10000
+ offload_message_type: [ "tool" ]
+ protected_tool_names: ["read_file:*SKILL.md", "reload_original_context_messages"]
+ messages_to_keep: null
+ keep_last_round: false
+ customized_summary_prompt: null
+ enable_adaptive_compression: true
+ summary_max_tokens: 900
+ enable_precise_step: false
+ step_summary_max_context_messages: 8
+ content_max_chars_for_compression: 200000
dialogue_compressor_config:
- trigger_context_ratio: 0.8
- min_target_context_ratio: 0.1
+ messages_threshold: null
+ tokens_threshold: 100000
+ messages_to_keep: 10
+ keep_last_round: false
+ compression_target_tokens: 1800
+ offload_writeback_enabled: false
current_round_compressor_config:
- trigger_context_ratio: 0.8
- min_target_context_ratio: 0.1
- keep_recent_messages: 4
+ tokens_threshold: 100000
+ messages_to_keep: 3
+ min_selected_tokens_for_compression: 20000
+ compression_target_tokens: 4000
+ summary_merge_target_tokens: 4000
+ accumulated_summary_token_limit: 20000
+ summary_merge_min_blocks: 3
+ prior_context_window_size: 10
+ offload_writeback_enabled: false
round_level_compressor_config:
- trigger_context_ratio: 0.8
- min_target_context_ratio: 0.1
- keep_recent_messages: 4
+ rounds_threshold: 2
+ trigger_context_ratio: 0.9
+ target_total_tokens: 160000
+ compression_call_max_tokens: 250000
+ keep_last_round: true
+ keep_recent_messages: 6
+ messages_to_keep: 6
+ first_pass_target_tokens: 30000
+ second_pass_target_tokens: 20000
+ third_pass_target_tokens: 10000
+ truncate_head_ratio: 0.2
+ offload_writeback_enabled: false
# Skills 在线自演进配置
evolution:
enabled: true # true = 启用在线 Skills 自演进
@@ -451,48 +478,15 @@ gateway:
# AgentClient 配置 - Gateway 连接到 AgentServer 的方式
# type: websocket(默认) | yuanrong(直接函数调用) | agentos_router(AgentOS 扩展)
agent_client:
- type: agentos_router # websocket | yuanrong | agentos_router
- # yuanrong / agentos_router 共用下面参数
+ type: yuanrong # websocket | yuanrong | agentos_router
+ # yuanrong 函数模式配置下面参数
frontend_endpoint: http://<<MASTER_NODE_IP>>:<<FRONTEND_PORT>>
function_version_urn: <<FUNCTION_ID>>
concurrency: <<GATEWAY_CONCURRENCY>>
invoke_timeout_s: <<GATEWAY_INVOKE_TIMEOUT>>
- # POST/DELETE /api/agent 超时(秒);create 含镜像拉取/容器启动,建议明显大于 invoke_timeout_s
agent_timeout_s: 300
- # create 请求的 namespace,默认 default
agent_namespace: default
- # AgentOS Router Extension 配置;agent_client.type=agentos_router 时生效。
- # 默认 agent_type=jiuwenswarm 直走 YuanRong URN invoke(与 type=yuanrong 对齐);
- # opencode/claude 走 registry launch-spec + create_sandbox。
- agentos:
- creating_timeout_seconds: 60
- # Agent 复用 key 字段,默认 user_id + agent_type。
- # 可选字段:user_id、agent_type、session_id(必须包含前两项)。
- agent_key_fields:
- - user_id
- - agent_type
- # 空闲沙箱回收:agent 无持有任务(chat/SSH 均已结束)且空闲超过该时长后,
- # 自动 DELETE /api/agent 释放 YuanRong 实例;<= 0 表示不回收。
- # 存活的 SSH 连接(即使不发消息)全程持有任务计数,不会被回收。
- # 也可通过环境变量 SANDBOX_IDLE_TIMEOUT_SECONDS 覆盖(优先于本配置)。
- sandbox_idle_timeout_seconds: 600
- # 空闲扫描周期(秒)
- sandbox_idle_check_interval_seconds: 30
- registry:
- # Agent OS 注册中心:host 来自 --hosts / CLUSTER_HOSTS 的 master IP
- endpoint: http://<<MASTER_NODE_IP>>:<<REGISTRY_PORT>>
- request_timeout_s: 10
- # 本机 nodeIP,供 POST /api/nodes/{node}/heartbeat
- node: <<MASTER_NODE_IP>>
- # SSH 南向接入 YuanRong 实例(配合 channels.ssh 北向使用):
- # ssh -p <port> 'yr:instance:<instance_id>'@<frontend-host>
- # 主机取自 agent_client.frontend_endpoint;<instance_id> 为 create agent 返回的实例 id。
- ssh:
- port: 2222
- user_template: "yr:instance:{instance}"
- connect_timeout_s: 30
-
heartbeat:
# 心跳间隔(秒),默认 3600
every: 3600
@@ -650,19 +644,6 @@ channels:
my_user_id: ""
bot_name: ""
enable_memory: false
- ssh:
- # SSH channel -> MessageHandler(北向);南向经 gateway.agent_client
- # (type=agentos_router 时由 AgentOS Router 创建 YuanRong 实例并
- # 以 yr:instance:<instance_id> 中继到 frontend)。
- # 启用前请安装可选依赖: pip install "jiuwenswarm[ssh]" 或 uv sync --extra ssh
- # 客户端: ssh -p <listen_port> user@<gateway-host>
- # 南向连接参数见 gateway.agentos.ssh;agent_type 跟随用户当前值(3rdagent.switch)。
- enabled: true
- # 监听 IP:host 来自 --hosts / CLUSTER_HOSTS 的 master IP
- listen_host: <<MASTER_NODE_IP>>
- listen_port: <<SSH_PORT>>
- host_key_path: ~/.jiuwenswarm/config/ssh_host_key
- relay_timeout_sec: 3600
# ========== 细粒度权限管控(tiered_policy)==========
#
@@ -1077,3 +1058,9 @@ modes:
# 控制记忆内容如何注入到每个成员的 system prompt 中:
# "proactive" — 每轮对话开始时主动注入最新记忆摘要
member_memory_prompt_mode: "proactive"
+
+sandbox:
+ type: <<TOOL_SANDBOX_TYPE>>
+ enabled: <<TOOL_SANDBOX_ENABLE>>
+ executor: <<TOOL_SANDBOX_EXECUTOR>>
+ image: <<TOOL_SANDBOX_IMAGE>>
\ No newline at end of file