chore(chat): refactor chat init into separate quota and history actors

Split `chatInitActor` into `loadQuotaActor` (guest quota fetch) and `loadHistoryActor` (local → network → save sync), and add `quotaLoaded` / `historyLoaded` state flags so the UI can display loading status during the new local-first history hydration flow. Also drop the now-unused `ChatInit` event and pipe Next.js stdout/stderr to a persistent log file in the post-receive hook for easier troubleshooting.
This commit is contained in:
2026-06-15 16:21:40 +08:00
parent cfc6de5a8c
commit 1f3980d461
8 changed files with 296 additions and 152 deletions
+3 -1
View File
@@ -116,8 +116,10 @@ stop_existing_next() {
# 6. launch_next —— 后**台**启 `pnpm run start`,捕 PID
# ============================================================
launch_next() {
# next stdout/stderr 接**到** logs/next-server.log**追**加**模式****保**留**历**史** log **用**于排**查**
NEXT_LOG_FILE="$REPO_TOPLEVEL/logs/next-server.log"
echo "=== start LAUNCH @ $(date -u +%Y-%m-%dT%H:%M:%SZ) ===" >> "$LOG_FILE"
nohup pnpm run start > /dev/null 2>&1 &
nohup pnpm run start >> "$NEXT_LOG_FILE" 2>&1 &
START_PID=$!
echo "=== start PID=$START_PID @ $(date -u +%Y-%m-%dT%H:%M:%SZ) ===" >> "$LOG_FILE"
}