fix: enforce tool-based data only — Agent can no longer fabricate prices

- System prompt now has absolute rule: no tool result = no price
- Pre-market overview must call search_stock for each major stock
- Index futures explicitly marked as unsupported
- Training data prices explicitly declared outdated and forbidden
- Applied to both CN and EN prompts
This commit is contained in:
shinchan-zhai
2026-03-23 09:28:06 +08:00
parent f37c63f9bb
commit 59e7e37db1
4 changed files with 61 additions and 19 deletions

View File

@@ -24,6 +24,7 @@ func (s *Scheduler) Start(ctx context.Context) {
defer ticker.Stop()
lastReport := time.Time{}
lastCheck := time.Time{}
lastCleanup := time.Time{}
for {
select {
@@ -40,6 +41,13 @@ func (s *Scheduler) Start(ctx context.Context) {
s.riskCheck()
lastCheck = now
}
// Clean stale chat history every hour (sessions idle > 24h)
if now.Sub(lastCleanup) > 1*time.Hour {
if s.agent.history != nil {
s.agent.history.CleanOld(24 * time.Hour)
}
lastCleanup = now
}
}
}
}()