fix: recreate stale WeKnora sessions once

This commit is contained in:
姚章浩
2026-08-13 12:34:05 +08:00
parent 357e9bad5c
commit 5c35a49486
5 changed files with 171 additions and 38 deletions
+5
View File
@@ -176,6 +176,11 @@ func (s *Store) SyncSessionTitle(ctx context.Context, mapping core.SessionMappin
return tx.Commit(ctx)
}
func (s *Store) InvalidateSession(ctx context.Context, sessionKey, expectedSessionID string) error {
_, err := s.pool.Exec(ctx, `DELETE FROM session_mappings WHERE session_key=$1 AND weknora_session_id=$2`, sessionKey, expectedSessionID)
return err
}
func (s *Store) FinishTurn(ctx context.Context, turn core.Turn) error {
references, err := json.Marshal(turn.References)
if err != nil {