Repository navigation
feat(api,admin): label every agent failure notification with the installation's name (CLEAN-167) - #141
Merged
Conversation
maksymhryzodub-prog
added this pull request to stack #142
October 15, 2026 12:12
…allation's name (CLEAN-167) RANCH_ENVIRONMENT on the API — or the infrastructure.environment setting over it — puts "[dev-mazda] " at the start of every channel-level message: the bot's root and its rewrites, the webhook's two messages, the test. Thread replies stay unlabelled; they live inside the root. Unset, nothing changes. The destination view reports the label in force so the owner sees it in Settings → Notifications and through get_notification_destination. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
maksymhryzodub-prog
force-pushed
the
feat/CLEAN-167-environment-label
branch
from
October 15, 2026 12:13
1ecefef to
56001ea
Compare
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.
Jira: CLEAN-167. Stacked on #140 (CLEAN-165) — merge that first; this diff is the last commit only.
What it does
A Slack message about a failed agent now says which installation it came from. Set
RANCH_ENVIRONMENTon the API deployment (dev,staging,prod-eu) and every channel-level message starts with it in brackets:Thread replies carry no label (they live inside the root). Unset: nothing changes — an install that never set it looks as it did.
How
infrastructure.environmentin the settings catalogue, resolved byInfraConfigGateway.getEnvironment()the wayapi_public_urlis: setting →RANCH_ENVIRONMENT→ null. Trimmed; a settings outage yields null, so a notification still goes out, unlabelled.AgentEventModuleimportsSettingModule;NotificationDestinationService.environment()is the one read, passed intorenderRoot/renderOpened/renderClosed/renderTest. The label is escaped like any text that is not ours.get_notification_destination) reportsenvironment, so the owner sees what messages will carry — and a hint to set the variable when it is empty..env.exampleanddocs/operations/agent-events.mdtell DevOps the variable and what it does.Verified
api:bun run build; jest foragent/event+setting+tool-secrets(227) and the whole suite;eslint --quiet+ Prettier on changed files. New specs: the label on every channel-level renderer and absent from replies; the flow on the bot (root and rewrites labelled, thread not) and on the webhook;getEnvironmentprecedence, trimming and the null cases.admin:bun test slices(195),npx nuxt typecheck,bun run locale:check.Twin consoles
adminchanged (the view's one line).apphas noagent/eventsub-slice: nothing to mirror.For DevOps
Add to the API deployment:
RANCH_ENVIRONMENT=<short name of the cluster>. No restart beyond the rollout; the owner can override it in settings.🤖 Generated with Claude Code