From 72e1dc5fc3b5b014835e43100a8fe5d46ecbda09 Mon Sep 17 00:00:00 2001 From: arc53-machine <232052973+arc53-machine@users.noreply.github.com> Date: Tue, 29 Sep 2026 15:22:29 +0100 Subject: [PATCH] Read the public-link flag safely on processors built without init Callers that build a StreamProcessor without __init__ and stub the agent key lookup never set the flag, and configuring the agent then failed. It now reads as not a public-link caller. --- docsgpt/api/answer/services/stream_processor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docsgpt/api/answer/services/stream_processor.py b/docsgpt/api/answer/services/stream_processor.py index 64395ca4..dd28af81 100644 --- a/docsgpt/api/answer/services/stream_processor.py +++ b/docsgpt/api/answer/services/stream_processor.py @@ -1002,7 +1002,9 @@ class StreamProcessor: agent_id, self.initial_user_id ) self.agent_id = str(agent_id) if agent_id else None - self.agent_config["public_link_caller"] = bool(self.agent_id and self.public_link_usage) + self.agent_config["public_link_caller"] = bool( + self.agent_id and getattr(self, "public_link_usage", False) + ) # Determine the effective API key (explicit > agent-derived) effective_key = self.data.get("api_key") or self.agent_key