mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 04:40:45 +08:00
fix(chat,channels): admin session delete, weixin inbound, PG and docs
- List/delete chat sessions for administrator by username (cross-tenant UUID) - Return 404 when delete does not remove a session; add tests - Weixin: dispatch lang, inbound attachments, reply persist, native reply timeout - PG compat scrub and administrator session delete repo path - RUNBOOK: WhatsApp re-bind with Remove-Item auth; weixin poll diag scripts Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
39fd1905b6
commit
bc1b45a8fd
20 changed files with 1056 additions and 86 deletions
|
|
@ -15,7 +15,7 @@ $sidecarRoot = Join-Path $oclawRoot "data\\channel_sidecar\\$ChannelId"
|
|||
$stateDir = Join-Path $sidecarRoot "state"
|
||||
function Sync-WeixinBridgeRunners {
|
||||
$bridgeSrc = Join-Path $oclawRoot "runtime\\operations\\weixin_bridge"
|
||||
foreach ($name in @("official_runner.ts", "login.ts")) {
|
||||
foreach ($name in @("official_runner.ts", "login.ts", "poll_diag.ts")) {
|
||||
$srcPath = Join-Path $bridgeSrc $name
|
||||
if (-not (Test-Path $srcPath)) {
|
||||
throw "missing bridge source file: $srcPath"
|
||||
|
|
|
|||
28
runtime/operations/scripts/weixin_poll_diag.ps1
Normal file
28
runtime/operations/scripts/weixin_poll_diag.ps1
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
param(
|
||||
[switch]$ResetCursor = $false
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..\..")).Path
|
||||
$sidecarRoot = Join-Path $repoRoot "data\channel_sidecar\oclaw-weixin"
|
||||
$stateDir = Join-Path $sidecarRoot "state"
|
||||
$bridgeSrc = Join-Path $repoRoot "runtime\operations\weixin_bridge\poll_diag.ts"
|
||||
|
||||
if (-not (Test-Path $bridgeSrc)) {
|
||||
throw "missing $bridgeSrc"
|
||||
}
|
||||
Copy-Item -Path $bridgeSrc -Destination (Join-Path $sidecarRoot "poll_diag.ts") -Force
|
||||
|
||||
$args = @("exec", "--", "tsx", "poll_diag.ts")
|
||||
if ($ResetCursor) {
|
||||
$args += "--reset-cursor"
|
||||
}
|
||||
|
||||
Push-Location $sidecarRoot
|
||||
try {
|
||||
$env:OCLAW_STATE_DIR = $stateDir
|
||||
$env:OPENCLAW_STATE_DIR = $stateDir
|
||||
npm.cmd @args
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ $cleaned = Stop-SidecarProcesses
|
|||
Remove-Item -Force $pidFile -ErrorAction SilentlyContinue
|
||||
|
||||
if (Test-Path $bridgeSrc) {
|
||||
foreach ($name in @("official_runner.ts", "login.ts")) {
|
||||
foreach ($name in @("official_runner.ts", "login.ts", "poll_diag.ts")) {
|
||||
$srcPath = Join-Path $bridgeSrc $name
|
||||
if (Test-Path $srcPath) {
|
||||
Copy-Item -Path $srcPath -Destination (Join-Path $sidecarRoot $name) -Force
|
||||
|
|
@ -99,7 +99,7 @@ if (Test-Path (Join-Path $sidecarRoot "official_runner.ts")) {
|
|||
$cmd = "cmd.exe"
|
||||
$args = @(
|
||||
"/c",
|
||||
"cd /d $sidecarRoot && set OCLAW_STATE_DIR=$stateDir&& set AIA_GATEWAY_BASE_URL=$GatewayBaseUrl&& set NODE_PATH=$sidecarRoot\node_modules&& npm.cmd exec -- tsx official_runner.ts"
|
||||
"cd /d $sidecarRoot && set OCLAW_STATE_DIR=$stateDir&& set OPENCLAW_STATE_DIR=$stateDir&& set AIA_GATEWAY_BASE_URL=$GatewayBaseUrl&& set OCLAW_WEIXIN_LOG_FILE=$logPath&& set NODE_PATH=$sidecarRoot\node_modules&& npm.cmd exec -- tsx official_runner.ts"
|
||||
)
|
||||
$p = Start-Process -FilePath $cmd -ArgumentList $args -WorkingDirectory $sidecarRoot -PassThru -WindowStyle Hidden -RedirectStandardOutput $logPath -RedirectStandardError $errPath
|
||||
Set-Content -Path $pidFile -Value $p.Id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue