feat: 添加MinIO文件系统支持并优化外部连接器功能

- 添加MinIO用户文件系统配置选项(BEAVER_MINIO_ROOT_USER等)
- 更新外部连接器配置结构,包括BASE_URL和认证令牌设置
- 改进connector provider支持更多类型(official, feishu_bot等)
- 实现Mistral模型推理模式支持reasoning_effort参数
- 增强外部连接器策略配置和运行时配置管理
- 添加connector bridge事件验证和安全保护机制
- 优化任务路由逻辑,区分simple_chat和new_task场景
- 更新初始技能工具提示配置,分离authoring admin功能
This commit is contained in:
2026-06-05 11:46:40 +08:00
parent 236ac19789
commit 2c5205b06e
120 changed files with 8321 additions and 1865 deletions

View File

@ -0,0 +1,73 @@
# Auto-Accept on New Topic Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Silently accept an awaiting Task before processing an unrelated new topic.
**Architecture:** Keep the existing Intent Agent actions. Treat `simple_chat` and `new_task` decisions made while a Task is active as new-topic boundaries, reuse `submit_acceptance()` for the old Task's latest run, and then continue the original routing decision.
**Tech Stack:** Python, pytest, Beaver TaskService and AgentService
---
### Task 1: Lock the State Transition with Tests
**Files:**
- Modify: `app-instance/backend/tests/unit/test_task_mode_feedback.py`
- [ ] Add a failing test proving an unrelated `simple_chat` message formally accepts the previous Task and does not append another run to it.
- [ ] Add a failing test proving `new_task` formally accepts the previous Task before creating a separate Task.
- [ ] Add tests proving `continue_task` and `revise_task` retain the existing active Task behavior.
- [ ] Run:
```bash
uv run pytest -q tests/unit/test_task_mode_feedback.py
```
Expected before implementation: the new-topic tests fail because the previous Task remains `awaiting_acceptance`.
### Task 2: Implement New-Topic Auto-Accept
**Files:**
- Modify: `app-instance/backend/beaver/services/agent_service.py`
- [ ] Add a focused async helper that accepts only an `awaiting_acceptance` Task with a latest run.
- [ ] Call the helper after routing when the decision is `simple_chat` or starts a new Task.
- [ ] Reuse `submit_acceptance()` so acceptance history, final accepted run, run memory, and learning behavior remain consistent.
- [ ] Run:
```bash
uv run pytest -q tests/unit/test_task_mode_feedback.py
```
Expected: all task-mode feedback tests pass.
### Task 3: Clarify Intent Routing Guidance
**Files:**
- Modify: `app-instance/backend/beaver/tasks/router.py`
- Modify: `app-instance/backend/beaver/skills/builtin/intent-agent-router/SKILL.md`
- Modify: `app-instance/backend/tests/unit/test_main_agent_router.py`
- [ ] Assert the generated routing prompt explicitly says unrelated lightweight conversation is `simple_chat`, not `revise_task`.
- [ ] Update both routing guidance sources with the same rule and examples.
- [ ] Run:
```bash
uv run pytest -q tests/unit/test_main_agent_router.py
```
Expected: all router tests pass.
### Task 4: Regression Verification
**Files:**
- Verify only
- [ ] Run:
```bash
uv run pytest -q tests/unit/test_main_agent_router.py tests/unit/test_task_mode_feedback.py tests/unit/test_active_task_api.py tests/unit/test_process_projection.py
```
- [ ] Inspect the final diff to confirm no frontend confirmation or unrelated state changes were introduced.

View File

