WeKnora/internal
wizardchen c578fdbad6 fix(im): isolate IM sessions per agent and recover from deleted sessions
Three bugs fixed:

1. Session cross-contamination (#1066): resolveUserSession and
   resolveThreadSession looked up ChannelSession by (platform, user_id,
   chat_id, tenant_id) without agent_id. When the same user talked to
   two bots bound to different agents under the same tenant, they shared
   a session — mixing knowledge base context. Add agent_id to all four
   WHERE clauses and update the DB unique indexes to match.

2. Swapped parameters in resolveThreadSession: the SQL expected
   (chat_id, thread_id) but Go args passed (threadID, msg.ChatID).

3. Orphaned ChannelSession crash (#1046): deleting a session from the
   WeKnora UI soft-deletes it (GORM), but the ChannelSession row
   survives because soft-delete doesn't trigger SQL ON DELETE CASCADE.
   Subsequent IM messages hit "record not found" on GetSession and the
   bot becomes permanently unresponsive. Now detect this case, recycle
   the stale mapping, and transparently create a fresh session.
2026-04-28 20:53:06 +08:00
..
agent fix(search): align rerank priority between Execute and rerankResults 2026-04-28 20:23:57 +08:00
application fix(wiki): Lite ingest lock, failed-op requeue, sync task retry parity 2026-04-28 18:27:00 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
common feat: Implement deadlock retry mechanism for chunk creation 2026-04-22 21:17:21 +08:00
config feat: Introduce agent type presets for smart-reasoning mode 2026-04-22 21:18:20 +08:00
container fix(container): aggregate registration errors in connector registry initialization 2026-04-28 20:02:13 +08:00
database fix: update environment configuration for debugging and logging, enhance SQLite FTS5 table management, and improve API base URL handling 2026-04-11 18:51:16 +08:00
datasource feat(observability): extend Langfuse tracing across asynq pipeline 2026-04-24 13:16:47 +08:00
errors feat: Add agent configuration and cleanup scripts for database migrations 2025-11-05 23:18:44 +08:00
event fix: improve tenant access token logging and update test cases 2026-04-22 21:17:30 +08:00
handler fix(agent): improve tenant context handling and error reporting 2026-04-24 22:40:57 +08:00
im fix(im): isolate IM sessions per agent and recover from deleted sessions 2026-04-28 20:53:06 +08:00
infrastructure feat: Add pending tasks and active status to WikiStats 2026-04-22 21:17:31 +08:00
logger feat(observability): integrate Langfuse for LLM token tracking and tracing 2026-04-24 10:29:19 +08:00
mcp feat(mcp): implement reconnection logic for MCP tool calls and tool listing 2026-03-31 11:57:15 +08:00
middleware refactor: Update wiki prompts and ingestion logic for improved content handling 2026-04-22 21:17:31 +08:00
models feat(observability): integrate Langfuse for LLM token tracking and tracing 2026-04-24 10:29:19 +08:00
router fix(wiki): Lite ingest lock, failed-op requeue, sync task retry parity 2026-04-28 18:27:00 +08:00
runtime init commit 2025-08-05 15:08:07 +08:00
sandbox feat: optimize security and deployment of agent skills 2026-02-04 20:08:49 +08:00
searchutil feat(prompt): enhance question rewriting and intent classification in prompt templates 2026-04-16 23:15:02 +08:00
stream feat(redis): add REDIS_USERNAME support for Redis ACL 2026-02-04 19:38:40 +08:00
tracing feat(observability): extend Langfuse tracing across asynq pipeline 2026-04-24 13:16:47 +08:00
types feat: enhance Scan method in RetrieverEngines to support legacy and current formats 2026-04-28 17:21:56 +08:00
utils feat(models): support custom HTTP headers across all remote model calls 2026-04-23 23:36:40 +08:00