This commit bundles a coordinated fix set across frontend and backend runtime flows:\n\n1) Markdown table overflow UX\n- Wrap rendered markdown tables in a dedicated horizontal-scroll container.\n- Preserve wrapper attributes through sanitize so styles always apply.\n- Keep page-level horizontal scroll disabled while allowing in-container table scroll.\n- Improve table container visual consistency (border/radius/shadow/scrollbar behavior).\n\n2) Code block horizontal jitter\n- Adjust code/pre scrollbar gutter and box model handling to remove left-right jump.\n\n3) Execution mode auto-fallback sync + toast behavior\n- Add expiry-driven frontend sync timer for direct->sandbox fallback state refresh.\n- Ensure permission/execution UI state updates at expiry time.\n- Keep fallback warning toast persistent but avoid false-positive toasts when simply switching to sandbox conversations.\n- Trigger fallback toast only when a real direct-expiry transition is detected.\n\n4) Runtime guidance/notify display consistency\n- Unify live polling rendering behavior with history replay behavior.\n- Restore real-time display of guidance/notify/sub-agent/background-command messages.\n- Keep runtime_mode_notice hidden only in idle state as requested.\n\n5) Backend runtime notice emission policy\n- Suppress runtime mode notice insertion when no task is running (idle path).\n- Preserve notice injection when task is actively running.\n\n6) Tool-call ordering safety for injected completion notices\n- Delay inline sub-agent/background-command completion message insertion until all parallel tool calls in the same assistant turn are finished.\n- Prevent invalid assistant/tool_call ordering that causes provider 400 errors for missing tool_call_id responses.\n\n7) Left panel scrolling behavior\n- Enable vertical scrolling for project files / todo / sub-agent / background-command panels.\n- Hide panel scrollbars while preserving scroll capability.\n\n8) Tavily multi-key selection support\n- Introduce config/search.py with selectable env variable name for Tavily key resolution.\n- Keep existing AGENT_TAVILY_API_KEY naming compatible.\n- Export search config through config package.\n\n9) Dedicated conversation-title model config\n- Add AGENT_TITLE_API_BASE_URL / AGENT_TITLE_API_KEY / AGENT_TITLE_MODEL_ID.\n- Route title generation calls to these dedicated credentials/model with fallback defaults.\n\n10) Supporting updates\n- Update .env.example to document new Tavily and title-generation env vars.\n- Include current custom model profile tweak (kimi-k2.6).\n\nValidated with:\n- npm run build\n- python3 -m py_compile (affected backend/config modules)\n- python3 -m unittest test.test_server_refactor_smoke
76 lines
2.9 KiB
Plaintext
76 lines
2.9 KiB
Plaintext
# === API Keys ===============================================================
|
||
# 基础推理模型(必填)
|
||
AGENT_API_BASE_URL=https://api.example.com
|
||
AGENT_API_KEY=your-api-key
|
||
AGENT_MODEL_ID=deepseek-chat
|
||
|
||
# 智能思考模型(可选,留空则回退到基础模型)
|
||
AGENT_THINKING_API_BASE_URL=
|
||
AGENT_THINKING_API_KEY=
|
||
AGENT_THINKING_MODEL_ID=
|
||
|
||
# 对话标题生成模型(可选,留空则回退到基础推理模型)
|
||
AGENT_TITLE_API_BASE_URL=
|
||
AGENT_TITLE_API_KEY=
|
||
AGENT_TITLE_MODEL_ID=
|
||
|
||
# 第三方搜索(可选)
|
||
AGENT_TAVILY_API_KEY=
|
||
AGENT_TAVILY_API_KEY_2=
|
||
AGENT_TAVILY_API_KEY_BACKUP=
|
||
# 使用哪个 Tavily 环境变量请在 config/search.py 里改 TAVILY_API_KEY_ENV_NAME
|
||
|
||
# 每轮最大响应 token(可选)
|
||
AGENT_DEFAULT_RESPONSE_MAX_TOKENS=32768
|
||
|
||
# === 管理员账户 ===============================================================
|
||
# 使用 `python - <<'PY' ... generate_password_hash` 生成哈希
|
||
AGENT_ADMIN_USERNAME=admin
|
||
AGENT_ADMIN_PASSWORD_HASH=
|
||
|
||
# === Web Session =============================================================
|
||
WEB_SECRET_KEY=replace-with-random-hex
|
||
|
||
# === 终端容器沙箱 =============================================================
|
||
# 模式:docker / host
|
||
TERMINAL_SANDBOX_MODE=docker
|
||
# 宿主机模式工作区配置(JSON 文件)
|
||
HOST_WORKSPACES_FILE=./config/host_workspaces.json
|
||
# 容器镜像及挂载路径
|
||
TERMINAL_SANDBOX_IMAGE=python:3.11-slim
|
||
TERMINAL_SANDBOX_MOUNT_PATH=/workspace
|
||
TERMINAL_SANDBOX_SHELL=/bin/bash
|
||
# 资源与网络限制
|
||
TERMINAL_SANDBOX_NETWORK=bridge
|
||
TERMINAL_SANDBOX_CPUS=0.5
|
||
TERMINAL_SANDBOX_MEMORY=1g
|
||
# 附加绑定目录(逗号分隔,可留空)
|
||
TERMINAL_SANDBOX_BINDS=
|
||
# 运行时路径及容器名称前缀
|
||
TERMINAL_SANDBOX_BIN=docker
|
||
TERMINAL_SANDBOX_NAME_PREFIX=agent-term
|
||
# 启动失败时是否强制报错(建议 1;当前实现中 docker 失败会直接报错)
|
||
TERMINAL_SANDBOX_REQUIRE=0
|
||
# 宿主机执行环境默认模式:sandbox / direct(建议 sandbox)
|
||
HOST_EXECUTION_MODE_DEFAULT=sandbox
|
||
# direct 模式自动回退秒数:600=10分钟,0 或 -1 表示不自动回退
|
||
HOST_EXECUTION_DIRECT_TTL_SECONDS=600
|
||
# macOS 宿主机沙箱:额外可写白名单路径(逗号分隔,默认仅工作区+/tmp)
|
||
HOST_SANDBOX_MACOS_WRITABLE_PATHS=
|
||
# 注入到容器的额外环境变量(以 TERMINAL_SANDBOX_ENV_* 命名)
|
||
# 例如:TERMINAL_SANDBOX_ENV_HTTP_PROXY=http://127.0.0.1:7890
|
||
|
||
# === 资源控制 ================================================================
|
||
PROJECT_MAX_STORAGE_MB=2048
|
||
MAX_ACTIVE_USER_CONTAINERS=8
|
||
|
||
# === MCP 工具扩展(可选) =====================================================
|
||
# 1=启用,0=禁用
|
||
MCP_TOOLS_ENABLED=1
|
||
# MCP 服务配置文件路径(默认 data/mcp_servers.json)
|
||
MCP_SERVERS_FILE=./data/mcp_servers.json
|
||
# MCP 协议版本(默认 2025-06-18)
|
||
MCP_PROTOCOL_VERSION=2025-06-18
|
||
# MCP 默认超时(秒)
|
||
MCP_DEFAULT_TIMEOUT_SECONDS=25
|