mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 16:26:57 +08:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user