-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: gpt5 support #5168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+24
−5
Closed
feat: gpt5 support #5168
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -570,6 +570,16 @@ def shutdown(self, signum: int | None, frame: FrameType | None) -> None: | |
sys.exit(0) | ||
|
||
|
||
def sanitize_slack_payload(payload: dict) -> dict: | ||
"""Remove message content from Slack payload for logging""" | ||
sanitized = {k: v for k, v in payload.items() if k not in {"text", "blocks"}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sanitize_slack_payload fails to strip message text from nested structures, so sensitive content may still be logged (Based on your team’s feedback about avoiding personal data in logs). Prompt for AI agents
|
||
if "event" in sanitized and isinstance(sanitized["event"], dict): | ||
sanitized["event"] = { | ||
k: v for k, v in sanitized["event"].items() if k not in {"text", "blocks"} | ||
} | ||
return sanitized | ||
|
||
|
||
def prefilter_requests(req: SocketModeRequest, client: TenantSocketModeClient) -> bool: | ||
"""True to keep going, False to ignore this Slack request""" | ||
|
||
|
@@ -762,7 +772,10 @@ def prefilter_requests(req: SocketModeRequest, client: TenantSocketModeClient) - | |
if not check_message_limit(): | ||
return False | ||
|
||
logger.debug(f"Handling Slack request: {client.bot_name=} '{req.payload=}'") | ||
# Don't log Slack message content | ||
logger.debug( | ||
f"Handling Slack request: {client.bot_name=} '{sanitize_slack_payload(req.payload)=}'" | ||
) | ||
return True | ||
|
||
|
||
|
@@ -929,10 +942,9 @@ def process_message( | |
if req.type == "events_api": | ||
event = cast(dict[str, Any], req.payload["event"]) | ||
event_type = event.get("type") | ||
msg = cast(str, event.get("text", "")) | ||
logger.info( | ||
f"process_message start: {tenant_id=} {req.type=} {req.envelope_id=} " | ||
f"{event_type=} {msg=}" | ||
f"{event_type=}" | ||
) | ||
else: | ||
logger.info( | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider extracting the GPT-5 model list into a constant to avoid duplication and improve maintainability. This list appears in multiple files.