feat(alerting): add configurable PM results list for alerting agent + enable UX#1219
feat(alerting): add configurable PM results list for alerting agent + enable UX#1219
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
The backend changes (config extraction, prompt context fallback, alerting prompt improvement) are clean and correct. However, the frontend PMContainerPicker component calls pm.discovery.discover with capability: 'containers', which no production PM provider declares — meaning the "Fetch Lists" button will always fail with a NOT_IMPLEMENTED error for every provider.
Architecture & Design
- [SHOULD_FIX] Pattern mismatch with existing wizard container-pick: The shared
container-pickwizard step (atweb/src/components/projects/pm-providers/steps/container-pick.tsx) receives pre-fetchedoptionsas a prop — the caller is responsible for using the correct provider-specific capability (boardsfor Trello,projectsfor JIRA,teamsfor Linear). The newPMContainerPickerbypasses this pattern and calls the discovery endpoint directly with a genericcontainerscapability that no provider supports.
Code Issues
Blocking
-
web/src/components/projects/integration-alerting-tab.tsx:30 —
capability: 'containers'is not declared by any production PM provider. Trello declaresboards, JIRA declaresprojects, Linear declaresteams— none declarescontainers. The Trello manifest explicitly documents this: "containers isn't declared because in Trello's model it would be redundant with boards". Clicking "Fetch Lists" will always return aNOT_IMPLEMENTEDtRPC error. The manual text input fallback works, so configuration is possible, but the picker UX is non-functional.Options to fix: (a) map the capability per provider (e.g. Trello→boards, JIRA→projects/states, Linear→teams), (b) add a
containerscapability to each provider that returns the appropriate container list, or (c) drop the picker and only show the manual text input untilcontainerssupport is added.
Observations (not blocking)
- The ternary
alertingResultsContainerId ? alertingResultsContainerId : undefinedatpromptContext.ts:79could be simplified to justalertingResultsContainerId(sinceundefinedis already the falsy case), but this is cosmetic — the logic is correct.
🕵️ claude-code · claude-opus-4-6 · run details
| mutationFn: async () => { | ||
| return (await trpcClient.pm.discovery.discover.mutate({ | ||
| providerId: pmProvider, | ||
| capability: 'containers', |
There was a problem hiding this comment.
BLOCKING: capability: 'containers' is not declared by any of the three production PM providers:
- Trello: declares
boards,labels,customFields,currentUser— manifest comment says "containers isn't declared because in Trello's model it would be redundant with boards" - JIRA: declares
projects,states,labels,customFields,currentUser - Linear: declares
teams,states,labels,projects,currentUser
The pm.discovery.discover endpoint checks manifest.discoveryCapabilities?.[input.capability] and throws NOT_IMPLEMENTED when the capability isn't declared. This means the "Fetch Lists" button will error for every provider.
The manual text input fallback works, so users can configure this field — but the picker dropdown is non-functional.
Consider either: (a) mapping per provider to the right capability, (b) adding containers support to each provider manifest, or (c) removing the picker until the capability exists.
There was a problem hiding this comment.
Fixed! Added a containerCapabilityForProvider helper that maps each PM provider slug to its actual discovery capability: Trello→boards, JIRA→projects, Linear→teams. The PMContainerPicker now uses the mapped capability, so "Fetch Lists" will call the right endpoint for each provider. The Fetch button is also disabled (with an explanatory tooltip) for any unrecognised provider slug as a safety net.
…tainer picker Replace the non-existent `containers` capability (which caused NOT_IMPLEMENTED errors for every provider) with provider-specific mappings: Trello→`boards`, JIRA→`projects`, Linear→`teams`. Disable the Fetch button with an explanatory tooltip for unknown providers. Also simplify the `alertingResultsContainerId ?? undefined` ternary to a plain `??` expression in promptContext.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
resultsContainerIdfield toSentryIntegrationConfigso users can configure where the alerting agent creates investigation work itemsresultsContainerIdintobuildPromptContextas a fallbackbacklogListIdfor alerting agent runspm.discovery.discovercontainers capability)alertingagent type in the Agents tabbacklogListIdis configuredCard: https://trello.com/c/69ef4314a22c9eeae8cfb486
Changes
Backend
src/sentry/integration.ts: ExtendedSentryIntegrationConfigwith optionalresultsContainerId?: string; updatedgetSentryIntegrationConfigto extract it from config JSONBsrc/agents/shared/promptContext.ts: AddedalertingResultsContainerIdoptional param; used as fallbackbacklogListIdwhen no PM backlog is configuredsrc/backends/secretOrchestrator.ts: Foralertingagent runs, look up Sentry config and passresultsContainerIdtobuildPromptContextsrc/agents/definitions/alerting.yaml: Improved step 4 wording; added comment fallback whenbacklogListIdis unset but a triggeringworkItemIdis availableFrontend
web/src/components/projects/integration-alerting-tab.tsx: AddedpmProviderprop; newPMContainerPickersub-component usingpm.discovery.discover({capability: 'containers'}); added agent enablement info box; savesresultsContainerIdin configweb/src/components/projects/integration-form.tsx: PasspmProviderprop toAlertingTabTests
tests/unit/sentry/integration.test.ts: 3 new tests forresultsContainerIdextraction (present, absent, non-string)tests/unit/agents/shared/promptContext.test.ts: 4 new tests foralertingResultsContainerIdfallback behaviourTest plan
resultsContainerIdis extracted from config when presentbuildPromptContextuses PM backlog first; Sentry container as fallback onlyresultsContainerIdalongsideorganizationSlug🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details