Commit 7a2b95c
fix(seer): Route coding agent handoff CTA through seer/settings/ (#117622)
## Problem
The Cursor/Claude **coding agent integration CTA**
(`codingAgentIntegrationCta.tsx`, used by `CursorIntegrationCta` and
`ClaudeCodeIntegrationCta` on the project Seer settings page) wired its
*"Set Seer to hand off to …"* button through the legacy `POST
.../seer/preferences/` endpoint via `useUpdateProjectSeerPreferences`.
That endpoint looks up repos by `(provider, owner, name, external_id)`
and strips whitespace from `owner`/`name`. For GitLab orgs with spaces
in repo names (e.g. `"My Group / My Repo"`), every handoff setup
returned `{"detail": "Invalid repository"}` (HTTP 400) — even though the
CTA isn't editing repos. It only re-sent the existing `repositories` to
*preserve* them through the coupled legacy payload.
## Fix
Switch the write to `useUpdateSeerSettings` (`PUT .../seer/settings/`),
which accepts `agent`, `integrationId`, `stoppingPoint`, and
`autoCreatePr` with **no repository lookup**, making it immune to the
whitespace bug. The defensive repo re-send is dropped since the settings
endpoint never touches repository associations.
Payload mapping for handoff setup:
```
{agent: config.target, integrationId, stoppingPoint: 'root_cause', autoCreatePr: false}
```
This matches the handoff mapping established in #117526 for
`ProjectSeerGeneralForm`.
## Scope
Only the CTA's handoff *write* changes. The `useProjectSeerPreferences`
read (used for the `isConfigured` check) and the `useUpdateProject`
automation-enable call are unchanged.
## Tests
Updated `cursorIntegrationCta.spec.tsx` and
`claudeCodeIntegrationCta.spec.tsx` so the handoff-setup tests assert
`PUT .../seer/settings/` with the new payload instead of `POST
.../seer/preferences/`. The read-side preferences mocks are unchanged.
## Stacking
Stacked on #117526 (which introduces `useUpdateSeerSettings`). Merge
that first.
Refs #117489
Fixes
https://linear.app/getsentry/issue/CW-1527/failed-to-launch-coding-agent-with-anthropic-api-key
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Ryan Albrecht <ryan.albrecht@sentry.io>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b8e7388 commit 7a2b95c
5 files changed
Lines changed: 221 additions & 248 deletions
File tree
- static/app
- components/events/autofix
- views/settings/projectSeer
Lines changed: 66 additions & 94 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
26 | 51 | | |
27 | 52 | | |
28 | 53 | | |
29 | 54 | | |
30 | 55 | | |
31 | 56 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
| |||
130 | 147 | | |
131 | 148 | | |
132 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
133 | 153 | | |
134 | 154 | | |
135 | 155 | | |
| |||
146 | 166 | | |
147 | 167 | | |
148 | 168 | | |
149 | | - | |
| 169 | + | |
150 | 170 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
| |||
172 | 184 | | |
173 | 185 | | |
174 | 186 | | |
175 | | - | |
| 187 | + | |
176 | 188 | | |
177 | | - | |
| 189 | + | |
178 | 190 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
186 | 196 | | |
187 | 197 | | |
188 | 198 | | |
| |||
217 | 227 | | |
218 | 228 | | |
219 | 229 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
| |||
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
246 | | - | |
247 | | - | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | | - | |
| 251 | + | |
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
| |||
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
286 | 280 | | |
287 | 281 | | |
288 | 282 | | |
| |||
314 | 308 | | |
315 | 309 | | |
316 | 310 | | |
317 | | - | |
318 | | - | |
| 311 | + | |
| 312 | + | |
319 | 313 | | |
320 | | - | |
| 314 | + | |
321 | 315 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
329 | 321 | | |
330 | 322 | | |
331 | 323 | | |
| |||
350 | 342 | | |
351 | 343 | | |
352 | 344 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
367 | 349 | | |
368 | 350 | | |
369 | 351 | | |
| |||
404 | 386 | | |
405 | 387 | | |
406 | 388 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
421 | 393 | | |
422 | 394 | | |
423 | 395 | | |
| |||
Lines changed: 34 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | | - | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 56 | + | |
| 57 | + | |
59 | 58 | | |
60 | | - | |
61 | 59 | | |
62 | | - | |
63 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
64 | 77 | | |
| 78 | + | |
65 | 79 | | |
66 | | - | |
67 | 80 | | |
68 | 81 | | |
69 | 82 | | |
70 | | - | |
71 | | - | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
| |||
104 | 116 | | |
105 | 117 | | |
106 | 118 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
| |||
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
124 | | - | |
| 132 | + | |
125 | 133 | | |
126 | | - | |
| 134 | + | |
127 | 135 | | |
128 | 136 | | |
129 | 137 | | |
| |||
0 commit comments