Skip to content

feat: use bolt context when possible#29

Merged
WilliamBergamin merged 3 commits into
mainfrom
use-bolt-context-when-possible
Mar 17, 2026
Merged

feat: use bolt context when possible#29
WilliamBergamin merged 3 commits into
mainfrom
use-bolt-context-when-possible

Conversation

@WilliamBergamin

Copy link
Copy Markdown
Contributor

Type of change

  • New feature
  • Bug fix
  • Documentation

Summary

These changes make casey use the BoltContext to extract values like team_id enterprise_id user_id. This aims to make casey more reliable by reusing the same references Bolt uses internally

Requirements

  • I have ensured the changes I am contributing align with existing patterns and have tested and linted my code
  • I've read and agree to the Code of Conduct

@WilliamBergamin WilliamBergamin self-assigned this Mar 11, 2026
@WilliamBergamin WilliamBergamin added the enhancement New feature or request label Mar 11, 2026

@zimeg zimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@WilliamBergamin Super amazing changes! 📠

I left small suggestions that'd be curious to mirror across files but no blocker if the agentic applications aren't running 🚢 💨

Comment on lines 12 to 20

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🌟 praise: This is a significant improvement for standard findings across requests. I am finding we have a quick note on this here:

📚 https://docs.slack.dev/tools/bolt-python/concepts/context

Comment on lines +9 to +11
async def handle_app_home_opened(
client: AsyncWebClient, context: AsyncBoltContext, logger: Logger
):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
async def handle_app_home_opened(
client: AsyncWebClient, context: AsyncBoltContext, logger: Logger
):
async def handle_app_home_opened(
client: AsyncWebClient,
context: AsyncBoltContext,
logger: Logger,
):

🧮 suggestion: To make reading down fastest!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like this suggestion 💯 But I think we might need to do this in another PR since this is fighting against the formatter slightly, we might want to make this a claude guideline 🤔

channel_id = context.channel_id
team_id = context.team_id
text = event.get("text", "")
thread_ts = event.get("thread_ts") or event["ts"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔭 thought: I'm curious if you have thoughts ahead to this change too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yess definitely aim to change this once context.thread_ts works for any payload 🙏

Comment on lines +7 to +9
def handle_feedback(
ack: Ack, body: dict, client: WebClient, context: BoltContext, logger: Logger
):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
def handle_feedback(
ack: Ack, body: dict, client: WebClient, context: BoltContext, logger: Logger
):
def handle_feedback(
ack: Ack,
body: dict,
client: WebClient,
context: BoltContext,
logger: Logger,
):

🪵 suggestion: While we're making a change here?

@zimeg zimeg changed the title Use bolt context when possible refactor: use bolt context when possible Mar 17, 2026
@zimeg

zimeg commented Mar 17, 2026

Copy link
Copy Markdown
Member

🗣️ ramble: Forgive me if this should be a feat instead - this is unclear to me for sample apps sometimes...

@WilliamBergamin WilliamBergamin changed the title refactor: use bolt context when possible feat: use bolt context when possible Mar 17, 2026
@WilliamBergamin WilliamBergamin merged commit a9eb61e into main Mar 17, 2026
4 checks passed
@WilliamBergamin WilliamBergamin deleted the use-bolt-context-when-possible branch March 17, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants