Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit c25c5c7

Browse files
Merge branch 'main' into feat/messages/polish-pagination-and-filtering
2 parents 581d3b3 + 599d8f6 commit c25c5c7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/codegate/pipeline/secrets/secrets.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,17 @@ async def process(
316316
# Process all messages
317317
for i, message in enumerate(new_request["messages"]):
318318
if "content" in message and message["content"]:
319+
message_content = message["content"]
320+
321+
# cline with anthropic seems to be sending a list of dicts with type:text instead of
322+
# a string
323+
# this hack will not be needed once we access the native functions through an API
324+
# (I tested this actually)
325+
if isinstance(message_content, list) and "text" in message_content[0]:
326+
message_content = message_content[0]["text"]
327+
319328
redacted_content, secrets_matched = self._redact_message_content(
320-
message["content"], sensitive_data_manager, session_id, context
329+
message_content, sensitive_data_manager, session_id, context
321330
)
322331
new_request["messages"][i]["content"] = redacted_content
323332
if i > last_assistant_idx:

0 commit comments

Comments
 (0)