Honor Slack/Telegram messenger.address and apply MESSENGER_RATE_* overrides in the HTTP client so mocked messengers can be targeted without production throttling. - #583
Open
tansdf wants to merge 5 commits into
Conversation
…rrides in the HTTP client so mocked messengers can be targeted without production throttling. Co-authored-by: Cursor <cursoragent@cursor.com>
…egram URLs type-check without narrowing NullApplicationConfig. Co-authored-by: Cursor <cursoragent@cursor.com>
DiTsi
requested changes
Sep 15, 2026
| def normalize_jira_base_url(cls, v): | ||
| return v.rstrip("/") if v else v | ||
|
|
||
| def apply_messenger_rate_limits( |
Collaborator
There was a problem hiding this comment.
Can we remove it and set limits using code:
rate_limit=self.messenger_rate_limit or self.rate_limit,
rate_window=messenger_rate_window or self.rate_window,
here: https://github.com/eslupmi/impulse/blob/develop/app/im/application.py#L600
?
| ): | ||
| self.rate_limit = rate_limit | ||
| self.rate_window = rate_window | ||
| self.rate_limit, self.rate_window = get_environment_config().apply_messenger_rate_limits( |
Collaborator
There was a problem hiding this comment.
If https://github.com/eslupmi/impulse/pull/583/changes#r4014911917 will work fine, it can be reverted
| description="Port to listen on" | ||
| ) | ||
| messenger_rate_limit: int | None = Field( | ||
| default_factory=lambda: _env_optional_int('MESSENGER_RATE_LIMIT'), |
Collaborator
There was a problem hiding this comment.
Let's rename ENVS to DEV_MESSENGER_RATE_LIMIT and DEV_MESSENGER_RATE_WINDOW
|
|
||
| def _get_url(self, app_config: ApplicationConfig): | ||
| return 'https://slack.com' | ||
| return app_config.address or 'https://slack.com' |
Collaborator
There was a problem hiding this comment.
I think DEV_MESSENGER_CUSTOM_ADDRESS ENV will be better (minimum documentation updates needed)
…p so RateLimitedClient stays generic and Slack/Telegram YAML stays production-only.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



No description provided.