@sentry/junior 0.262.0 → 0.263.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-t-Y9RHML.js → adapter-BIacI0Bt.js} +1 -1
- package/dist/{admin-BCqeFndQ.js → admin-C7vUk7s9.js} +1 -1
- package/dist/{agent-hooks-9q2zdKHL.js → agent-hooks-CqnZfuCt.js} +73 -32
- package/dist/{agent-runner-Cx6NO5LE.js → agent-runner-BUBas7Yy.js} +123 -733
- package/dist/api/schema.d.ts +4 -0
- package/dist/api/schema.js +3 -3
- package/dist/api.js +28 -27
- package/dist/app.js +30 -29
- package/dist/{assistant-reply-B2qUBAwL.js → assistant-reply-BFmjgJjD.js} +1 -1
- package/dist/{automation-DrpcA-SX.js → automation-CWX0qL8U.js} +1 -1
- package/dist/{briefs-DsGH2Vym.js → briefs-h55v5lX9.js} +4 -4
- package/dist/{catalog-runtime-CfwKT0sn.js → catalog-runtime-Suf-aLlh.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-DpfjZgNk.js → client-DZBCBj1M.js} +2 -2
- package/dist/{config-BiCtNiu5.js → config-Dnv8KmNs.js} +2 -2
- package/dist/{connections-D9IKbfk-.js → connections-Br0_xv27.js} +10 -10
- package/dist/{conversation-CvuKJ3tA.js → conversation-B0baEwoA.js} +2 -0
- package/dist/{conversation-privacy-CBUI0frD.js → conversation-privacy-FY8yc2q3.js} +1 -1
- package/dist/{credential-sync-Bu6ZOuOk.js → credential-sync-BvkiyWF5.js} +14 -14
- package/dist/{executor-O8xqLDN6.js → executor-J9k2sp9m.js} +2 -2
- package/dist/{images-AM1exvU0.js → images-DV2FlEGL.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-DmarAQGI.js → job-queue-B4yTgklN.js} +1 -1
- package/dist/{logging-dZN1Bvtu.js → logging-Dk_FpF36.js} +1 -1
- package/dist/{message-C_g2S8kv.js → message-BzseAFH1.js} +4 -3
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-DvvOvr4q.js → oauth-callback-server-bTspTMCC.js} +2 -2
- package/dist/{profile-BP2N5uDY.js → profile-Dq5I7TV1.js} +3 -3
- package/dist/{prompt-DeVax2qO.js → prompt-CxatQVaj.js} +1 -1
- package/dist/{registry-BUje_knT.js → registry-BFzQFV_y.js} +1 -1
- package/dist/{resolve-DftZiYNU.js → resolve-CnRHib0U.js} +3 -3
- package/dist/{result-CRMRT9CE.js → result-DczfmNBa.js} +8 -7
- package/dist/{runner-4mmL2Pt1.js → runner-CJd9Wec-.js} +11 -11
- package/dist/{sandbox-egress-signals-1ysv0z5A.js → sandbox-egress-signals-DUmVkOx4.js} +1 -1
- package/dist/{schema-XuTZukI9.js → schema-QidbykYl.js} +2 -2
- package/dist/{service-account-B1sH3P7d.js → service-account-BI2kQDrb.js} +3 -3
- package/dist/{service-account-Del2I_x3.js → service-account-x2QZXm4X.js} +3 -3
- package/dist/{session-stop-ZuyOHxdK.js → session-stop-CtyJsnEj.js} +11 -11
- package/dist/{skills-lPeepA2b.js → skills-Dbzx9-rS.js} +2 -2
- package/dist/{spawn-DovpdlrW.js → spawn-D8WU99UV.js} +2 -2
- package/dist/store-TKg1HVKx.js +697 -0
- package/dist/{store-dZynGGFW.js → store-UlOrW6JC.js} +6 -6
- package/dist/{task-queue-CmMCtzHO.js → task-queue-BRB49H-J.js} +3 -3
- package/dist/{task-runner-BRgJ5e0s.js → task-runner-C575f2Dd.js} +10 -10
- package/dist/{tasks-Bh2qYaed.js → tasks-LOItiYgL.js} +42 -53
- package/dist/{thread-state-DA37FsAT.js → thread-state-IDHdZA7R.js} +5 -5
- package/dist/{turn-failure-response-BLcscQ-f.js → turn-failure-response-h_LSXJ-M.js} +46 -20
- package/dist/{turn-lifecycle-D0e887FM.js → turn-lifecycle-Cvi6Sb8Y.js} +1 -1
- package/dist/{turn-session-routing-DdbSbJS6.js → turn-session-routing-5Nyv4fso.js} +1 -1
- package/dist/{validation-DtcovXqq.js → validation-BeTriWC2.js} +1 -1
- package/dist/{version-JcDaJ75p.js → version-BQX_hLDC.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-oMTUVAcR.js → viewer-DmNRM88V.js} +3 -3
- package/dist/{web-input-FQ5wgqYn.js → web-input-BHcGXSox.js} +96 -35
- package/dist/{work-BiIKfayl.js → work-DLJMV02b.js} +10 -9
- package/dist/{worker-BZ7l75NM.js → worker-vfG2ESg1.js} +5 -5
- package/package.json +5 -5
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as completeText, p as escapeXml, r as completeDecision, y as isProviderRetryError } from "./client-
|
|
3
|
-
import { B as toOptionalNumber, T as withSpan, V as toOptionalString, d as logError, f as logException, m as logWarn, n as createChatSdkLogger, o as getActiveTraceId, p as logInfo, t as buildTurnFailureResponse, v as setSentryUser, w as withLogContext, x as setTags, y as setSpanAttributes, z as isRecord } from "./logging-
|
|
4
|
-
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-
|
|
1
|
+
import { $ as persistConversationMessageSummaries, A as commitAcceptedReply, At as abandonTurnRecord, Bn as normalizeSlackReplyMarkdown, Bt as buildTurnErrorResponse, E as sameDefinitionValue, Et as wasPendingAuthStopped, F as loadProjection, Ft as recordTurnSummary, H as recordAuthorizationCompleted, Jn as removeReactionFromMessage, K as recordSubscribedReplyRoute, Mt as failTurnRecord, N as loadConversationProjection, Nt as getTurnRecord, Ot as loadTurnCheckpoint, Pt as listTurnSummaries, Rn as escapeSlackMrkdwnText, S as automationDefinition, Un as truncateStatusText, Ut as persistWithRetry, Vn as normalizeSlackStatusText, Wn as addReactionToMessage, X as hydrateConversationMessages, Z as persistConversationMessages, _ as parseEventAutomationRow, _n as isExperimentalFeatureEnabled, at as buildConversationContext, bn as createUserTokenStore, bt as AuthorizationFlowDisabledError, c as withScheduledAutomationLock, cn as buildDeterministicTurnId, ct as getConversationMessageSlackTs, dn as getSubscribedReplyPreflightDecision, dt as normalizeConversationText, et as resolveConversationTitle, f as deleteEventAutomation, fn as getThreadStopDecision, ft as recordDeliveredAssistantMessage, gt as PluginCredentialFailureError, h as listDeletedEventAutomationsCreatedBy, i as readScheduledAutomation, it as appendThreadContextMessages, j as commitMessages, jt as completeTurnRecord, kt as saveTurnCheckpoint, lt as isHumanConversationMessage, mt as upsertConversationMessage, nt as fallbackShortTitle, o as saveScheduledAutomationInLock, ot as createConversationMemoryService, pt as turnHasReply, qn as postSlackMessage, r as parseScheduledAutomationRow, rn as trimTrailingAssistantMessages, sn as buildDeterministicAssistantMessageId, st as estimateConversationContextTokens, tr as configValueSchema, un as decideSubscribedThreadReply, ut as markConversationMessage, w as listAutomationVersions, wt as clearPendingAuth, zn as formatSlackLink } from "./tasks-LOItiYgL.js";
|
|
2
|
+
import { a as completeText, p as escapeXml, r as completeDecision, y as isProviderRetryError } from "./client-DZBCBj1M.js";
|
|
3
|
+
import { B as toOptionalNumber, T as withSpan, V as toOptionalString, d as logError, f as logException, m as logWarn, n as createChatSdkLogger, o as getActiveTraceId, p as logInfo, t as buildTurnFailureResponse, v as setSentryUser, w as withLogContext, x as setTags, y as setSpanAttributes, z as isRecord } from "./logging-Dk_FpF36.js";
|
|
4
|
+
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-Dnv8KmNs.js";
|
|
5
5
|
import { o as modelIdForProfile, r as defaultModelId } from "./model-profile-Bg8EoCKD.js";
|
|
6
6
|
import { a as isUserActor, g as parseSlackMessageTs, i as isActorUserId, l as parseSlackChannelId, n as createSlackActor, o as parseActorUserId, r as createSlackResumeActor, t as createActor } from "./actor-tlxzqaRe.js";
|
|
7
|
-
import { L as createSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore, z as requireSlackDestination } from "./viewer-
|
|
7
|
+
import { L as createSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore, z as requireSlackDestination } from "./viewer-DmNRM88V.js";
|
|
8
8
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers } from "./agent-invocations-CxKldAeB.js";
|
|
9
|
-
import { a as juniorAutomationRuns, s as juniorAutomations } from "./executor-
|
|
9
|
+
import { a as juniorAutomationRuns, s as juniorAutomations } from "./executor-J9k2sp9m.js";
|
|
10
10
|
import { p as instructionProvenanceFor } from "./history-AY8rs-FR.js";
|
|
11
|
-
import { d as actorLogContext, f as credentialContextForActor } from "./registry-
|
|
12
|
-
import { A as listThreadReplies,
|
|
13
|
-
import { Bt as
|
|
14
|
-
import { a as acquireActiveLock, i as MUTATION_LOCK_TTL_MS, r as getStateAdapter, s as withLock } from "./adapter-
|
|
15
|
-
import { B as readMessageAttachments, U as isVisionImageMediaType } from "./conversation-
|
|
16
|
-
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
11
|
+
import { d as actorLogContext, f as credentialContextForActor } from "./registry-BFzQFV_y.js";
|
|
12
|
+
import { A as listThreadReplies, D as resolveSlackChannelIdFromMessage, E as readSlackRawMessageContext, I as eventAutomationTriggerAvailable, L as effectiveTaskOutcomes, O as resolveSlackChannelIdFromThreadId, T as parseSlackThreadId, X as withoutSavedSteeringMessages, Y as buildSteeringPiMessage, Z as RetryableDeliveryError, b as renderBlockText, i as buildAuthPauseResponse, k as getConversationInfo, n as executeAgentRun, p as latestProgressStatus, r as createContextCompactor, t as createAgentRunner, tt as shouldEmitDevAgentTrace, w as storeAttachment, y as renderAttachmentText } from "./agent-runner-BUBas7Yy.js";
|
|
13
|
+
import { Bt as getSlackFileId, Ht as readAttachmentVisionSummary, Ut as recordSlackAttachment, V as cancelSubscriptions, Zt as lookupSlackUser, _t as getDashboardConversationLink, at as downloadPrivateSlackFile, ct as getSlackClient, dt as normalizeSlackConversationId, ft as runWithSlackInstallationToken, gt as JUNIOR_THREAD_STATE_TTL_MS, it as SlackActionError, o as getPluginSlackConversationLink, rt as verifyTimerWatchCredentialSubject, st as getHeaderString, ut as isDmChannel, vt as getDashboardObjectIconLink, zt as buildSentryConversationUrl } from "./agent-hooks-CqnZfuCt.js";
|
|
14
|
+
import { a as acquireActiveLock, i as MUTATION_LOCK_TTL_MS, r as getStateAdapter, s as withLock } from "./adapter-BIacI0Bt.js";
|
|
15
|
+
import { B as readMessageAttachments, U as isVisionImageMediaType } from "./conversation-B0baEwoA.js";
|
|
16
|
+
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-CxatQVaj.js";
|
|
17
|
+
import { B as ConversationTurnBoundaryError, G as isCooperativeTurnYieldError, H as TurnInputCommitLostError, J as markTurnClosed, K as isTurnInputCommitLostError, U as TurnInputDeferredError, V as CooperativeTurnYieldError, W as getConversationTurnBoundaryError, X as markTurnFailed, Y as markTurnCompleted, Z as startActiveTurn, q as isTurnInputDeferredError } from "./store-TKg1HVKx.js";
|
|
18
|
+
import { n as getAssistantReplyText } from "./assistant-reply-BFmjgJjD.js";
|
|
19
|
+
import { H as runDispatchOutcome, N as maybePostAutomatedTurnLimitNotice, P as recordFinishedTurnForAutomatedLimit, R as deliversFinalText, c as isEventMailboxMetadata, d as getEventCatalog, i as skipInputBeforeConversationStop, j as joinMailboxText, l as renderEventBatchText, s as eventBatchMessageEvents, u as timerWatchCredentialSubject, x as automationEventCatalog, z as finishedRunReply } from "./session-stop-CtyJsnEj.js";
|
|
20
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-B4yTgklN.js";
|
|
21
|
+
import { E as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, n as appendAndEnqueueExclusiveInboundMessage, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-UlOrW6JC.js";
|
|
22
|
+
import { l as automationListQuerySchema } from "./automation-CWX0qL8U.js";
|
|
22
23
|
import { c as sumUtcHoursIntoSixHours, m as healthReportSchema, t as webMessageId } from "./web-message-id-CJSUiksE.js";
|
|
23
|
-
import { A as readAutomationExecutions, D as readAutomationExecutionStatusDays, E as readAutomationExecutionHours, O as readAutomationExecutionStatusHours, S as emptyAutomationRunWindows, T as readAutomationExecutionDays, _ as markDispatchBlocked, a as claimDispatchMailboxAppend, b as markDispatchRunning, c as getDispatchConversationId, d as getDispatchRecord, f as getDispatchTurnId, g as markDispatchAwaitingResume, j as readAutomationRuns, k as readAutomationExecutionSummaries, l as getDispatchIdForConversation, m as isTerminalDispatchStatus, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, t as processPluginTask, u as getDispatchInputMessageId, v as markDispatchCompleted, w as readAutomationExecutionByConversationId, y as markDispatchFailed } from "./task-runner-
|
|
24
|
-
import { a as withAgentInvocationResultActors, c as resolveMailboxTurnWork, i as startAgentInvocationsForChildInput, l as sourceFromTurnInput, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as enqueueAgentInvocationResult, u as turnInputFactsFromConversationMessage } from "./result-
|
|
25
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
26
|
-
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-
|
|
27
|
-
import { a as persistThreadState, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
28
|
-
import { c as deleteWebAuthorization, d as createPausedTurns, f as getPausedTurnRequest, h as getTurnAuthorization, m as wakePausedTurn, s as createWebAuthorization } from "./connections-
|
|
29
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
30
|
-
import { t as bindMessageAgent } from "./message-
|
|
31
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
32
|
-
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-
|
|
33
|
-
import { r as storeInputImages } from "./images-
|
|
24
|
+
import { A as readAutomationExecutions, D as readAutomationExecutionStatusDays, E as readAutomationExecutionHours, O as readAutomationExecutionStatusHours, S as emptyAutomationRunWindows, T as readAutomationExecutionDays, _ as markDispatchBlocked, a as claimDispatchMailboxAppend, b as markDispatchRunning, c as getDispatchConversationId, d as getDispatchRecord, f as getDispatchTurnId, g as markDispatchAwaitingResume, j as readAutomationRuns, k as readAutomationExecutionSummaries, l as getDispatchIdForConversation, m as isTerminalDispatchStatus, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, t as processPluginTask, u as getDispatchInputMessageId, v as markDispatchCompleted, w as readAutomationExecutionByConversationId, y as markDispatchFailed } from "./task-runner-C575f2Dd.js";
|
|
25
|
+
import { a as withAgentInvocationResultActors, c as resolveMailboxTurnWork, i as startAgentInvocationsForChildInput, l as sourceFromTurnInput, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as enqueueAgentInvocationResult, u as turnInputFactsFromConversationMessage } from "./result-DczfmNBa.js";
|
|
26
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-Cvi6Sb8Y.js";
|
|
27
|
+
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-DLJMV02b.js";
|
|
28
|
+
import { a as persistThreadState, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-IDHdZA7R.js";
|
|
29
|
+
import { c as deleteWebAuthorization, d as createPausedTurns, f as getPausedTurnRequest, h as getTurnAuthorization, m as wakePausedTurn, s as createWebAuthorization } from "./connections-Br0_xv27.js";
|
|
30
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-5Nyv4fso.js";
|
|
31
|
+
import { t as bindMessageAgent } from "./message-BzseAFH1.js";
|
|
32
|
+
import { t as bindSpawnAgent } from "./spawn-D8WU99UV.js";
|
|
33
|
+
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-h_LSXJ-M.js";
|
|
34
|
+
import { r as storeInputImages } from "./images-DV2FlEGL.js";
|
|
34
35
|
import { z } from "zod";
|
|
35
36
|
import { createHash } from "node:crypto";
|
|
36
37
|
import { and, asc, count, desc, eq, exists, inArray, ne, or, sql } from "drizzle-orm";
|
|
@@ -6376,6 +6377,13 @@ async function failStrandedTurnWithFallback(args) {
|
|
|
6376
6377
|
"app.ai.conversation_id": args.conversationId,
|
|
6377
6378
|
"app.ai.session_id": failed.turnId
|
|
6378
6379
|
});
|
|
6380
|
+
await getTurnLifecycle().fail({
|
|
6381
|
+
conversationId: args.conversationId,
|
|
6382
|
+
createdAtMs: Date.now(),
|
|
6383
|
+
...eventId ? { eventId } : void 0,
|
|
6384
|
+
failureCode: "agent_run_failed",
|
|
6385
|
+
turnId: failed.turnId
|
|
6386
|
+
});
|
|
6379
6387
|
let routing;
|
|
6380
6388
|
try {
|
|
6381
6389
|
routing = await resolveTurnSessionRouting({ conversationId: args.conversationId });
|
|
@@ -6406,12 +6414,49 @@ async function failStrandedTurnWithFallback(args) {
|
|
|
6406
6414
|
});
|
|
6407
6415
|
return true;
|
|
6408
6416
|
}
|
|
6417
|
+
/** Recovery resumes a turn at most once after its worker stops checking in. */
|
|
6418
|
+
const MAX_LOST_WORKER_RESUMES = 1;
|
|
6419
|
+
const LOST_WORKER_FAILURE = "Turn lost its worker before reaching a safe boundary";
|
|
6420
|
+
/**
|
|
6421
|
+
* Saved on the paused turn when recovery resumes it. The resumed run replaces
|
|
6422
|
+
* it at its first save.
|
|
6423
|
+
*/
|
|
6424
|
+
const LOST_WORKER_RESUME_MESSAGE = "Turn lost its worker; resuming from its last boundary";
|
|
6425
|
+
/** True when a resumed turn lost its worker again before it saved anything. */
|
|
6426
|
+
function lostWorkerBeforeFirstSave(turn) {
|
|
6427
|
+
return turn.errorMessage === "Turn lost its worker; resuming from its last boundary" && (turn.lostWorkerResumeCount ?? 0) >= MAX_LOST_WORKER_RESUMES;
|
|
6428
|
+
}
|
|
6429
|
+
/**
|
|
6430
|
+
* Pause a turn whose worker stopped checking in, so it resumes from its last
|
|
6431
|
+
* save. Returns false when the turn already used its resume or has no slice
|
|
6432
|
+
* left.
|
|
6433
|
+
*/
|
|
6434
|
+
async function pauseLostWorkerTurn(turn) {
|
|
6435
|
+
if ((turn.lostWorkerResumeCount ?? 0) >= MAX_LOST_WORKER_RESUMES || turn.sliceId + 1 > botConfig.maxSlicesPerTurn) return false;
|
|
6436
|
+
const paused = await saveTurnCheckpoint({
|
|
6437
|
+
mode: "paused",
|
|
6438
|
+
reason: "retry",
|
|
6439
|
+
conversationId: turn.conversationId,
|
|
6440
|
+
turnId: turn.turnId,
|
|
6441
|
+
sliceId: turn.sliceId,
|
|
6442
|
+
messages: turn.piMessages,
|
|
6443
|
+
lostWorkerResumeCount: (turn.lostWorkerResumeCount ?? 0) + 1,
|
|
6444
|
+
errorMessage: LOST_WORKER_RESUME_MESSAGE
|
|
6445
|
+
});
|
|
6446
|
+
if (!paused) return false;
|
|
6447
|
+
logWarn("agent.turn.lost_worker.resumed", {
|
|
6448
|
+
"app.ai.conversation_id": turn.conversationId,
|
|
6449
|
+
"app.ai.session_id": turn.turnId,
|
|
6450
|
+
"app.ai.resume_slice_id": paused.sliceId
|
|
6451
|
+
});
|
|
6452
|
+
return true;
|
|
6453
|
+
}
|
|
6409
6454
|
/** Resume the first valid paused Slack session for an idle conversation. */
|
|
6410
6455
|
async function runNextPausedTurn(conversationId, options, runOptions = {}) {
|
|
6411
6456
|
return withLogContext({ conversationId }, () => runNextPausedTurnInContext(conversationId, options, runOptions));
|
|
6412
6457
|
}
|
|
6413
6458
|
async function runNextPausedTurnInContext(conversationId, options, runOptions) {
|
|
6414
|
-
|
|
6459
|
+
let summaries = await listTurnSummaries(conversationId);
|
|
6415
6460
|
const persisted = await getPersistedThreadState(conversationId);
|
|
6416
6461
|
const conversation = coerceThreadConversationState(persisted);
|
|
6417
6462
|
await hydrateConversationMessages({
|
|
@@ -6420,6 +6465,7 @@ async function runNextPausedTurnInContext(conversationId, options, runOptions) {
|
|
|
6420
6465
|
});
|
|
6421
6466
|
const newest = summaries[0];
|
|
6422
6467
|
const running = newest ? await getTurnRecord(conversationId, newest.turnId) : void 0;
|
|
6468
|
+
let resumedTurnId;
|
|
6423
6469
|
if (running?.state === "running") {
|
|
6424
6470
|
if (turnHasReply(conversation, running.turnId)) {
|
|
6425
6471
|
const acceptedReply = [...conversation.messages].reverse().find((message) => message.role === "assistant" && message.id.startsWith(`${running.turnId}:assistant:`));
|
|
@@ -6437,15 +6483,30 @@ async function runNextPausedTurnInContext(conversationId, options, runOptions) {
|
|
|
6437
6483
|
await persistThreadStateById(conversationId, { conversation });
|
|
6438
6484
|
return false;
|
|
6439
6485
|
}
|
|
6440
|
-
await
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6486
|
+
if (!await pauseLostWorkerTurn(running)) {
|
|
6487
|
+
await failStrandedTurnWithFallback({
|
|
6488
|
+
conversationId,
|
|
6489
|
+
errorMessage: LOST_WORKER_FAILURE,
|
|
6490
|
+
turn: running
|
|
6491
|
+
});
|
|
6492
|
+
return false;
|
|
6493
|
+
}
|
|
6494
|
+
resumedTurnId = running.turnId;
|
|
6495
|
+
summaries = await listTurnSummaries(conversationId);
|
|
6446
6496
|
}
|
|
6447
6497
|
for (const summary of summaries) {
|
|
6448
6498
|
if (!isPausedTurn(summary)) continue;
|
|
6499
|
+
if (summary.turnId !== resumedTurnId && summary.resumeReason === "retry") {
|
|
6500
|
+
const turn = await getTurnRecord(conversationId, summary.turnId);
|
|
6501
|
+
if (turn && lostWorkerBeforeFirstSave(turn)) {
|
|
6502
|
+
await failStrandedTurnWithFallback({
|
|
6503
|
+
conversationId,
|
|
6504
|
+
errorMessage: LOST_WORKER_FAILURE,
|
|
6505
|
+
turn
|
|
6506
|
+
});
|
|
6507
|
+
continue;
|
|
6508
|
+
}
|
|
6509
|
+
}
|
|
6449
6510
|
const request = await getPausedTurnRequest({
|
|
6450
6511
|
conversationId,
|
|
6451
6512
|
turnId: summary.turnId
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { At as
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-
|
|
2
|
+
import { At as abandonTurnRecord, Ht as isTurnExecutionLimitExceededError, Kt as getTerminalAssistantMessages, Mt as failTurnRecord, Nt as getTurnRecord, R as openConversationProjection, bt as AuthorizationFlowDisabledError, gt as PluginCredentialFailureError, kt as saveTurnCheckpoint } from "./tasks-LOItiYgL.js";
|
|
3
|
+
import { n as botConfig } from "./config-Dnv8KmNs.js";
|
|
4
|
+
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-DmNRM88V.js";
|
|
5
5
|
import { m as sameActorIdentity, u as agentInstructionProvenance } from "./history-AY8rs-FR.js";
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { H as recordSubagentStarted, V as recordSubagentEnded, X as withoutSavedSteeringMessages, Y as buildSteeringPiMessage, et as readBlockedReport, z as stopChildAgentsOf } from "./agent-runner-BUBas7Yy.js";
|
|
7
|
+
import { E as markAgentInvocationSteered, H as TurnInputCommitLostError, K as isTurnInputCommitLostError, L as agentTypeInstructions, O as reportReplacedAgentInvocation, R as agentTypeStartsWithParentHistory, S as markAgentInvocationMailboxAppended, T as markAgentInvocationRunning, W as getConversationTurnBoundaryError, _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, f as getAgentInvocationMessageId, m as getAgentInvocationTurnId, n as completeAgentInvocation, r as createAgentInvocation, s as getActiveAgentInvocationForConversation, w as markAgentInvocationPaused, y as isTerminalAgentInvocation } from "./store-TKg1HVKx.js";
|
|
8
|
+
import { n as getAssistantReplyText } from "./assistant-reply-BFmjgJjD.js";
|
|
9
|
+
import { F as resetAutomatedTurnLimit, N as maybePostAutomatedTurnLimitNotice, P as recordFinishedTurnForAutomatedLimit } from "./session-stop-CtyJsnEj.js";
|
|
10
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-UlOrW6JC.js";
|
|
11
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Cvi6Sb8Y.js";
|
|
12
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-IDHdZA7R.js";
|
|
12
13
|
import { isDeepStrictEqual } from "node:util";
|
|
13
14
|
import { z } from "zod";
|
|
14
15
|
// src/chat/runtime/turn-execution.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { y as isProviderRetryError } from "./client-
|
|
3
|
-
import { f as logException, m as logWarn, p as logInfo, w as withLogContext } from "./logging-
|
|
4
|
-
import { i as getChatConfig } from "./config-
|
|
5
|
-
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-
|
|
6
|
-
import { C as requestAnotherSlice, M as isInvalidConversationRecordError, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, j as isFinalAttempt, k as hasConversationStop, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-
|
|
2
|
+
import { y as isProviderRetryError } from "./client-DZBCBj1M.js";
|
|
3
|
+
import { f as logException, m as logWarn, p as logInfo, w as withLogContext } from "./logging-Dk_FpF36.js";
|
|
4
|
+
import { i as getChatConfig } from "./config-Dnv8KmNs.js";
|
|
5
|
+
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-B4yTgklN.js";
|
|
6
|
+
import { C as requestAnotherSlice, M as isInvalidConversationRecordError, T as startConversationWork, b as recordConversationRetry, d as countPendingConversationMessages, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, j as isFinalAttempt, k as hasConversationStop, l as completeConversationStop, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, s as clearConsumedConversationWake, t as ackMessages, u as completeConversationWork, x as releaseConversationWork, y as recordAttemptFailure } from "./store-UlOrW6JC.js";
|
|
7
7
|
// src/chat/task-execution/worker.ts
|
|
8
8
|
var worker_exports = /* @__PURE__ */ __exportAll({
|
|
9
9
|
CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.263.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"sharp": "^0.35.3",
|
|
90
90
|
"yaml": "^2.9.0",
|
|
91
91
|
"zod": "^4.5.4",
|
|
92
|
-
"@sentry/junior-plugin-api": "0.
|
|
92
|
+
"@sentry/junior-plugin-api": "0.263.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@emnapi/core": "^1.10.0",
|
|
@@ -109,9 +109,9 @@
|
|
|
109
109
|
"typescript": "^7.0.2",
|
|
110
110
|
"vercel": "^54.4.0",
|
|
111
111
|
"vitest": "^4.1.12",
|
|
112
|
-
"@sentry/junior-github": "0.
|
|
113
|
-
"@sentry/junior-
|
|
114
|
-
"@sentry/junior-
|
|
112
|
+
"@sentry/junior-github": "0.263.0",
|
|
113
|
+
"@sentry/junior-testing": "0.0.0",
|
|
114
|
+
"@sentry/junior-memory": "0.263.0"
|
|
115
115
|
},
|
|
116
116
|
"scripts": {
|
|
117
117
|
"build": "tsdown",
|