2 Commits

Author SHA1 Message Date
mumu
6bef880465 refactor: align agent skills with mainstream skill bundles (#780)
* refactor: align agent skills with mainstream skill bundles

* refactor: derive default agent skills from metadata

* fix: harden skill-first compatibility

* docs: clarify strategy-facing skill terminology

* fix: stop implicit bull-trend skill layering

* fix: use bull-trend as the single implicit default skill

* fix: preserve legacy skill config compatibility

* fix: harden skill metadata compatibility
2026-03-20 15:48:31 +08:00
mumu
cddb6baeda feat: add agent strategy chat across API, bot, and web UI #minor (#367)
* feat: add agent strategy chat across API, bot, and web UI #minor
- add /api/v1/agent endpoints for strategies and streaming chat
- route pipeline to agent mode when specific skills are configured
- persist multi-turn conversation history in database
- add web chat page, bot /ask command, built-in strategies, and tests

* fix(agent): improve session handling, progress messaging, and chat type safety #patch

Generate UUID session IDs for stream chat requests and use running loop API.

Persist user messages even on failed runs, and store assistant error notes for context continuity.

Add contextual thinking messages after tool calls in agent executor.

Fix strategy display name lookup in bot ask command.

Refine ChatPage TypeScript types and error handling for SSE parsing.

Use SQLAlchemy select+execute for conversation history query.

* docs: add Agent strategy chat to README and CHANGELOG #skip

* fix(tests): update strategy count assertions 6->11; clean up CHANGELOG [Unreleased] section #patch

* chore: update readme and fix unitest

* feat: optimize tools

* fix: Fix hard-coded test values and resolve nested mapping in Dashboard

* update changelog

* refactor(agent): extract shared factory, cache ToolRegistry/SkillManager, fix Gemini model name

* - CRITICAL: fix 4 wrong tool names in AGENT_SYSTEM_PROMPT and
  CHAT_SYSTEM_PROMPT (get_k_history→get_daily_history,
  get_technical_analysis→analyze_trend, get_chip_analysis→
  get_chip_distribution, search_news→search_stock_news)
- fix _THINKING_TOOL_LABELS: update 7 stale keys, add calculate_ma
  and get_analysis_context (13 tools now fully mapped)
- add isinstance(dict) guard in _parse_dashboard to reject non-dict
  JSON (arrays, scalars) that would crash downstream dict access
- use getattr() for config.agent_skills in pipeline.py (AttributeError safety)
- move  to top-level, remove unused imports (get_config,
  Callable, Any/Dict/Optional)
- add phased workflow directives to both system prompts to enforce
  sequential tool calling across analysis stages
- expand .env.example AGENT_SKILLS with all 11 built-in strategies
  and usage examples
- fix factory.py docstring referencing non-existent comprehensive_analysis
2026-02-23 13:24:01 +08:00