@ -0,0 +1,75 @@
# Chat Task Timeline Consistency Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Render the active Task's canonical timeline in the chat progress sidebar and hide it when no active Task exists.
**Architecture:** Extract task-scoped process filtering into a shared frontend helper, use it in both Task detail and chat, and make the chat sidebar a responsive wrapper around the existing `TaskTimeline` component.
**Tech Stack:** React, Next.js, TypeScript, Vitest
---
### Task 1: Extract Shared Task Process Selection
**Files:**
- Create: `app-instance/frontend/lib/task-process.ts`
- Create: `app-instance/frontend/lib/task-process.test.ts`
- Modify: `app-instance/frontend/app/(app)/tasks/[taskId]/page.tsx`
- [ ] Write failing tests for merging persisted task process data with matching live process data.
- [ ] Implement `selectTaskProcess()` returning task-scoped runs, events, and artifacts.
- [ ] Replace the Task detail page's local filtering with the shared helper.
- [ ] Run:
```bash
npm test -- --run lib/task-process.test.ts lib/task-timeline.test.ts
```
### Task 2: Replace Chat Progress View with Task Timeline
**Files:**
- Modify: `app-instance/frontend/components/chat-workbench/CurrentSessionProgressSidebar.tsx`
- Modify: `app-instance/frontend/app/(app)/page.tsx`
- [ ] Load full `BackendTask` detail whenever `activeTask` exists.
- [ ] Clear full Task detail whenever active Task becomes `null` or the session changes.
- [ ] Build chat timeline cards using `selectTaskProcess()` and `buildTaskTimelineCards()`.
- [ ] Change `CurrentSessionProgressSidebar` to accept timeline cards and render `TaskTimeline` without acceptance controls.
- [ ] Remove the chat page's use of `buildSessionProgressView()`.
### Task 3: Add Visibility and Consistency Tests
**Files:**
- Modify: `app-instance/frontend/lib/task-process.test.ts`
- Modify: `app-instance/frontend/lib/task-timeline.test.ts`
- Delete if unused: `app-instance/frontend/lib/session-progress.test.ts`
- Delete if unused: `app-instance/frontend/lib/session-progress.ts`
- [ ] Cover empty/no-active input behavior in the shared helper.
- [ ] Confirm the same Task/process input creates the same timeline cards on both surfaces.
- [ ] Remove the obsolete session-progress builder and tests if no imports remain.
- [ ] Run:
```bash
npm test
```
### Task 4: Frontend Verification
**Files:**
- Verify only
- [ ] Run:
```bash
npm run typecheck
npm run build
```
- [ ] Validate the rendered chat flow with Playwright because the Browser plugin is not available:
```text
chat page with active Task -> open current-session progress -> same timeline cards as Task detail
Task closes -> current-session progress disappears
```

View File

@ -0,0 +1,104 @@
# Initial Multi Search Engine Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Replace the initial `web-operation` skill with SkillHub `multi-search-engine` while keeping `web_fetch` reliably available when the skill is selected.
**Architecture:** Initial skills are copied from the repository `skills/` directory into each instance workspace by `create-instance.sh` and `entrypoint.sh`. This change updates the seed catalog, not existing user workspace state.
**Tech Stack:** Python skill catalog storage, JSON seed metadata, Markdown `SKILL.md`, pytest.
---
### Task 1: Update Initial Skill Contract
**Files:**
- Modify: `app-instance/backend/tests/unit/test_initial_skill_tool_hints.py`
- [ ] **Step 1: Write the failing test**
Change `EXPECTED_INITIAL_SKILL_TOOLS` so it expects:
```python
"multi-search-engine": ["web_fetch"],
```
and no longer expects:
```python
"web-operation": ["web_fetch", "web_search"],
```
- [ ] **Step 2: Run test to verify it fails**
Run:
```bash
cd app-instance/backend
pytest tests/unit/test_initial_skill_tool_hints.py -q
```
Expected: FAIL because `skills/multi-search-engine/versions/v0001/SKILL.md` does not exist yet.
### Task 2: Replace Seed Skill
**Files:**
- Create: `skills/multi-search-engine/current.json`
- Create: `skills/multi-search-engine/skill.json`
- Create: `skills/multi-search-engine/versions/v0001/SKILL.md`
- Create: `skills/multi-search-engine/versions/v0001/version.json`
- Create: `skills/multi-search-engine/versions/v0001/CHANGELOG.md`
- Create: `skills/multi-search-engine/versions/v0001/CHANNELLOG.md`
- Create: `skills/multi-search-engine/versions/v0001/config.json`
- Create: `skills/multi-search-engine/versions/v0001/metadata.json`
- Create: `skills/multi-search-engine/versions/v0001/references/advanced-search.md`
- Create: `skills/multi-search-engine/versions/v0001/references/international-search.md`
- Modify: `skills/_index/published.json`
- [ ] **Step 1: Add SkillHub content**
Fetch `global/multi-search-engine@20260413.065325` from SkillHub and store it as seed version `v0001`.
- [ ] **Step 2: Add tool hint**
Ensure `SKILL.md` frontmatter contains:
```yaml
tools:
- web_fetch
```
- [ ] **Step 3: Update published index**
Remove `web-operation` and add `multi-search-engine`.
### Task 3: Verify
**Files:**
- Test: `app-instance/backend/tests/unit/test_initial_skill_tool_hints.py`
- [ ] **Step 1: Run targeted tests**
Run:
```bash
cd app-instance/backend
pytest tests/unit/test_initial_skill_tool_hints.py tests/unit/test_marketplace_and_mcp.py -q
```
Expected: PASS.
- [ ] **Step 2: Inspect seed metadata**
Run:
```bash
python - <<'PY'
import json
from pathlib import Path
print(json.loads(Path('skills/_index/published.json').read_text())['items'])
print(json.loads(Path('skills/multi-search-engine/versions/v0001/version.json').read_text())['tool_hints'])
PY
```
Expected: `multi-search-engine` is published, `web-operation` is absent, and tool hints are `["web_fetch"]`.

