@opengeni/worker-bundle 2.2.1-canary.36927100590001 → 2.2.1
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/activities/agent-turn/run-credentials.d.ts +0 -2
- package/dist/activities/scheduled-tasks.d.ts +35 -4
- package/dist/activities/types.d.ts +0 -3
- package/dist/activities/workspace-capture.d.ts +0 -2
- package/dist/{activities-control-4F2A734B.js → activities-control-55ECL47G.js} +20 -102
- package/dist/activities-control-55ECL47G.js.map +1 -0
- package/dist/{activities-turn-TESOIOEX.js → activities-turn-T7Y3BWYO.js} +7 -20
- package/dist/activities-turn-T7Y3BWYO.js.map +1 -0
- package/dist/{chunk-YG27NEMX.js → chunk-IJZU752L.js} +1 -34
- package/dist/chunk-IJZU752L.js.map +1 -0
- package/dist/{chunk-4PJTUBWQ.js → chunk-OWNLATJL.js} +11 -34
- package/dist/chunk-OWNLATJL.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/observability-metrics.d.ts +1 -16
- package/dist/workflow-bundle.js +12 -18
- package/dist/workflows/scheduled-tasks.d.ts +0 -4
- package/package.json +21 -21
- package/src/activities/agent-turn/claim.ts +1 -13
- package/src/activities/agent-turn/run-credentials.ts +0 -5
- package/src/activities/agent-turn/run.ts +0 -1
- package/src/activities/agent-turn/tool-environment.ts +0 -4
- package/src/activities/automations.ts +1 -23
- package/src/activities/goals.ts +8 -33
- package/src/activities/sandbox-lease.ts +0 -22
- package/src/activities/scheduled-tasks.ts +25 -89
- package/src/activities/site-auth-maintenance.ts +0 -1
- package/src/activities/types.ts +0 -3
- package/src/activities/workspace-capture.ts +2 -13
- package/src/observability-metrics.ts +1 -55
- package/src/workflows/scheduled-tasks.ts +13 -26
- package/dist/activities/agent-turn/credential-restriction.d.ts +0 -3
- package/dist/activities-control-4F2A734B.js.map +0 -1
- package/dist/activities-turn-TESOIOEX.js.map +0 -1
- package/dist/chunk-4PJTUBWQ.js.map +0 -1
- package/dist/chunk-YG27NEMX.js.map +0 -1
- package/src/activities/agent-turn/credential-restriction.ts +0 -14
|
@@ -26,7 +26,6 @@ export type PrepareRunCredentialsDeps = {
|
|
|
26
26
|
sandboxRuntime: SandboxTurnRuntime;
|
|
27
27
|
turn: ClaimTurnOk["turn"];
|
|
28
28
|
session: ClaimTurnOk["session"];
|
|
29
|
-
turnExecutionPolicy: ClaimTurnOk["turnExecutionPolicy"];
|
|
30
29
|
fileAuthoritySubjectId: ClaimTurnOk["fileAuthoritySubjectId"];
|
|
31
30
|
runSettings: GovernanceModelOk["runSettings"];
|
|
32
31
|
workspaceVariableSet: Awaited<ReturnType<typeof loadWorkspaceEnvironmentForRunWithCredentials>>;
|
|
@@ -65,7 +64,6 @@ export declare function prepareRunCredentials(deps: PrepareRunCredentialsDeps):
|
|
|
65
64
|
turnId: string;
|
|
66
65
|
attemptId: string;
|
|
67
66
|
executionGeneration: number;
|
|
68
|
-
credentialRestriction?: "developer_setup";
|
|
69
67
|
};
|
|
70
68
|
sandboxArtifactRuntime: Readonly<{
|
|
71
69
|
available: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TurnExecutionPolicyV1 } from "@opengeni/contracts";
|
|
2
1
|
import { updateSessionTitleWithEvent } from "@opengeni/db";
|
|
3
2
|
import type { ControlActivityServices, DispatchScheduledTaskRunInput, DispatchScheduledTaskRunResult } from "./types.js";
|
|
4
3
|
import type { Database } from "@opengeni/db";
|
|
@@ -10,11 +9,43 @@ type ScheduledTemporalActivityIdentity = {
|
|
|
10
9
|
};
|
|
11
10
|
activityId: string;
|
|
12
11
|
};
|
|
13
|
-
export declare function scheduledTaskRunExecutionPolicy(policy: TurnExecutionPolicyV1, input: DispatchScheduledTaskRunInput, creatorRestriction?: "developer_setup"): TurnExecutionPolicyV1;
|
|
14
|
-
/** Only a creator ceiling is standing; a manual caller ceiling is per-run. */
|
|
15
|
-
export declare function scheduledSessionExecutionPolicyMetadata(policy: unknown, creatorRestriction?: "developer_setup"): Record<string, unknown>;
|
|
16
12
|
export declare function scheduledTaskRunProducerKey(input: DispatchScheduledTaskRunInput, suppliedActivityIdentity?: ScheduledTemporalActivityIdentity): string;
|
|
17
13
|
export declare function scheduledTaskGeneratedSessionCreateIdempotencyKey(producerKey: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Display title for a session the scheduler generates for a task.
|
|
16
|
+
*
|
|
17
|
+
* A scheduled session's `initialMessage` is the task prompt, byte-identical for
|
|
18
|
+
* every run. The task name is the short human-chosen label that actually
|
|
19
|
+
* identifies it, so that is the title.
|
|
20
|
+
*
|
|
21
|
+
* The title is the task name and NOTHING else. It deliberately does not name the
|
|
22
|
+
* run's fire instant, for two independent reasons:
|
|
23
|
+
*
|
|
24
|
+
* - No run mode guarantees one run per session. `reusable_session` generates
|
|
25
|
+
* its session on the first fire and then reuses it forever, and even under
|
|
26
|
+
* `new_session_per_run` alert-occurrence redelivery converges several runs
|
|
27
|
+
* onto one canonical responder session. `existing_session` never generates a
|
|
28
|
+
* session at all, so the scheduler never titles one. A run-specific fact
|
|
29
|
+
* frozen into the title is therefore right for the generating run and a lie
|
|
30
|
+
* for every run that lands in the same session afterwards.
|
|
31
|
+
* - A title is one stored string shown to every viewer, while every surface
|
|
32
|
+
* that renders a run's fire instant renders it viewer-local: the rail row
|
|
33
|
+
* prints the title beside `relativeTimeLabel(session.updatedAt)`, and the
|
|
34
|
+
* Schedules run list prints `formatTimestamp(run.firedAt)`, which is
|
|
35
|
+
* `toLocaleString()`. A wall clock stored in the title therefore disagrees
|
|
36
|
+
* with the time printed next to it for every viewer outside whichever zone
|
|
37
|
+
* it was rendered in. The task's own `timeZone` is no escape: it labels the
|
|
38
|
+
* schedule rule ("Mon Wed 09:00 Europe/Oslo"), not the rendering of a run,
|
|
39
|
+
* which stays viewer-local. No stored clock can agree with a viewer-local
|
|
40
|
+
* one, so the title carries none and the instant stays on the surfaces that
|
|
41
|
+
* already render it correctly.
|
|
42
|
+
*
|
|
43
|
+
* Dropping the clock settles the determinism constraint outright rather than
|
|
44
|
+
* working around it: the same run titled by the normal dispatch or by a later
|
|
45
|
+
* recovery in a different worker process derives one string from `task.name`
|
|
46
|
+
* alone, with no Intl call and so no host ICU or tzdata build to make the two
|
|
47
|
+
* texts differ.
|
|
48
|
+
*/
|
|
18
49
|
export declare function scheduledTaskSessionTitle(taskName: string): string;
|
|
19
50
|
/**
|
|
20
51
|
* Title a session the scheduler generated, and emit the same `session.title_set`
|
|
@@ -343,14 +343,11 @@ export type DispatchScheduledTaskRunInput = {
|
|
|
343
343
|
triggerType: Extract<ScheduledTaskTriggerType, "scheduled">;
|
|
344
344
|
agentRunUsageIdempotencyKey?: never;
|
|
345
345
|
initiator?: never;
|
|
346
|
-
credentialRestriction?: never;
|
|
347
346
|
} | {
|
|
348
347
|
triggerType: Extract<ScheduledTaskTriggerType, "manual" | "initial" | "provider_event" | "retry" | "repair">;
|
|
349
348
|
agentRunUsageIdempotencyKey: string;
|
|
350
349
|
/** Exact identity used by the API-side charge for this same trigger. */
|
|
351
350
|
initiator: TurnInitiator;
|
|
352
|
-
/** Trusted API-side caller ceiling for this occurrence, not the schedule. */
|
|
353
|
-
credentialRestriction?: "developer_setup";
|
|
354
351
|
});
|
|
355
352
|
export type DispatchScheduledTaskRunResult = {
|
|
356
353
|
action: "deleted";
|
|
@@ -108,8 +108,6 @@ export declare function captureWhileIdle(input: {
|
|
|
108
108
|
* to release() regardless.
|
|
109
109
|
*/
|
|
110
110
|
export declare function captureWorkspaceRevision(input: CaptureWorkspaceRevisionInput): Promise<void>;
|
|
111
|
-
/** Count one committed logical capture and observe its end-to-end duration. */
|
|
112
|
-
export declare function recordWorkspaceCaptureCompleted(observability: Pick<Observability, "incrementCounter" | "observeHistogram">, durationMs: number): void;
|
|
113
111
|
/**
|
|
114
112
|
* sha256 over the CHANGE SURFACE only — per-file (path, status, hash, deleted,
|
|
115
113
|
* tooLarge), exact HEAD identity, the working diff summary, and exact committed
|
|
@@ -34,12 +34,10 @@ import {
|
|
|
34
34
|
warnDrainSnapshotFailure,
|
|
35
35
|
withFirstPartyTools,
|
|
36
36
|
workflowIdForSession
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-OWNLATJL.js";
|
|
38
38
|
import {
|
|
39
39
|
inspectOpenSandboxKubernetesInventory,
|
|
40
|
-
recordActiveUserGauges,
|
|
41
40
|
recordCreditBalanceGauges,
|
|
42
|
-
recordCreditGrantGauges,
|
|
43
41
|
recordCreditMicros,
|
|
44
42
|
recordExpiredDrainingSandboxLeaseGauges,
|
|
45
43
|
recordOpenSandboxKubernetesInventoryGauges,
|
|
@@ -60,7 +58,7 @@ import {
|
|
|
60
58
|
recordVerifiedSignupTrialSwitchGauge,
|
|
61
59
|
recordWorkerDeathRecoveryMetrics,
|
|
62
60
|
runtimeMetricsHooksForObservability
|
|
63
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-IJZU752L.js";
|
|
64
62
|
import "./chunk-PZ5AY32C.js";
|
|
65
63
|
|
|
66
64
|
// src/activities/knowledge-indexing.ts
|
|
@@ -719,8 +717,7 @@ import {
|
|
|
719
717
|
createAndStartSessionWithOutcome,
|
|
720
718
|
recordWorkspaceUsage,
|
|
721
719
|
resolveCatalogSettings,
|
|
722
|
-
resolveWorkspaceCatalogSettings
|
|
723
|
-
isDeveloperSetupDelegatedPermissionAllowed
|
|
720
|
+
resolveWorkspaceCatalogSettings
|
|
724
721
|
} from "@opengeni/core";
|
|
725
722
|
import {
|
|
726
723
|
AutomationAuthorityRevokedError,
|
|
@@ -780,17 +777,6 @@ function createAutomationActivities(services, options = {}) {
|
|
|
780
777
|
return { action: "skipped", reason: "accepted_execution_mismatch" };
|
|
781
778
|
}
|
|
782
779
|
const template = accepted.sessionTemplate;
|
|
783
|
-
if (template.credentialRestriction === "developer_setup" && template.firstPartyMcpPermissions.some(
|
|
784
|
-
(permission) => !isDeveloperSetupDelegatedPermissionAllowed(permission)
|
|
785
|
-
)) {
|
|
786
|
-
await settle(service.db, {
|
|
787
|
-
workspaceId: input.workspaceId,
|
|
788
|
-
runId: run.id,
|
|
789
|
-
status: "failed",
|
|
790
|
-
errorCode: "credential_restriction_violation"
|
|
791
|
-
});
|
|
792
|
-
return { action: "failed", reason: "credential_restriction_violation" };
|
|
793
|
-
}
|
|
794
780
|
const requestedModel = template.model ?? deploymentCatalogSettings.openaiModel;
|
|
795
781
|
const catalogSettings = requestedModel.startsWith(WORKSPACE_GATEWAY_MODEL_ID_PREFIX) || requestedModel.startsWith(WORKSPACE_OPENROUTER_MODEL_ID_PREFIX) ? (await resolveWorkspaceCatalogSettings(service.db, catalogSourceSettings, {
|
|
796
782
|
accountId: input.accountId,
|
|
@@ -878,7 +864,7 @@ function createAutomationActivities(services, options = {}) {
|
|
|
878
864
|
});
|
|
879
865
|
return { action: "failed", reason: "dispatch_failed" };
|
|
880
866
|
}
|
|
881
|
-
const
|
|
867
|
+
const turnExecutionPolicy = resolveTurnExecutionPolicyV1(catalogSettings, {
|
|
882
868
|
modelId: model,
|
|
883
869
|
requestedModelId: template.model,
|
|
884
870
|
modelSource: template.model ? "explicit" : "deployment",
|
|
@@ -887,10 +873,6 @@ function createAutomationActivities(services, options = {}) {
|
|
|
887
873
|
latencyMode: "standard",
|
|
888
874
|
latencyModeSource: "deployment"
|
|
889
875
|
});
|
|
890
|
-
const turnExecutionPolicy = template.credentialRestriction ? {
|
|
891
|
-
...resolvedTurnExecutionPolicy,
|
|
892
|
-
credentialRestriction: template.credentialRestriction
|
|
893
|
-
} : resolvedTurnExecutionPolicy;
|
|
894
876
|
const created = await createSession2({
|
|
895
877
|
db: service.db,
|
|
896
878
|
bus: service.bus,
|
|
@@ -914,7 +896,6 @@ function createAutomationActivities(services, options = {}) {
|
|
|
914
896
|
workspaceId: input.workspaceId,
|
|
915
897
|
initialMessage: accepted.initialMessage,
|
|
916
898
|
surface: "automation",
|
|
917
|
-
metrics: service.observability,
|
|
918
899
|
resources: template.resources,
|
|
919
900
|
skills: SessionSkills.parse(template.skills),
|
|
920
901
|
bundledSkillIds: template.bundledSkillIds,
|
|
@@ -2694,8 +2675,6 @@ import {
|
|
|
2694
2675
|
deferRetainedProcessReconciliation,
|
|
2695
2676
|
forceDrainOverLimitViewerOnlyBoxes,
|
|
2696
2677
|
listCreditBalancesByAccount,
|
|
2697
|
-
countActiveUsers,
|
|
2698
|
-
readCreditGrantTotals,
|
|
2699
2678
|
readVerifiedSignupTrialSwitch,
|
|
2700
2679
|
listLegacyModalCheckpointSlots,
|
|
2701
2680
|
listLiveModalSandboxLeaseAttributions,
|
|
@@ -4390,24 +4369,6 @@ async function refreshQueueLeaseAndCreditGauges(db, settings, observability, ins
|
|
|
4390
4369
|
});
|
|
4391
4370
|
}
|
|
4392
4371
|
})(),
|
|
4393
|
-
(async () => {
|
|
4394
|
-
try {
|
|
4395
|
-
recordActiveUserGauges(observability, await countActiveUsers(db));
|
|
4396
|
-
} catch (error) {
|
|
4397
|
-
observability.warn("sandbox reaper: active-user gauge refresh failed", {
|
|
4398
|
-
error: error instanceof Error ? error.message : String(error)
|
|
4399
|
-
});
|
|
4400
|
-
}
|
|
4401
|
-
})(),
|
|
4402
|
-
(async () => {
|
|
4403
|
-
try {
|
|
4404
|
-
recordCreditGrantGauges(observability, await readCreditGrantTotals(db));
|
|
4405
|
-
} catch (error) {
|
|
4406
|
-
observability.warn("sandbox reaper: credit-grant gauge refresh failed", {
|
|
4407
|
-
error: error instanceof Error ? error.message : String(error)
|
|
4408
|
-
});
|
|
4409
|
-
}
|
|
4410
|
-
})(),
|
|
4411
4372
|
(async () => {
|
|
4412
4373
|
recordVerifiedSignupTrialDeploymentFlagGauge(
|
|
4413
4374
|
observability,
|
|
@@ -5245,7 +5206,6 @@ import {
|
|
|
5245
5206
|
SessionAgentAccess,
|
|
5246
5207
|
SessionMemoryScope,
|
|
5247
5208
|
normalizeAutomaticSessionTitle,
|
|
5248
|
-
metadataWithTurnExecutionPolicyV1,
|
|
5249
5209
|
scheduledOccurrencePayloadUtf8Bytes,
|
|
5250
5210
|
stableJson,
|
|
5251
5211
|
TurnExecutionPolicyV1,
|
|
@@ -5270,9 +5230,7 @@ import {
|
|
|
5270
5230
|
swapActiveSandbox,
|
|
5271
5231
|
agentConfigMayResolve as agentConfigMayResolve2,
|
|
5272
5232
|
applySessionAgentConfigWriteThrough as applySessionAgentConfigWriteThrough2,
|
|
5273
|
-
resolveSessionAgentConfigForCreate as resolveSessionAgentConfigForCreate2
|
|
5274
|
-
recordSessionCreated,
|
|
5275
|
-
recordUserMessageAccepted
|
|
5233
|
+
resolveSessionAgentConfigForCreate as resolveSessionAgentConfigForCreate2
|
|
5276
5234
|
} from "@opengeni/core";
|
|
5277
5235
|
import {
|
|
5278
5236
|
addSessionSystemUpdateWithSourceMutation,
|
|
@@ -5439,14 +5397,6 @@ function canonicalLabels(value) {
|
|
|
5439
5397
|
}
|
|
5440
5398
|
|
|
5441
5399
|
// src/activities/scheduled-tasks.ts
|
|
5442
|
-
function scheduledTaskRunExecutionPolicy(policy, input, creatorRestriction) {
|
|
5443
|
-
return creatorRestriction === "developer_setup" || input.triggerType !== "scheduled" && input.credentialRestriction === "developer_setup" ? { ...policy, credentialRestriction: "developer_setup" } : policy;
|
|
5444
|
-
}
|
|
5445
|
-
function scheduledSessionExecutionPolicyMetadata(policy, creatorRestriction) {
|
|
5446
|
-
if (policy === void 0 || policy === null) return {};
|
|
5447
|
-
const acceptedPolicy = TurnExecutionPolicyV1.parse(policy);
|
|
5448
|
-
return creatorRestriction === "developer_setup" && acceptedPolicy.credentialRestriction === "developer_setup" ? metadataWithTurnExecutionPolicyV1({}, acceptedPolicy) : {};
|
|
5449
|
-
}
|
|
5450
5400
|
function scheduledTaskRunProducerKey(input, suppliedActivityIdentity) {
|
|
5451
5401
|
if (input.producerKey) return input.producerKey;
|
|
5452
5402
|
if (input.triggerType !== "scheduled") return input.agentRunUsageIdempotencyKey;
|
|
@@ -5472,13 +5422,6 @@ function scheduledTaskGeneratedSessionCreateIdempotencyKey(producerKey) {
|
|
|
5472
5422
|
const digest = createHash3("sha256").update("scheduled-task-run\0", "utf8").update(producerKey, "utf8").digest("hex");
|
|
5473
5423
|
return `scheduled-task-run:${digest}`;
|
|
5474
5424
|
}
|
|
5475
|
-
function recordScheduledSessionCreated(observability) {
|
|
5476
|
-
recordSessionCreated(observability, {
|
|
5477
|
-
surface: "scheduled",
|
|
5478
|
-
createdByKind: "service",
|
|
5479
|
-
parentSessionId: null
|
|
5480
|
-
});
|
|
5481
|
-
}
|
|
5482
5425
|
function scheduledTaskSessionTitle(taskName) {
|
|
5483
5426
|
return normalizeAutomaticSessionTitle(taskName) ?? "Scheduled run";
|
|
5484
5427
|
}
|
|
@@ -5553,7 +5496,6 @@ function createScheduledTaskActivities(services) {
|
|
|
5553
5496
|
try {
|
|
5554
5497
|
return await recoverBoundScheduledTaskDispatch({
|
|
5555
5498
|
db,
|
|
5556
|
-
observability: baseService.observability,
|
|
5557
5499
|
bus,
|
|
5558
5500
|
settings: settings2,
|
|
5559
5501
|
wakeSessionWorkflow,
|
|
@@ -6055,19 +5997,15 @@ function createScheduledTaskActivities(services) {
|
|
|
6055
5997
|
);
|
|
6056
5998
|
}
|
|
6057
5999
|
} : void 0;
|
|
6058
|
-
const turnExecutionPolicy =
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
}),
|
|
6068
|
-
input,
|
|
6069
|
-
creatorPolicy?.credentialRestriction
|
|
6070
|
-
);
|
|
6000
|
+
const turnExecutionPolicy = resolveTurnExecutionPolicyV12(settings, {
|
|
6001
|
+
modelId: acceptedModel,
|
|
6002
|
+
requestedModelId: generatedTarget && task.agentConfig.model ? task.agentConfig.model : null,
|
|
6003
|
+
modelSource: generatedTarget ? task.agentConfig.model ? "explicit" : "deployment" : "session",
|
|
6004
|
+
reasoningEffort: acceptedReasoningEffort,
|
|
6005
|
+
reasoningSource: generatedTarget ? task.agentConfig.reasoningEffort ? "explicit" : "deployment" : "session",
|
|
6006
|
+
latencyMode: acceptedLatencyMode,
|
|
6007
|
+
latencyModeSource: generatedTarget ? "deployment" : "session"
|
|
6008
|
+
});
|
|
6071
6009
|
const deferredEvents = [];
|
|
6072
6010
|
const executeDispatch = async (dispatchDb, deferPublications) => {
|
|
6073
6011
|
const admittedRunId = crypto.randomUUID();
|
|
@@ -6278,10 +6216,6 @@ function createScheduledTaskActivities(services) {
|
|
|
6278
6216
|
} : {},
|
|
6279
6217
|
metadata: {
|
|
6280
6218
|
...taskMetadata,
|
|
6281
|
-
...scheduledSessionExecutionPolicyMetadata(
|
|
6282
|
-
turnExecutionPolicy,
|
|
6283
|
-
creatorPolicy?.credentialRestriction
|
|
6284
|
-
),
|
|
6285
6219
|
model,
|
|
6286
6220
|
reasoningEffort,
|
|
6287
6221
|
scheduledTaskId: task.id,
|
|
@@ -6371,7 +6305,6 @@ function createScheduledTaskActivities(services) {
|
|
|
6371
6305
|
}
|
|
6372
6306
|
session = created.session;
|
|
6373
6307
|
sessionCreated = created.created;
|
|
6374
|
-
if (sessionCreated) recordScheduledSessionCreated(baseService.observability);
|
|
6375
6308
|
if (!sessionCreated) {
|
|
6376
6309
|
await bindScheduledTaskRunSessionInTransaction(dispatchDb, {
|
|
6377
6310
|
accountId: task.accountId,
|
|
@@ -6607,9 +6540,6 @@ function createScheduledTaskActivities(services) {
|
|
|
6607
6540
|
run: { ...run, status: "skipped", error }
|
|
6608
6541
|
};
|
|
6609
6542
|
}
|
|
6610
|
-
if (scheduledUpdate.added) {
|
|
6611
|
-
recordUserMessageAccepted(baseService.observability, { surface: "scheduled" });
|
|
6612
|
-
}
|
|
6613
6543
|
if (scheduledUpdate.added && scheduledUpdate.events.length > 0) {
|
|
6614
6544
|
if (deferPublications) {
|
|
6615
6545
|
deferredEvents.push({
|
|
@@ -6734,9 +6664,6 @@ function createScheduledTaskActivities(services) {
|
|
|
6734
6664
|
run: { ...run, status: "skipped", error }
|
|
6735
6665
|
};
|
|
6736
6666
|
}
|
|
6737
|
-
if (bundled.added) {
|
|
6738
|
-
recordUserMessageAccepted(baseService.observability, { surface: "scheduled" });
|
|
6739
|
-
}
|
|
6740
6667
|
if (bundled.added && bundled.events.length > 0) {
|
|
6741
6668
|
if (deferPublications) {
|
|
6742
6669
|
deferredEvents.push({
|
|
@@ -7078,7 +7005,6 @@ async function recoverBoundScheduledTaskDispatch(input) {
|
|
|
7078
7005
|
throw new Error("scheduled run is not an exact queued recovery");
|
|
7079
7006
|
}
|
|
7080
7007
|
const generatedSession = task.runMode === "new_session_per_run" || task.runMode === "reusable_session" && task.reusableSessionId === null;
|
|
7081
|
-
const recoveredCreatorPolicy = generatedSession ? await getScheduledTaskCreatorPolicy(input.db, task.workspaceId, task.id) : null;
|
|
7082
7008
|
const frozenSlack = input.acceptedExecution.resolvedSlackBotConnection;
|
|
7083
7009
|
if (frozenSlack) {
|
|
7084
7010
|
const currentSlack = await requireOpenGeniSlackBotConnection(
|
|
@@ -7138,6 +7064,11 @@ async function recoverBoundScheduledTaskDispatch(input) {
|
|
|
7138
7064
|
}
|
|
7139
7065
|
const taskMetadata = { ...task.agentConfig.metadata };
|
|
7140
7066
|
delete taskMetadata[OPENGENI_SLACK_BOT_SESSION_METADATA_KEY];
|
|
7067
|
+
const recoveredCreatorPolicy = await getScheduledTaskCreatorPolicy(
|
|
7068
|
+
input.db,
|
|
7069
|
+
task.workspaceId,
|
|
7070
|
+
task.id
|
|
7071
|
+
);
|
|
7141
7072
|
const created = await createSessionWithIdempotencyKeyResult(input.db, {
|
|
7142
7073
|
accountId: task.accountId,
|
|
7143
7074
|
workspaceId: task.workspaceId,
|
|
@@ -7156,10 +7087,6 @@ async function recoverBoundScheduledTaskDispatch(input) {
|
|
|
7156
7087
|
} : {},
|
|
7157
7088
|
metadata: {
|
|
7158
7089
|
...taskMetadata,
|
|
7159
|
-
...scheduledSessionExecutionPolicyMetadata(
|
|
7160
|
-
input.acceptedExecution.turnExecutionPolicy,
|
|
7161
|
-
recoveredCreatorPolicy?.credentialRestriction
|
|
7162
|
-
),
|
|
7163
7090
|
model: input.acceptedExecution.resolvedModel,
|
|
7164
7091
|
reasoningEffort: input.acceptedExecution.resolvedReasoningEffort,
|
|
7165
7092
|
scheduledTaskId: task.id,
|
|
@@ -7212,7 +7139,6 @@ async function recoverBoundScheduledTaskDispatch(input) {
|
|
|
7212
7139
|
});
|
|
7213
7140
|
if (created.denied) throw new SessionSpawnDeniedDbError(created.denial);
|
|
7214
7141
|
session = created.session;
|
|
7215
|
-
if (created.created) recordScheduledSessionCreated(input.observability);
|
|
7216
7142
|
if (!created.created) {
|
|
7217
7143
|
await bindScheduledTaskRunSessionInTransaction(input.db, {
|
|
7218
7144
|
accountId: task.accountId,
|
|
@@ -7279,10 +7205,6 @@ async function recoverBoundScheduledTaskDispatch(input) {
|
|
|
7279
7205
|
const expectedMetadata = metadataWithAgentConfigCreateIdentity(
|
|
7280
7206
|
{
|
|
7281
7207
|
...expectedTaskMetadata,
|
|
7282
|
-
...scheduledSessionExecutionPolicyMetadata(
|
|
7283
|
-
input.acceptedExecution.turnExecutionPolicy,
|
|
7284
|
-
recoveredCreatorPolicy?.credentialRestriction
|
|
7285
|
-
),
|
|
7286
7208
|
model: input.acceptedExecution.resolvedModel,
|
|
7287
7209
|
reasoningEffort: input.acceptedExecution.resolvedReasoningEffort,
|
|
7288
7210
|
scheduledTaskId: task.id,
|
|
@@ -7436,9 +7358,6 @@ async function recoverBoundScheduledTaskDispatch(input) {
|
|
|
7436
7358
|
if (scheduledUpdate.reason === "session_cancelled" || scheduledUpdate.reason === "session_not_idle") {
|
|
7437
7359
|
return { action: "blocked", reason: "scheduled_run_terminal" };
|
|
7438
7360
|
}
|
|
7439
|
-
if (scheduledUpdate.added) {
|
|
7440
|
-
recordUserMessageAccepted(input.observability, { surface: "scheduled" });
|
|
7441
|
-
}
|
|
7442
7361
|
if (scheduledUpdate.added && scheduledUpdate.events.length > 0) {
|
|
7443
7362
|
await publishDurableSessionEvents(
|
|
7444
7363
|
input.bus,
|
|
@@ -7694,7 +7613,6 @@ async function dispatchMaintenanceSession(service, maintenance, dependencies) {
|
|
|
7694
7613
|
initialMessage: maintenancePrompt(maintenance),
|
|
7695
7614
|
// OpenGeni's own periodic check: no human or product surface entered it.
|
|
7696
7615
|
surface: "system",
|
|
7697
|
-
metrics: service.observability,
|
|
7698
7616
|
resources: [],
|
|
7699
7617
|
tools: [{ kind: "mcp", id: "opengeni" }],
|
|
7700
7618
|
toolPolicy: { mode: "explicit", inheritedFromSessionId: null },
|
|
@@ -8388,4 +8306,4 @@ export {
|
|
|
8388
8306
|
createControlActivities,
|
|
8389
8307
|
createControlActivitiesFromServices
|
|
8390
8308
|
};
|
|
8391
|
-
//# sourceMappingURL=activities-control-
|
|
8309
|
+
//# sourceMappingURL=activities-control-55ECL47G.js.map
|