Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions examples/slackbot/src/slackbot/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,7 @@ async def handle_message(payload: SlackPayload, db: Database):
channel_id=event.channel,
thread_ts=thread_ts,
)
# Still return completed so we don't retry
return Completed(
message="Error during agent execution",
name="ERROR_HANDLED",
data=dict(error=str(e), user_context=user_context),
)
raise
finally:
try:
await mark_thread_completed(db, message_ts)
Comment on lines +282 to 285
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because mark_thread_completed is in a finally block, it will run even when an exception is re-raised, marking the thread as completed on failure. If the intent is to signal a failed flow, move this call to the success path (outside finally) or add a separate failure path (e.g., mark_thread_failed) for the except branch.

Copilot uses AI. Check for mistakes.
Expand Down
2 changes: 1 addition & 1 deletion examples/slackbot/src/slackbot/github/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class GitHubLabel(BaseModel):

name: str = Field(default="")
color: str = Field(default="")
description: str = Field(default="")
description: str | None = Field(default="")
Copy link

Copilot AI Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The field type allows None but the default remains an empty string. This mixes two different sentinel values for 'no description' and can confuse downstream consumers; consider setting the default to None to align with the Optional type.

Suggested change
description: str | None = Field(default="")
description: str | None = Field(default=None)

Copilot uses AI. Check for mistakes.


class GitHubComment(BaseModel):
Expand Down