feat(ai-core): trace instrumentation, LLM thinker, decay scheduler
Cyrene CI / backend (push) Has been cancelled
Cyrene CI / frontend (push) Has been cancelled

- orchestrator: Tracer interface with spans for intent analysis, persona,
  subsession dispatch, context build, LLM streaming and each tool call;
  traces finish when the stream completes — the admin Trace waterfall
  finally receives data
- background: Thinker generates real LLM thoughts (post-chat + silence
  triggers, recent history as context, empty/overlong outputs discarded);
  thoughts broadcast to web clients as 'thinking' WS messages; pipeline
  postChatHook triggers post-chat thinking after each round
- memory: ApplyDecayAll + ListUserIDs with a 6h decay/purge cron in main
  (was implemented but never scheduled)
This commit is contained in:
Aska committed 2026-08-20 20:57:27 +08:00
1 parent 8495a4b055
commit 8603839711
8 files changed
+338 -10

No files matched your search

+6
View File
@@ -40,6 +40,12 @@ func (a *traceAdapter) Recent(n int) []map[string]any {
func (a *traceAdapter) Clear() { a.Logger.Clear() }
// pipelineTracer adapts trace.Logger to orchestrator.Tracer
// (StartTrace's return value is discarded at the call site).
type pipelineTracer struct{ *tracepkg.Logger }
func (p pipelineTracer) StartTrace(id, userMsg string) { p.Logger.StartTrace(id, userMsg) }
func spanToMap(s tracepkg.Span) map[string]any {
m := map[string]any{
"name": s.Name, "label": s.Label,