( requestId: string, reason: string, )
| 399 | } |
| 400 | |
| 401 | async function handleShutdownRejection( |
| 402 | requestId: string, |
| 403 | reason: string, |
| 404 | ): Promise<{ data: ResponseOutput }> { |
| 405 | const teamName = getTeamName() |
| 406 | const agentName = getAgentName() || 'teammate' |
| 407 | |
| 408 | const rejectedMessage = createShutdownRejectedMessage({ |
| 409 | requestId, |
| 410 | from: agentName, |
| 411 | reason, |
| 412 | }) |
| 413 | |
| 414 | await writeToMailbox( |
| 415 | TEAM_LEAD_NAME, |
| 416 | { |
| 417 | from: agentName, |
| 418 | text: jsonStringify(rejectedMessage), |
| 419 | timestamp: new Date().toISOString(), |
| 420 | color: getTeammateColor(), |
| 421 | }, |
| 422 | teamName, |
| 423 | ) |
| 424 | |
| 425 | return { |
| 426 | data: { |
| 427 | success: true, |
| 428 | message: `Shutdown rejected. Reason: "${reason}". Continuing to work.`, |
| 429 | request_id: requestId, |
| 430 | }, |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | async function handlePlanApproval( |
| 435 | recipientName: string, |
no test coverage detected