View File

@ -0,0 +1,60 @@
# Auto-Accept Task When a New Topic Starts
## Goal
Prevent unrelated follow-up conversation from being appended to the previous
Task. When the Intent Agent decides that the user's current message starts a
new topic, Beaver should silently accept the previous Task before processing
the current message.
## User Experience
- No confirmation dialog or extra assistant message is shown.
- A related follow-up or requested change continues the existing Task.
- An unrelated lightweight message is handled as `simple_chat`.
- Unrelated work that needs Task capabilities is handled as `new_task`.
- Before either new-topic path continues, the previous Task is formally
accepted.
## Routing Rules
The existing Intent Agent actions remain unchanged:
- `continue_task` and `revise_task` belong to the active Task.
- `close_task` and `abandon_task` keep their existing explicit semantics.
- With an active Task, `simple_chat` means an unrelated lightweight new topic.
- With an active Task, `new_task` means unrelated work that needs a separate
Task.
The Intent Agent guidance must explicitly distinguish unrelated lightweight
conversation from revisions. A message must not be classified as
`revise_task` merely because an active Task is awaiting acceptance.
## State Transition
Before processing a `simple_chat` or `new_task` decision:
1. Check whether the active Task is `awaiting_acceptance`.
2. Find its latest completed run.
3. Record a normal `accept` acceptance against that run.
4. Continue processing the current message using the original routing
decision.
The normal acceptance path must be reused so that the Task becomes `closed`,
`final_accepted_run_id` is recorded, acceptance events are persisted, run
memory is updated, and skill-learning candidates can be generated.
Tasks without an acceptance-eligible completed run are left unchanged. Router
failures retain the existing conservative `continue_task` fallback and must
not auto-accept a Task.
## Testing
Backend tests must cover:
- An unrelated `simple_chat` message accepts the previous Task and is not
appended as another Task run.
- A `new_task` decision accepts the previous Task and creates a separate Task.
- `continue_task` and `revise_task` do not auto-accept the active Task.
- Router failure fallback does not auto-accept the active Task.
- Auto-accept records the final accepted run and normal acceptance history.

View File

@ -0,0 +1,59 @@
# Chat Current-Task Timeline Consistency
## Goal
Make the chat page's current-session progress panel show the same timeline
content as the active Task's detail page.
## Visibility
- Show the chat-side timeline only while the current session has an active
Task.
- Hide the panel immediately when the Task is accepted, auto-accepted,
abandoned, closed, or when the user switches sessions.
- Do not show the most recently completed Task after it is no longer active.
## Shared Data Model
The Task detail page remains the canonical timeline behavior.
Both surfaces must:
1. Load the full `BackendTask` payload from `/api/tasks/{task_id}`.
2. Combine the task's persisted process data with matching live process data.
3. Use one shared task-process filtering helper.
4. Build cards with `buildTaskTimelineCards()`.
5. Render cards with `TaskTimeline`.
This keeps card types, ordering, fallback milestones, result history,
acceptance history, tool status, and deduplication consistent.
## Chat Panel
`CurrentSessionProgressSidebar` becomes a responsive wrapper around
`TaskTimeline`.
- Desktop keeps the existing right sidebar.
- Smaller viewports keep the existing floating open button and drawer.
- The panel title remains "当前会话的运行进度".
- Timeline cards match the Task detail timeline.
- Chat does not render duplicate acceptance controls inside the sidebar,
because acceptance controls already exist on chat result messages.
## Data Refresh
- Whenever the active Task changes, the chat page loads its full Task detail.
- Existing message, process, feedback, and WebSocket refresh paths reload both
the active Task identity and its full detail.
- If the active-task endpoint returns `null`, the cached active Task detail is
cleared immediately and the sidebar disappears.
- A task-detail load failure hides the sidebar rather than showing stale data.
## Testing
- Shared process filtering returns the same task-scoped runs, events, and
artifacts for both surfaces.
- The chat-side timeline cards are produced by `buildTaskTimelineCards()`.
- No active Task produces no chat-side timeline.
- Switching to a closed/no-active Task clears the chat-side timeline.
- Frontend unit tests, typecheck, and production build pass.