@@ -124,7 +124,7 @@ try {
124124 await repo . upsertAsyncToolCall ( { runId : run . id , toolCallId, toolName : 'run_code' } )
125125 await repo . updateRunStatus ( run . id , status , { completedAt : new Date ( ) } )
126126 assert . equal (
127- ( await repo . claimSimToolExecution ( { runId : run . id , toolCallId, userId : 'user-1' } ) ) . outcome ,
127+ ( await repo . claimToolExecution ( { runId : run . id , toolCallId, userId : 'user-1' } ) ) . outcome ,
128128 'closed'
129129 )
130130 await repo . updateRunStatus ( run . id , 'paused_waiting_for_tool' )
@@ -142,7 +142,7 @@ try {
142142 toolCallId : ownerTool . toolCallId ,
143143 toolName : 'run_code' ,
144144 } )
145- assert . equal ( ( await repo . claimSimToolExecution ( ownerTool ) ) . outcome , 'claimed' )
145+ assert . equal ( ( await repo . claimToolExecution ( ownerTool ) ) . outcome , 'claimed' )
146146 const commandIdentity = {
147147 id : generateId ( ) ,
148148 sandboxId : 'recorded-sandbox' ,
@@ -180,7 +180,7 @@ try {
180180 toolName : 'run_code' ,
181181 } )
182182 const [ claim ] = await Promise . all ( [
183- repo . claimSimToolExecution ( tool ) ,
183+ repo . claimToolExecution ( tool ) ,
184184 repo . updateRunStatus ( run . id , 'complete' ) ,
185185 ] )
186186 assert . equal (
@@ -207,12 +207,12 @@ try {
207207 const workbenchChatId = await createWorkbenchChat ( )
208208 const sessionKey = `mothership-chat:${ workbenchChatId } `
209209 const prior = await createWorkbenchTool ( workbenchChatId , 'workbench-prior' )
210- assert . equal ( ( await repo . claimSimToolExecution ( prior ) ) . outcome , 'claimed' )
210+ assert . equal ( ( await repo . claimToolExecution ( prior ) ) . outcome , 'claimed' )
211211 const priorCommand = { id : generateId ( ) , sandboxId : 'workbench-vm' , sessionKey }
212212 await repo . recordSimSandboxProcess ( { ...prior , process : priorCommand } )
213213 await repo . updateRunStatus ( prior . runId , 'complete' )
214214 const current = await createWorkbenchTool ( workbenchChatId , 'workbench-current' )
215- assert . equal ( ( await repo . claimSimToolExecution ( current ) ) . outcome , 'claimed' )
215+ assert . equal ( ( await repo . claimToolExecution ( current ) ) . outcome , 'claimed' )
216216 const access = { ...current , sessionKey }
217217 assert . deepEqual ( await repo . prepareWorkbenchAccess ( access ) , {
218218 handlersPending : true ,
@@ -229,7 +229,7 @@ try {
229229 await assert . rejects ( repo . prepareWorkbenchAccess ( { ...prior , sessionKey } ) )
230230 const sibling = { ...current , toolCallId : 'workbench-sibling' }
231231 await repo . upsertAsyncToolCall ( { ...sibling , toolName : 'run_code' } )
232- assert . equal ( ( await repo . claimSimToolExecution ( sibling ) ) . outcome , 'claimed' )
232+ assert . equal ( ( await repo . claimToolExecution ( sibling ) ) . outcome , 'claimed' )
233233 const siblingCommand = { ...priorCommand , id : generateId ( ) }
234234 await repo . recordSimSandboxProcess ( { ...sibling , process : siblingCommand } )
235235 assert . deepEqual ( await repo . prepareWorkbenchAccess ( access ) , ready )
@@ -252,7 +252,7 @@ try {
252252 await repo . settleSimToolExecution ( sibling . toolCallId )
253253 const nextTool = { runId : emptyNext . id , userId : 'user-1' , toolCallId : 'workbench-next-tool' }
254254 await repo . upsertAsyncToolCall ( { ...nextTool , toolName : 'run_code' } )
255- assert . equal ( ( await repo . claimSimToolExecution ( nextTool ) ) . outcome , 'claimed' )
255+ assert . equal ( ( await repo . claimToolExecution ( nextTool ) ) . outcome , 'claimed' )
256256 assert . deepEqual ( await repo . prepareWorkbenchAccess ( { ...nextTool , sessionKey } ) , {
257257 handlersPending : false ,
258258 processes : [ { ...siblingCommand , toolCallId : sibling . toolCallId } ] ,
@@ -266,14 +266,14 @@ try {
266266 const raceChatId = await createWorkbenchChat ( )
267267 const older = await createWorkbenchTool ( raceChatId , `workbench-race-old-${ i } ` )
268268 const newer = await createWorkbenchTool ( raceChatId , `workbench-race-new-${ i } ` )
269- assert . equal ( ( await repo . claimSimToolExecution ( newer ) ) . outcome , 'claimed' )
269+ assert . equal ( ( await repo . claimToolExecution ( newer ) ) . outcome , 'claimed' )
270270 const [ claim , state ] = await Promise . all ( [
271- repo . claimSimToolExecution ( older ) ,
271+ repo . claimToolExecution ( older ) ,
272272 repo . prepareWorkbenchAccess ( { ...newer , sessionKey : `mothership-chat:${ raceChatId } ` } ) ,
273273 ] )
274274 assert . deepEqual ( state , { handlersPending : claim . outcome === 'claimed' , processes : [ ] } )
275275 assert . equal (
276- ( await repo . claimSimToolExecution ( { ...older , toolCallId : 'late' } ) ) . outcome ,
276+ ( await repo . claimToolExecution ( { ...older , toolCallId : 'late' } ) ) . outcome ,
277277 'closed'
278278 )
279279 await assert . rejects (
@@ -283,11 +283,11 @@ try {
283283 logger . info ( 'PASS thirty predecessor-claim/workbench-takeover races without false readiness' )
284284 const corruptChatId = await createWorkbenchChat ( )
285285 const corruptOwner = await createWorkbenchTool ( corruptChatId , 'workbench-corrupt-owner' )
286- assert . equal ( ( await repo . claimSimToolExecution ( corruptOwner ) ) . outcome , 'claimed' )
286+ assert . equal ( ( await repo . claimToolExecution ( corruptOwner ) ) . outcome , 'claimed' )
287287 const corruptCommand = { id : generateId ( ) , sandboxId : 'foreign' , sessionKey : 'another-chat' }
288288 await repo . recordSimSandboxProcess ( { ...corruptOwner , process : corruptCommand } )
289289 const successor = await createWorkbenchTool ( corruptChatId , 'workbench-corrupt-successor' )
290- assert . equal ( ( await repo . claimSimToolExecution ( successor ) ) . outcome , 'claimed' )
290+ assert . equal ( ( await repo . claimToolExecution ( successor ) ) . outcome , 'claimed' )
291291 const successorAccess = { ...successor , sessionKey : `mothership-chat:${ corruptChatId } ` }
292292 await assert . rejects ( repo . prepareWorkbenchAccess ( successorAccess ) , / d o e s n o t m a t c h t h i s c h a t / )
293293 assert . equal (
@@ -334,7 +334,7 @@ try {
334334 } )
335335 assert . equal (
336336 (
337- await repo . claimSimToolExecution ( {
337+ await repo . claimToolExecution ( {
338338 runId : delayed . id ,
339339 toolCallId : 'late-tool' ,
340340 userId : 'user-1' ,
0 commit comments