Skip to content

Commit 2ad892d

Browse files
committed
fix(incidentio,google_vault): drop v1-only fields, correct two backwards labels
An earlier pass removed v1-only fields from the v2 tools but stopped short: description (summary is the real field), external_issue_reference on actions_create/update, and total_record_count on catalog_entries_list were all still declared and permanently undefined. on_call_now keeps it -- it scans /v2/schedules, which really does return a total. runs_on_incidents offered two values the API rejects, in a dropdown and two model-facing descriptions. Vault offered an OWNER role the API refuses outright ('The role cannot be owner'), and described matters.delete as permanent when it is a reversible soft delete the same block exposes an undelete for.
1 parent eb1abb2 commit 2ad892d

16 files changed

Lines changed: 276 additions & 35 deletions

apps/sim/blocks/blocks/google_vault.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const GoogleVaultBlock: BlockConfig = {
104104
],
105105
delete_matters: [
106106
{
107-
text: 'Permanently delete matter',
107+
text: 'Delete matter',
108108
field: 'matterId',
109109
core: true,
110110
},
@@ -714,7 +714,6 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`,
714714
type: 'dropdown',
715715
options: [
716716
{ id: 'COLLABORATOR', label: 'Collaborator' },
717-
{ id: 'OWNER', label: 'Owner' },
718717
],
719718
condition: { field: 'operation', value: 'add_matters_permissions' },
720719
required: true,
@@ -941,7 +940,10 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`,
941940

942941
// Matter collaborator inputs
943942
accountId: { type: 'string', description: 'Admin SDK account ID for collaborator management' },
944-
role: { type: 'string', description: 'Matter permission role (COLLABORATOR or OWNER)' },
943+
role: {
944+
type: 'string',
945+
description: 'Matter permission role to grant. The API accepts COLLABORATOR only',
946+
},
945947
sendEmails: { type: 'boolean', description: 'Send a notification email to the added account' },
946948
ccMe: { type: 'boolean', description: 'CC the requestor on the notification email' },
947949

@@ -1135,9 +1137,9 @@ export const GoogleVaultBlockMeta = {
11351137
{
11361138
name: 'close-out-matter',
11371139
description:
1138-
'Wind down a resolved matter by closing it, and permanently delete it once retention requirements are satisfied.',
1140+
'Wind down a resolved matter by closing it, and delete it once retention requirements are satisfied.',
11391141
content:
1140-
'# Close Out Matter\n\nRetire a matter once the underlying investigation or litigation is resolved.\n\n## Steps\n1. List the holds on the matter and confirm none still need to be preserved; delete any holds that are no longer required.\n2. Close the matter.\n3. If the matter should be permanently removed and your retention policy allows it, delete the closed matter (reopen or undelete if this was done in error).\n\n## Output\nReturn the matterId, its final state, and which holds (if any) were deleted before close-out.',
1142+
'# Close Out Matter\n\nRetire a matter once the underlying investigation or litigation is resolved.\n\n## Steps\n1. List the holds on the matter and confirm none still need to be preserved; delete any holds that are no longer required.\n2. Close the matter.\n3. If the matter should be removed and your retention policy allows it, delete the closed matter. Deleting is reversible: the matter moves to the DELETED state and can be restored with undelete (or reopened) if this was done in error.\n\n## Output\nReturn the matterId, its final state, and which holds (if any) were deleted before close-out.',
11411143
},
11421144
{
11431145
name: 'manage-hold-scope',

apps/sim/blocks/blocks/incidentio.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,6 @@ Return ONLY the title - no explanations.`,
701701
options: [
702702
{ label: 'Newly Created', id: 'newly_created' },
703703
{ label: 'Newly Created and Active', id: 'newly_created_and_active' },
704-
{ label: 'Active', id: 'active' },
705-
{ label: 'All', id: 'all' },
706704
],
707705
value: () => 'newly_created',
708706
condition: {

apps/sim/tools/google_vault/add_matters_permissions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { safeUrlPathSegment } from '@/tools/url-path'
66
export const addMattersPermissionsTool: ToolConfig<GoogleVaultAddMatterPermissionsParams> = {
77
id: 'google_vault_add_matters_permissions',
88
name: 'Vault Add Matter Collaborator',
9-
description: 'Add a collaborator (or transfer ownership) to a matter',
9+
description: 'Add a collaborator to a matter',
1010
version: '1.0.0',
1111

1212
oauth: {
@@ -31,13 +31,13 @@ export const addMattersPermissionsTool: ToolConfig<GoogleVaultAddMatterPermissio
3131
type: 'string',
3232
required: true,
3333
visibility: 'user-or-llm',
34-
description: 'Admin SDK account ID of the user to add as a collaborator/owner',
34+
description: 'Admin SDK account ID of the user to add as a collaborator',
3535
},
3636
role: {
3737
type: 'string',
3838
required: true,
3939
visibility: 'user-only',
40-
description: 'Permission level to grant: COLLABORATOR or OWNER',
40+
description: 'Permission level to grant. The API accepts COLLABORATOR only',
4141
},
4242
sendEmails: {
4343
type: 'boolean',

apps/sim/tools/google_vault/delete_matters.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { safeUrlPathSegment } from '@/tools/url-path'
66
export const deleteMattersTool: ToolConfig<GoogleVaultMatterActionParams> = {
77
id: 'google_vault_delete_matters',
88
name: 'Vault Delete Matter',
9-
description: 'Permanently delete a matter (must be closed first)',
9+
description:
10+
'Soft-delete a matter (must be closed first). The matter moves to the DELETED state and can be restored with Undelete Matter',
1011
version: '1.0.0',
1112

1213
oauth: {
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* @vitest-environment node
3+
*
4+
* Verified against https://vault.googleapis.com/$discovery/rest?version=v1:
5+
*
6+
* - `AddMatterPermissionsRequest`: "Add an account with the permission specified. The role cannot
7+
* be owner." `OWNER` is on the `MatterPermission.role` resource enum (the read side) only, so
8+
* the request surface must not offer it.
9+
* - `matters.delete`: "Deletes the specified matter. Returns the matter with updated state." The
10+
* response is `$ref: Matter`, `Matter.state` includes `DELETED`, and `matters.undelete` exists
11+
* — so it is a reversible soft delete, not a permanent one.
12+
*/
13+
import { describe, expect, it } from 'vitest'
14+
import { GoogleVaultBlock } from '@/blocks/blocks/google_vault'
15+
import { addMattersPermissionsTool } from '@/tools/google_vault/add_matters_permissions'
16+
import { deleteMattersTool } from '@/tools/google_vault/delete_matters'
17+
18+
/** Every string the block renders in the canvas sentence for one operation. */
19+
function canvasSentenceFor(operation: string): string {
20+
const byOperation = (GoogleVaultBlock.canvasPresentation?.sentences as any)?.byOperation ?? {}
21+
const entries = byOperation[operation] ?? []
22+
expect(entries.length).toBeGreaterThan(0)
23+
return entries
24+
.map((entry: unknown) => (typeof entry === 'string' ? entry : ((entry as any)?.text ?? '')))
25+
.join(' ')
26+
}
27+
28+
describe('the matter-permission surface does not offer the role the API refuses', () => {
29+
it('the block role dropdown lists COLLABORATOR only', () => {
30+
const subBlock = GoogleVaultBlock.subBlocks.find((entry) => entry.id === 'role')
31+
expect(subBlock).toBeDefined()
32+
33+
const ids = (subBlock?.options as Array<{ id: string }>).map((option) => option.id)
34+
expect(ids).toEqual(['COLLABORATOR'])
35+
})
36+
37+
it('the role param description does not advertise OWNER', () => {
38+
const description = addMattersPermissionsTool.params.role.description ?? ''
39+
40+
expect(description).toContain('COLLABORATOR')
41+
expect(description.toUpperCase()).not.toContain('OWNER')
42+
})
43+
44+
it('the block role input description does not advertise OWNER', () => {
45+
const description = (GoogleVaultBlock.inputs as any).role?.description ?? ''
46+
47+
expect(description.toUpperCase()).not.toContain('OWNER')
48+
})
49+
50+
it('the tool description does not promise ownership transfer', () => {
51+
expect(addMattersPermissionsTool.description.toLowerCase()).not.toContain('owner')
52+
})
53+
})
54+
55+
describe('deleting a matter is described as the reversible soft delete it is', () => {
56+
it('the tool description does not call the delete permanent', () => {
57+
const description = deleteMattersTool.description.toLowerCase()
58+
59+
expect(description).not.toContain('permanent')
60+
})
61+
62+
it('the block canvas sentence does not call the delete permanent', () => {
63+
expect(canvasSentenceFor('delete_matters').toLowerCase()).not.toContain('permanent')
64+
})
65+
66+
it('the block still exposes the undelete operation that makes it reversible', () => {
67+
const operation = GoogleVaultBlock.subBlocks.find((entry) => entry.id === 'operation')
68+
const ids = (operation?.options as Array<{ id: string }>).map((option) => option.id)
69+
70+
expect(ids).toContain('undelete_matters')
71+
})
72+
})

apps/sim/tools/google_vault/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ export interface GoogleVaultAddMatterPermissionsParams {
8484
accessToken: string
8585
matterId: string
8686
accountId: string
87-
role: 'COLLABORATOR' | 'OWNER'
87+
/** `AddMatterPermissionsRequest`: "The role cannot be owner." */
88+
role: 'COLLABORATOR'
8889
sendEmails?: boolean
8990
ccMe?: boolean
9091
}

apps/sim/tools/incidentio/catalog_entries_list.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ export const catalogEntriesListTool: ToolConfig<
133133
properties: {
134134
after: { type: 'string', description: 'Cursor for next page', optional: true },
135135
page_size: { type: 'number', description: 'Number of results per page' },
136-
total_record_count: {
137-
type: 'number',
138-
description: 'Total number of entries',
139-
optional: true,
140-
},
141136
},
142137
},
143138
},

apps/sim/tools/incidentio/incidents_create.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export const incidentsCreateTool: ToolConfig<
101101
id: incident.id,
102102
name: incident.name,
103103
summary: incident.summary,
104-
description: incident.description,
105104
mode: incident.mode,
106105
call_url: incident.call_url,
107106
severity: incident.severity
@@ -143,8 +142,7 @@ export const incidentsCreateTool: ToolConfig<
143142
properties: {
144143
id: { type: 'string', description: 'Incident ID' },
145144
name: { type: 'string', description: 'Incident name' },
146-
summary: { type: 'string', description: 'Brief summary of the incident' },
147-
description: { type: 'string', description: 'Detailed description of the incident' },
145+
summary: { type: 'string', description: 'Detailed description of the incident' },
148146
mode: { type: 'string', description: 'Incident mode (e.g., standard, retrospective)' },
149147
call_url: { type: 'string', description: 'URL for the incident call/bridge' },
150148
severity: {

apps/sim/tools/incidentio/incidents_list.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export const incidentsListTool: ToolConfig<
9292
id: incident.id,
9393
name: incident.name,
9494
summary: incident.summary,
95-
description: incident.description,
9695
mode: incident.mode,
9796
call_url: incident.call_url,
9897
severity: incident.severity

apps/sim/tools/incidentio/incidents_show.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export const incidentsShowTool: ToolConfig<
5050
id: incident.id,
5151
name: incident.name,
5252
summary: incident.summary,
53-
description: incident.description,
5453
mode: incident.mode,
5554
call_url: incident.call_url,
5655
permalink: incident.permalink,
@@ -118,8 +117,7 @@ export const incidentsShowTool: ToolConfig<
118117
properties: {
119118
id: { type: 'string', description: 'Incident ID' },
120119
name: { type: 'string', description: 'Incident name' },
121-
summary: { type: 'string', description: 'Brief summary of the incident' },
122-
description: { type: 'string', description: 'Detailed description of the incident' },
120+
summary: { type: 'string', description: 'Detailed description of the incident' },
123121
mode: { type: 'string', description: 'Incident mode (e.g., standard, retrospective)' },
124122
call_url: { type: 'string', description: 'URL for the incident call/bridge' },
125123
permalink: { type: 'string', description: 'Permanent link to the incident' },

0 commit comments

Comments
 (0)