fix(chat): show the sandbox container a conversation actually uses

A reporter chat bound to one task ran commands in that task's sandbox, while the chat page kept querying the empty session container. Save the task or session target on the conversation and point the badge, uploads, and later turns at it.
This commit is contained in:
ji ruo committed 2026-12-02 17:45:28 +08:00
1 parent 8bac4960e7
commit b18cf89b77
9 files changed
+531 -57

No files matched your search

+5
View File
@@ -987,10 +987,15 @@ CREATE TABLE IF NOT EXISTS conversations (
title TEXT NOT NULL DEFAULT '',
llm_profile_id BIGINT REFERENCES llm_profiles(id) ON DELETE SET NULL,
pinned_at TIMESTAMPTZ,
-- 这条对话实际执行命令时使用的沙箱。空表示尚未写入,读取时再按漏洞报告回退。
sandbox_scope TEXT NOT NULL DEFAULT '',
sandbox_owner_id TEXT NOT NULL DEFAULT '',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
ALTER TABLE conversations ADD COLUMN IF NOT EXISTS pinned_at TIMESTAMPTZ;
ALTER TABLE conversations ADD COLUMN IF NOT EXISTS sandbox_scope TEXT NOT NULL DEFAULT '';
ALTER TABLE conversations ADD COLUMN IF NOT EXISTS sandbox_owner_id TEXT NOT NULL DEFAULT '';
CREATE INDEX IF NOT EXISTS idx_conversations_llm_profile ON conversations(llm_profile_id) WHERE llm_profile_id IS NOT NULL;
CREATE INDEX IF NOT EXISTS idx_conversations_pinned ON conversations(pinned_at DESC) WHERE pinned_at IS NOT NULL;
DROP TRIGGER IF EXISTS trg_conversations_upd ON conversations;