Files
beaver_project/docs/superpowers/plans/2026-06-04-auto-accept-on-new-topic.md
steven_li 2c5205b06e 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功能
2026-06-05 11:46:40 +08:00

2.8 KiB

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:

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:

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:

uv run pytest -q tests/unit/test_main_agent_router.py

Expected: all router tests pass.

Task 4: Regression Verification

Files:

  • Verify only

  • Run:

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.