style(api): format the streamed Agent debug helper with ruff

This commit is contained in:
Hyu
2026-09-30 15:50:48 +08:00
parent 5758f20768
commit 0c3917ee0f
@@ -29,11 +29,7 @@ def debug_stream_response(service, context, agent_uuid: str, payload: dict) -> q
application = getattr(service, 'ap', None)
persistence_mgr = getattr(application, 'persistence_mgr', None)
tenant_scope = getattr(persistence_mgr, 'tenant_scope', None)
scope = (
tenant_scope(context.workspace_uuid)
if callable(tenant_scope)
else contextlib.nullcontext()
)
scope = tenant_scope(context.workspace_uuid) if callable(tenant_scope) else contextlib.nullcontext()
try:
# The streamed body is emitted after the request handler returned,
# so the request's tenant scope has already closed: carry the