4 Commits

Author SHA1 Message Date
mumu
47f938f32d feat: add mainstream analysis strategy skills (#1332) 2026-05-17 23:02:12 +08:00
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
Mark
75896f6d05 fix(agent): include framework category in skill rendering + Docker strategies missing (#406)
* fix(agent): include framework category in skill instructions rendering

`get_skill_instructions()` only iterated over ["trend", "pattern",
"reversal"] categories, silently dropping all strategies with
`category: framework` (box_oscillation, chan_theory, wave_theory,
emotion_cycle). Add "framework" to the category map and use a
dynamic fallback so future custom categories are never lost.

Also:
- Document `AGENT_SKILLS=all` shorthand in .env.example
- Add `AGENT_SKILLS` config to README
- Add CHANGELOG entry
- Update strategies/README.md and Skill docstring with framework category

Fixes #403

* fix(docker): include strategies directory in Docker image and compose

Dockerfile was missing `COPY strategies/ ./strategies/`, and
docker-compose.yml did not mount the strategies directory, causing
all 11 built-in strategies to fail loading in containerized deployments.

---------

Co-authored-by: ma_k <ma_k@ctrip.com>
2026-02-26 20:44:24 +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