mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-16 22:14:40 +00:00
fix(agent): set TenantID on streaming events in runLoop emitRun (#445)
The emitRun wrapper in runLoop (loop.go) is missing TenantID, causing all streaming events (chunk, thinking, tool.call) to be emitted with TenantID=Nil. The event filter (event_filter.go:43-44) blocks unscoped events for non-admin clients, so tenant-bound API key users receive no streaming — only run.started and run.completed (emitted from Run() in loop_run.go which already sets TenantID). Fix: add event.TenantID = l.tenantID, matching the pattern in loop_run.go's emitRun wrapper.
This commit is contained in:
1 parent
af3fe2fe08
commit
00db30c2d1
1 file changed
+1
@@ -37,6 +37,7 @@ func (l *Loop) runLoop(ctx context.Context, req RunRequest) (*RunResult, error)
|
||||
event.UserID = req.UserID
|
||||
event.Channel = req.Channel
|
||||
event.ChatID = req.ChatID
|
||||
event.TenantID = l.tenantID
|
||||
l.emit(event)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user