agent-Specialization/server
JOJO e2bbd767f7 feat(host-security+ui): unify host execution/approval behavior, runtime notices, and approval overlay UX
This commit consolidates a large set of host-mode security and UX fixes across backend and frontend.

Security / execution model:
- Make permission/execution mode switches apply immediately (no deferred pending-only behavior).
- Keep runtime mode change notices durable and visible via user-message guidance path.
- Add explicit runtime message source taxonomy support and persistence:
  user / presend / guidance / notify / sub_agent / background_command.
- Ensure guidance/notify insertion is batched per tool-cycle so mid-run inserts are committed together.
- Separate notify from guidance semantics for mode-change notices.
- Add direct-mode auto-fallback handling visibility on frontend.

Approval and command gating:
- Align run_command approval pre-check logic with docker behavior for approval/auto_approval modes in host execution paths.
- Keep approval retry flow and final-result semantics intact when permission errors trigger approval.
- Externalize forbidden command keyword list into JSON config:
  config/forbidden_commands.json.
- Update forbidden command rejection message to user-facing wording:
  用户不允许执行包含“... ”的指令.

Prompt/runtime guidance:
- Refine execution-mode runtime rule text to avoid endless workaround loops:
  one safe alternative first, then request switching to direct mode when truly required.

Chat rendering / message UX:
- Prevent injected guidance/notify user-messages from incorrectly triggering assistant work header/timer chain.
- Restore correct visibility after history reload while preserving runtime-source behavior.
- Update user-header icon/label rendering by message source:
  - guidance -> 引导 + navigation icon
  - notify/sub_agent/background_command -> 通知 + bell icon
  - user/presend -> keep normal user header.
- Add new icons: static/icons/navigation.svg, static/icons/bell.svg.

Approval panel UX:
- Convert desktop approval panel from layout-compress sidebar to overlay + blur sheet.
- Fix panel transition behavior (remove unintended vertical motion; use dedicated desktop overlay transition).
- Improve approval result display:
  - decision and reason split lines,
  - green/red status styling,
  - multiline reason rendering,
  - auto-collapse delay adjusted to 3s.

Execution mode TTL feedback:
- When direct mode auto-expires to sandbox, frontend menu state is updated from status snapshot.
- Show non-auto-dismiss warning toast to explicitly notify auto-fallback.

Misc consistency updates:
- Execution mode label text cleanup in composer.
- Runtime notice wording normalization (权限模式修改为..., 执行环境修改为...).

Build/test notes:
- Frontend rebuilt after UI changes.
- Smoke tests passed for server refactor path.
2026-05-12 19:16:38 +08:00
..
__init__.py refactor: split web_server into modular architecture 2026-01-22 09:21:53 +08:00
admin.py feat: add MCP management and host-only runtime policy 2026-04-26 23:49:04 +08:00
api_auth.py feat: add api admin ui and container status fix 2026-01-25 10:49:52 +08:00
api_v1.py feat: add json-based extensible model registry and dynamic model UI 2026-04-09 20:56:54 +08:00
app_legacy.py feat: add json-based extensible model registry and dynamic model UI 2026-04-09 20:56:54 +08:00
app.py refactor: split web_server into modular architecture 2026-01-22 09:21:53 +08:00
auth_helpers.py fix: persist onboarding prompt status and bump android app to 1.0.20 2026-04-07 20:08:33 +08:00
auth.py feat: add host workspace manager, mcp-tool-config skill, and UI enhancements 2026-04-28 13:04:51 +08:00
chat_flow_helpers.py fix: 修复轮询机制下对话标题不自动更新的问题 2026-04-04 15:12:18 +08:00
chat_flow_runner_helpers.py refactor: split terminal and server chat flow modules 2026-03-07 18:38:30 +08:00
chat_flow_runner.py refactor: further split runner and tools mixins 2026-03-07 20:25:58 +08:00
chat_flow_runtime.py refactor: further split runner and tools mixins 2026-03-07 20:25:58 +08:00
chat_flow_stream_loop.py fix(stream): prevent tool-call argument leakage into text chunks 2026-04-03 16:09:29 +08:00
chat_flow_task_main.py feat(host-security+ui): unify host execution/approval behavior, runtime notices, and approval overlay UX 2026-05-12 19:16:38 +08:00
chat_flow_task_runner.py refactor: isolate chat task main pipeline module 2026-03-07 20:32:02 +08:00
chat_flow_task_support.py feat: add user turn tool protection to shallow compression 2026-04-12 18:48:08 +08:00
chat_flow_tool_loop.py feat(host-security+ui): unify host execution/approval behavior, runtime notices, and approval overlay UX 2026-05-12 19:16:38 +08:00
chat_flow.py feat: complete conversation versioning UX and restore workflow 2026-04-11 16:16:40 +08:00
chat.py feat(host-security+ui): unify host execution/approval behavior, runtime notices, and approval overlay UX 2026-05-12 19:16:38 +08:00
context.py feat: add host workspace manager, mcp-tool-config skill, and UI enhancements 2026-04-28 13:04:51 +08:00
conversation_stats.py fix: repair admin monitor auth and add invite CRUD 2026-04-07 18:23:09 +08:00
conversation.py fix(prompt): merge disabled-tool notice into leading system prompts 2026-05-09 18:56:49 +08:00
deep_compression.py fix(prompt): merge disabled-tool notice into leading system prompts 2026-05-09 18:56:49 +08:00
extensions.py refactor: split web_server into modular architecture 2026-01-22 09:21:53 +08:00
files.py refactor: split web_server into modular architecture 2026-01-22 09:21:53 +08:00
monitor.py refactor: split web_server into modular architecture 2026-01-22 09:21:53 +08:00
security.py feat: add api v1 bearer auth and polling docs 2026-01-24 02:35:07 +08:00
socket_handlers.py feat: add json-based extensible model registry and dynamic model UI 2026-04-09 20:56:54 +08:00
state.py feat: add MCP management and host-only runtime policy 2026-04-26 23:49:04 +08:00
status.py fix(prompt): merge disabled-tool notice into leading system prompts 2026-05-09 18:56:49 +08:00
tasks.py feat(host-security+ui): unify host execution/approval behavior, runtime notices, and approval overlay UX 2026-05-12 19:16:38 +08:00
usage.py refactor: split web_server into modular architecture 2026-01-22 09:21:53 +08:00
utils_common.py fix(prompt): merge disabled-tool notice into leading system prompts 2026-05-09 18:56:49 +08:00