Skip to content

Commit 1dcaf7d

Browse files
ArthurKnauscodex
andauthored
Use current agent conversation API (#1261)
- Align MCP AI conversation tools with Sentry’s current agent conversation API. - Update specs and coverage for the renamed routes. Co-authored-by: Codex CLI Agent <noreply@openai.com>
1 parent fa6f937 commit 1dcaf7d

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎docs/specs/ai-conversations.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Parameter behavior:
113113
Use the Sentry AI Conversations list endpoint:
114114

115115
```text
116-
GET /api/0/organizations/{organizationSlug}/ai-conversations/
116+
GET /api/0/organizations/{organizationSlug}/agents/conversations/
117117
```
118118

119119
Do not implement conversation search through
@@ -465,7 +465,7 @@ get_sentry_resource({
465465
Add focused tests for:
466466
467467
1. Basic search:
468-
- Calls `/organizations/{org}/ai-conversations/`.
468+
- Calls `/organizations/{org}/agents/conversations/`.
469469
- Passes `query`, `per_page`, and time parameters.
470470
- Returns one structured summary per conversation.
471471
2. Empty results:

‎packages/mcp-core/src/api-client/client.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4597,7 +4597,7 @@ export class SentryApiService {
45974597
}
45984598

45994599
const response = await this.request(
4600-
apiPath`/organizations/${organizationSlug}/ai-conversations/${conversationId}/` +
4600+
apiPath`/organizations/${organizationSlug}/agents/conversations/${conversationId}/` +
46014601
`?${queryParams.toString()}`,
46024602
undefined,
46034603
opts,
@@ -4679,7 +4679,7 @@ export class SentryApiService {
46794679
}
46804680

46814681
const response = await this.request(
4682-
apiPath`/organizations/${organizationSlug}/ai-conversations/` +
4682+
apiPath`/organizations/${organizationSlug}/agents/conversations/` +
46834683
`?${queryParams.toString()}`,
46844684
undefined,
46854685
opts,

‎packages/mcp-core/src/server.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ describe("buildServer", () => {
14031403
it("execute_sentry_tool dispatches structured catalog results", async () => {
14041404
mswServer.use(
14051405
http.get(
1406-
"https://sentry.io/api/0/organizations/test-org/ai-conversations/",
1406+
"https://sentry.io/api/0/organizations/test-org/agents/conversations/",
14071407
({ request }) => {
14081408
const url = new URL(request.url);
14091409
expect(url.searchParams.get("query")).toBe("checkout");

‎packages/mcp-core/src/tools/catalog/get-ai-conversation-details.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function mockConversationEndpoint(
115115
) {
116116
mswServer.use(
117117
http.get(
118-
`https://sentry.io/api/0/organizations/${org}/ai-conversations/${conversationId}/`,
118+
`https://sentry.io/api/0/organizations/${org}/agents/conversations/${conversationId}/`,
119119
({ request }) => {
120120
const url = new URL(request.url);
121121
expect(url.searchParams.get("statsPeriod")).toBe("30d");
@@ -538,7 +538,7 @@ describe("get_ai_conversation_details", () => {
538538
it("preserves scoped query parameters from conversation URLs", async () => {
539539
mswServer.use(
540540
http.get(
541-
"https://sentry.io/api/0/organizations/sentry-mcp-evals/ai-conversations/conv-123/",
541+
"https://sentry.io/api/0/organizations/sentry-mcp-evals/agents/conversations/conv-123/",
542542
({ request }) => {
543543
const url = new URL(request.url);
544544
expect(url.searchParams.get("statsPeriod")).toBeNull();
@@ -574,7 +574,7 @@ describe("get_ai_conversation_details", () => {
574574
it("describes explicit lookup windows when no spans are found", async () => {
575575
mswServer.use(
576576
http.get(
577-
"https://sentry.io/api/0/organizations/sentry-mcp-evals/ai-conversations/conv-empty/",
577+
"https://sentry.io/api/0/organizations/sentry-mcp-evals/agents/conversations/conv-empty/",
578578
({ request }) => {
579579
const url = new URL(request.url);
580580
expect(url.searchParams.get("statsPeriod")).toBeNull();

‎packages/mcp-core/src/tools/catalog/search-ai-conversations.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe("search_ai_conversations", () => {
5252
it("returns conversation-shaped search results", async () => {
5353
mswServer.use(
5454
http.get(
55-
"https://sentry.io/api/0/organizations/test-org/ai-conversations/",
55+
"https://sentry.io/api/0/organizations/test-org/agents/conversations/",
5656
({ request }) => {
5757
const url = new URL(request.url);
5858
expect(url.searchParams.get("query")).toBe("checkout");
@@ -142,7 +142,7 @@ describe("search_ai_conversations", () => {
142142
it("keeps search results concise for large conversations", async () => {
143143
mswServer.use(
144144
http.get(
145-
"https://sentry.io/api/0/organizations/test-org/ai-conversations/",
145+
"https://sentry.io/api/0/organizations/test-org/agents/conversations/",
146146
() => HttpResponse.json([longConversation]),
147147
),
148148
);
@@ -179,7 +179,7 @@ describe("search_ai_conversations", () => {
179179
it("defaults searches to the same 30d window as detail lookups", async () => {
180180
mswServer.use(
181181
http.get(
182-
"https://sentry.io/api/0/organizations/test-org/ai-conversations/",
182+
"https://sentry.io/api/0/organizations/test-org/agents/conversations/",
183183
({ request }) => {
184184
const url = new URL(request.url);
185185
expect(url.searchParams.get("statsPeriod")).toBe("30d");
@@ -213,7 +213,7 @@ describe("search_ai_conversations", () => {
213213
it("defaults to the configured search window when period is omitted", async () => {
214214
mswServer.use(
215215
http.get(
216-
"https://sentry.io/api/0/organizations/test-org/ai-conversations/",
216+
"https://sentry.io/api/0/organizations/test-org/agents/conversations/",
217217
({ request }) => {
218218
const url = new URL(request.url);
219219
expect(url.searchParams.get("statsPeriod")).toBe("30d");
@@ -252,12 +252,12 @@ describe("search_ai_conversations", () => {
252252
}),
253253
),
254254
http.get(
255-
"https://sentry.io/api/0/organizations/test-org/ai-conversations/",
255+
"https://sentry.io/api/0/organizations/test-org/agents/conversations/",
256256
({ request }) => {
257257
requestUrls.push(request.url);
258258
return HttpResponse.json([], {
259259
headers: {
260-
Link: '<https://sentry.io/api/0/organizations/test-org/ai-conversations/?cursor=page-2>; rel="next"; results="true"; cursor="page-2"',
260+
Link: '<https://sentry.io/api/0/organizations/test-org/agents/conversations/?cursor=page-2>; rel="next"; results="true"; cursor="page-2"',
261261
},
262262
});
263263
},
@@ -307,7 +307,7 @@ describe("search_ai_conversations", () => {
307307
let requestUrl: string | undefined;
308308
mswServer.use(
309309
http.get(
310-
"https://sentry.io/api/0/organizations/test-org/ai-conversations/",
310+
"https://sentry.io/api/0/organizations/test-org/agents/conversations/",
311311
({ request }) => {
312312
requestUrl = request.url;
313313
return HttpResponse.json([]);

0 commit comments

Comments
 (0)