@kitman-sh/cli 0.13.15 → 0.13.16
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/{chunk-6qdhhk6r.js → chunk-49gbakce.js} +3 -3
- package/dist/{chunk-6kz6qa2h.js → chunk-4zh7qxck.js} +2 -2
- package/dist/{chunk-my63gy4t.js → chunk-5cevjkrb.js} +11 -11
- package/dist/{chunk-3syr8kyv.js → chunk-5w6r4mw6.js} +27 -27
- package/dist/{chunk-zem7mg1b.js → chunk-at5dh2te.js} +15 -15
- package/dist/{chunk-ga76znz9.js → chunk-bt22cd13.js} +6 -1
- package/dist/{chunk-rqrtf7sb.js → chunk-c9rvst3x.js} +2 -2
- package/dist/{chunk-npnbac9a.js → chunk-cbzqfz1k.js} +2 -2
- package/dist/{chunk-7cx4t4em.js → chunk-d9z9cyzt.js} +30 -30
- package/dist/{chunk-hn9x2jjs.js → chunk-mbqb40ev.js} +15 -15
- package/dist/{chunk-gy9rf14f.js → chunk-s88vcvtd.js} +1 -1
- package/dist/{chunk-z4x9m2bv.js → chunk-sjdze64n.js} +5 -5
- package/dist/{chunk-ydz5ctsj.js → chunk-t4xwk14b.js} +140 -95
- package/dist/{chunk-jattyebv.js → chunk-tntbdpmy.js} +68 -68
- package/dist/{chunk-6z499mrc.js → chunk-ttk3d0z2.js} +147 -135
- package/dist/{chunk-h0jf48ew.js → chunk-v1e4g2re.js} +1 -1
- package/dist/{chunk-5qeqhjxy.js → chunk-y7p4d14b.js} +3 -3
- package/dist/{chunk-b07c43pg.js → chunk-zd6y6ka8.js} +53 -18
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/{chunk-82w8rmkc.js → chunk-vsrjg9nm.js} +9 -9
- package/dist/{chunk-y1krmnbv.js → chunk-x7acexnm.js} +4 -4
|
@@ -1,4 +1,85 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Id,
|
|
4
|
+
secretReference,
|
|
5
|
+
secretPlaceholder
|
|
6
|
+
} from "./chunk-q5w3v4k1.js";
|
|
7
|
+
import {
|
|
8
|
+
currentTimeMillis,
|
|
9
|
+
SecureRandom,
|
|
10
|
+
layerWebCrypto,
|
|
11
|
+
layer,
|
|
12
|
+
layer2,
|
|
13
|
+
toDate,
|
|
14
|
+
toIso,
|
|
15
|
+
wallClockMillis,
|
|
16
|
+
redactCredentials,
|
|
17
|
+
redactedOutputTail,
|
|
18
|
+
AgentSkillRequirement,
|
|
19
|
+
AgentMcpServerRequirement,
|
|
20
|
+
AgentEnvironmentFragment,
|
|
21
|
+
findForbiddenAgentEnvironmentSecretPath,
|
|
22
|
+
findForbiddenRepoBindingSecretPath,
|
|
23
|
+
runnerAgentSandboxPolicy,
|
|
24
|
+
agentNetworkAllowlist,
|
|
25
|
+
verificationNetworkAllowlist,
|
|
26
|
+
programNetworkHosts,
|
|
27
|
+
canonicalSha256,
|
|
28
|
+
tokensSpent,
|
|
29
|
+
reportedModelName,
|
|
30
|
+
isTestReportName,
|
|
31
|
+
failedTestOfLine,
|
|
32
|
+
checkTests,
|
|
33
|
+
MeasureSample,
|
|
34
|
+
catchUpPathLimit,
|
|
35
|
+
createId,
|
|
36
|
+
digestSha256,
|
|
37
|
+
AgentEvent,
|
|
38
|
+
get,
|
|
39
|
+
post,
|
|
40
|
+
setHeaders,
|
|
41
|
+
acceptJson,
|
|
42
|
+
bodyJsonUnsafe,
|
|
43
|
+
bodyUrlParams,
|
|
44
|
+
schemaBodyJson,
|
|
45
|
+
filterStatusOk,
|
|
46
|
+
HttpClient,
|
|
47
|
+
layer4,
|
|
48
|
+
SetupArchive,
|
|
49
|
+
kitMcpSecretNames,
|
|
50
|
+
RunSettled,
|
|
51
|
+
UpdateAvailable,
|
|
52
|
+
HERDR_CORE_GENERATION2,
|
|
53
|
+
HERDR_CORE_INSTALL_COMMAND2,
|
|
54
|
+
HerdrCoreMissing2,
|
|
55
|
+
HerdrCoreIncompatible2,
|
|
56
|
+
HerdrCoreConnectionLost2,
|
|
57
|
+
HerdrCoreRpcError2,
|
|
58
|
+
HerdrCoreUpdateFailed2,
|
|
59
|
+
HerdrCore2,
|
|
60
|
+
herdrCoreLayer2,
|
|
61
|
+
herdrCoreTransportLayer2,
|
|
62
|
+
updateHerdrCore2,
|
|
63
|
+
CommandFailed2,
|
|
64
|
+
runCommand2,
|
|
65
|
+
withoutPreloads2,
|
|
66
|
+
shellOutputTailChars2,
|
|
67
|
+
runProcess2,
|
|
68
|
+
CommandRunner2,
|
|
69
|
+
runShell2,
|
|
70
|
+
detectHarnesses2,
|
|
71
|
+
isKitHarness,
|
|
72
|
+
materializeKitSetup,
|
|
73
|
+
tomlInline,
|
|
74
|
+
herdrExecutionExtension2,
|
|
75
|
+
herdrNativeExtensionIds2,
|
|
76
|
+
herdrRunnerCapabilitiesForRepoBinding2,
|
|
77
|
+
herdrRunnerCapabilities2,
|
|
78
|
+
assertHerdrRunnerCapability2,
|
|
79
|
+
installCommand,
|
|
80
|
+
checkServicesFile,
|
|
81
|
+
checkServices
|
|
82
|
+
} from "./chunk-zd6y6ka8.js";
|
|
2
83
|
import {
|
|
3
84
|
pipeArguments,
|
|
4
85
|
dual,
|
|
@@ -169,86 +250,6 @@ import {
|
|
|
169
250
|
encodeUnknownJsonStringSync,
|
|
170
251
|
storable
|
|
171
252
|
} from "./chunk-zw3gf6r5.js";
|
|
172
|
-
import {
|
|
173
|
-
Id,
|
|
174
|
-
secretReference,
|
|
175
|
-
secretPlaceholder
|
|
176
|
-
} from "./chunk-q5w3v4k1.js";
|
|
177
|
-
import {
|
|
178
|
-
currentTimeMillis,
|
|
179
|
-
SecureRandom,
|
|
180
|
-
layerWebCrypto,
|
|
181
|
-
layer,
|
|
182
|
-
layer2,
|
|
183
|
-
toDate,
|
|
184
|
-
toIso,
|
|
185
|
-
wallClockMillis,
|
|
186
|
-
redactCredentials,
|
|
187
|
-
redactedOutputTail,
|
|
188
|
-
AgentSkillRequirement,
|
|
189
|
-
AgentMcpServerRequirement,
|
|
190
|
-
AgentEnvironmentFragment,
|
|
191
|
-
findForbiddenAgentEnvironmentSecretPath,
|
|
192
|
-
findForbiddenRepoBindingSecretPath,
|
|
193
|
-
runnerAgentSandboxPolicy,
|
|
194
|
-
agentNetworkAllowlist,
|
|
195
|
-
verificationNetworkAllowlist,
|
|
196
|
-
programNetworkHosts,
|
|
197
|
-
canonicalSha256,
|
|
198
|
-
tokensSpent,
|
|
199
|
-
isTestReportName,
|
|
200
|
-
failedTestOfLine,
|
|
201
|
-
checkTests,
|
|
202
|
-
MeasureSample,
|
|
203
|
-
catchUpPathLimit,
|
|
204
|
-
createId,
|
|
205
|
-
digestSha256,
|
|
206
|
-
AgentEvent,
|
|
207
|
-
get,
|
|
208
|
-
post,
|
|
209
|
-
setHeaders,
|
|
210
|
-
acceptJson,
|
|
211
|
-
bodyJsonUnsafe,
|
|
212
|
-
bodyUrlParams,
|
|
213
|
-
schemaBodyJson,
|
|
214
|
-
filterStatusOk,
|
|
215
|
-
HttpClient,
|
|
216
|
-
layer4,
|
|
217
|
-
SetupArchive,
|
|
218
|
-
kitMcpSecretNames,
|
|
219
|
-
RunSettled,
|
|
220
|
-
UpdateAvailable,
|
|
221
|
-
HERDR_CORE_GENERATION2,
|
|
222
|
-
HERDR_CORE_INSTALL_COMMAND2,
|
|
223
|
-
HerdrCoreMissing2,
|
|
224
|
-
HerdrCoreIncompatible2,
|
|
225
|
-
HerdrCoreConnectionLost2,
|
|
226
|
-
HerdrCoreRpcError2,
|
|
227
|
-
HerdrCoreUpdateFailed2,
|
|
228
|
-
HerdrCore2,
|
|
229
|
-
herdrCoreLayer2,
|
|
230
|
-
herdrCoreTransportLayer2,
|
|
231
|
-
updateHerdrCore2,
|
|
232
|
-
CommandFailed2,
|
|
233
|
-
runCommand2,
|
|
234
|
-
withoutPreloads2,
|
|
235
|
-
shellOutputTailChars2,
|
|
236
|
-
runProcess2,
|
|
237
|
-
CommandRunner2,
|
|
238
|
-
runShell2,
|
|
239
|
-
detectHarnesses2,
|
|
240
|
-
isKitHarness,
|
|
241
|
-
materializeKitSetup,
|
|
242
|
-
tomlInline,
|
|
243
|
-
herdrExecutionExtension2,
|
|
244
|
-
herdrNativeExtensionIds2,
|
|
245
|
-
herdrRunnerCapabilitiesForRepoBinding2,
|
|
246
|
-
herdrRunnerCapabilities2,
|
|
247
|
-
assertHerdrRunnerCapability2,
|
|
248
|
-
installCommand,
|
|
249
|
-
checkServicesFile,
|
|
250
|
-
checkServices
|
|
251
|
-
} from "./chunk-b07c43pg.js";
|
|
252
253
|
import {
|
|
253
254
|
join,
|
|
254
255
|
interrupt,
|
|
@@ -307,8 +308,8 @@ import {
|
|
|
307
308
|
applyAgentEnvironmentMaterialization2,
|
|
308
309
|
isPathWithin2,
|
|
309
310
|
skillIdentity2
|
|
310
|
-
} from "./chunk-
|
|
311
|
-
import"./chunk-
|
|
311
|
+
} from "./chunk-cbzqfz1k.js";
|
|
312
|
+
import"./chunk-mbqb40ev.js";
|
|
312
313
|
import {
|
|
313
314
|
egressAllowed,
|
|
314
315
|
writeSecretRegistry,
|
|
@@ -318,7 +319,7 @@ import {
|
|
|
318
319
|
secretFilter2,
|
|
319
320
|
opaqueTunnelRefusal2,
|
|
320
321
|
isOpaqueConnectReason2
|
|
321
|
-
} from "./chunk-
|
|
322
|
+
} from "./chunk-x7acexnm.js";
|
|
322
323
|
import {
|
|
323
324
|
sliceBytes2,
|
|
324
325
|
maxLineBytes2,
|
|
@@ -326,23 +327,23 @@ import {
|
|
|
326
327
|
decodedOption2,
|
|
327
328
|
decoded2,
|
|
328
329
|
readOpencode2
|
|
329
|
-
} from "./chunk-
|
|
330
|
+
} from "./chunk-bt22cd13.js";
|
|
330
331
|
import {
|
|
331
332
|
uploadRunFile,
|
|
332
333
|
programLease,
|
|
333
334
|
rpcRunFiles,
|
|
334
335
|
programHostsEnv,
|
|
335
336
|
undeclaredHostsEnv
|
|
336
|
-
} from "./chunk-
|
|
337
|
-
import"./chunk-
|
|
337
|
+
} from "./chunk-d9z9cyzt.js";
|
|
338
|
+
import"./chunk-5cevjkrb.js";
|
|
338
339
|
import {
|
|
339
340
|
nextInt
|
|
340
341
|
} from "./chunk-gq7y5v3e.js";
|
|
341
342
|
import {
|
|
342
343
|
ChildProcessSpawner,
|
|
343
344
|
make3
|
|
344
|
-
} from "./chunk-
|
|
345
|
-
import"./chunk-
|
|
345
|
+
} from "./chunk-vsrjg9nm.js";
|
|
346
|
+
import"./chunk-5w6r4mw6.js";
|
|
346
347
|
|
|
347
348
|
// packages/core/src/sync-kit.ts
|
|
348
349
|
import { createHash } from "crypto";
|
|
@@ -4384,6 +4385,8 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
4384
4385
|
}
|
|
4385
4386
|
if (ready.value.end !== undefined)
|
|
4386
4387
|
return ended("terminal_ended")(yield* judge(ready.value));
|
|
4388
|
+
if (request.launched !== undefined)
|
|
4389
|
+
yield* request.launched;
|
|
4387
4390
|
const brief = firstMessage(request.launch, workspace, launch.systemBrief === true);
|
|
4388
4391
|
const readyTurn = ready.value.turn;
|
|
4389
4392
|
const deliver = (tries) => gen(function* () {
|
|
@@ -4988,22 +4991,29 @@ function runReplica(control, executor, signals) {
|
|
|
4988
4991
|
let leaseLost = false;
|
|
4989
4992
|
let crashed;
|
|
4990
4993
|
let tokens;
|
|
4994
|
+
let ranModel;
|
|
4991
4995
|
const takeSpent = executor.spent?.(work.id) ?? undefined_;
|
|
4992
4996
|
return yield* gen(function* () {
|
|
4993
4997
|
const execution = executor.execute(work).pipe(mapError2((cause) => new RunnerReplicaError({ operation: "execute", kind: "rejected", cause })));
|
|
4994
4998
|
const raced = yield* raceFirst(execution, raceFirst(workHeartbeat, pushedStop)).pipe(catchIf((error) => error instanceof RunnerReplicaCancellation, () => succeed6({ status: "canceled", failureSummary: "Cancellation requested" })));
|
|
4995
4999
|
const cutOff = yield* takeSpent;
|
|
4996
|
-
const outcome = "tokens" in raced || cutOff === undefined ? raced : { ...raced,
|
|
5000
|
+
const outcome = "tokens" in raced || cutOff === undefined ? raced : { ...raced, ...cutOff };
|
|
4997
5001
|
if (outcome.status === "deferred") {
|
|
4998
5002
|
crashed = outcome.crashed;
|
|
4999
5003
|
tokens = outcome.tokens;
|
|
5004
|
+
ranModel = outcome.ranModel;
|
|
5000
5005
|
return { status: "deferred" };
|
|
5001
5006
|
}
|
|
5002
5007
|
if (outcome.status === "settled") {
|
|
5003
5008
|
tokens = "tokens" in outcome ? outcome.tokens : undefined;
|
|
5004
|
-
|
|
5009
|
+
ranModel = "ranModel" in outcome ? outcome.ranModel : undefined;
|
|
5010
|
+
completed = tokens === undefined && ranModel === undefined;
|
|
5005
5011
|
return { status: "completed", workUnitId: work.id };
|
|
5006
5012
|
}
|
|
5013
|
+
if (outcome.status !== "failed" || outcome.harnessHold?.reason !== "failed_to_start") {
|
|
5014
|
+
tokens = "tokens" in outcome ? outcome.tokens : undefined;
|
|
5015
|
+
ranModel = "ranModel" in outcome ? outcome.ranModel : undefined;
|
|
5016
|
+
}
|
|
5007
5017
|
yield* call("complete", () => control.complete({
|
|
5008
5018
|
workUnitId: work.id,
|
|
5009
5019
|
lease,
|
|
@@ -5014,7 +5024,10 @@ function runReplica(control, executor, signals) {
|
|
|
5014
5024
|
return { status: "completed", workUnitId: work.id };
|
|
5015
5025
|
}).pipe(tapError2((error) => sync2(() => {
|
|
5016
5026
|
leaseLost = error instanceof RunnerReplicaError && error.operation !== "execute" && error.kind !== "transient";
|
|
5017
|
-
})), ensuring2(suspend3(() => completed || leaseLost ? void_3 :
|
|
5027
|
+
})), ensuring2(suspend3(() => completed || leaseLost ? void_3 : gen(function* () {
|
|
5028
|
+
const cutOff = tokens === undefined && ranModel === undefined ? yield* takeSpent : undefined;
|
|
5029
|
+
yield* call("release", () => control.release(work.id, lease, crashed, cutOff?.tokens ?? tokens, cutOff?.ranModel ?? ranModel));
|
|
5030
|
+
}).pipe(timeout(releaseTimeout), catch_((error) => logWarning("runner_release_failed", error.message))))), ensuring2(asVoid(takeSpent)), ensuring2(control.finished?.() ?? void_3));
|
|
5018
5031
|
}));
|
|
5019
5032
|
}
|
|
5020
5033
|
var ConcurrencyRecheck = seconds(1);
|
|
@@ -5290,6 +5303,12 @@ var tokenCounter = (harness) => {
|
|
|
5290
5303
|
let reported = false;
|
|
5291
5304
|
let message;
|
|
5292
5305
|
let codexTotal;
|
|
5306
|
+
let model;
|
|
5307
|
+
const ran = (named) => {
|
|
5308
|
+
const identified = isString2(named) ? reportedModelName(named) : undefined;
|
|
5309
|
+
if (identified !== undefined)
|
|
5310
|
+
model = identified;
|
|
5311
|
+
};
|
|
5293
5312
|
const add = (usage) => {
|
|
5294
5313
|
reported = true;
|
|
5295
5314
|
counted.input += usage.input;
|
|
@@ -5302,6 +5321,7 @@ var tokenCounter = (harness) => {
|
|
|
5302
5321
|
return;
|
|
5303
5322
|
const { usage } = said;
|
|
5304
5323
|
const id = isString2(said.id) ? said.id : undefined;
|
|
5324
|
+
ran(said.model);
|
|
5305
5325
|
const spent = {
|
|
5306
5326
|
input: count(usage.input_tokens) + count(usage.cache_creation_input_tokens),
|
|
5307
5327
|
output: count(usage.output_tokens),
|
|
@@ -5319,6 +5339,8 @@ var tokenCounter = (harness) => {
|
|
|
5319
5339
|
add(spent);
|
|
5320
5340
|
};
|
|
5321
5341
|
const codex = (line) => {
|
|
5342
|
+
if (line.type === "turn_context" && isJsonObject(line.payload))
|
|
5343
|
+
ran(line.payload.model);
|
|
5322
5344
|
const event = line.type === "event_msg" ? line.payload : undefined;
|
|
5323
5345
|
const info = isJsonObject(event) && event.type === "token_count" ? event.info : undefined;
|
|
5324
5346
|
if (!isJsonObject(info) || !isJsonObject(info.last_token_usage))
|
|
@@ -5336,6 +5358,7 @@ var tokenCounter = (harness) => {
|
|
|
5336
5358
|
if (!isJsonObject(said) || said.role !== "assistant" || !isJsonObject(said.usage))
|
|
5337
5359
|
return;
|
|
5338
5360
|
const { usage } = said;
|
|
5361
|
+
ran(said.model);
|
|
5339
5362
|
add({
|
|
5340
5363
|
input: count(usage.input) + count(usage.cacheWrite),
|
|
5341
5364
|
output: count(usage.output),
|
|
@@ -5353,6 +5376,7 @@ var tokenCounter = (harness) => {
|
|
|
5353
5376
|
if (read !== undefined && isJsonObject(line))
|
|
5354
5377
|
read(line);
|
|
5355
5378
|
},
|
|
5379
|
+
model: () => model,
|
|
5356
5380
|
tokens: () => {
|
|
5357
5381
|
if (!reported)
|
|
5358
5382
|
return "none";
|
|
@@ -5580,6 +5604,12 @@ var transcriptRelay = (input) => {
|
|
|
5580
5604
|
let refusal;
|
|
5581
5605
|
let codexLimits;
|
|
5582
5606
|
let errorReadAt;
|
|
5607
|
+
let opencodeModel;
|
|
5608
|
+
const namedModel = (named) => {
|
|
5609
|
+
const identified = named === null ? undefined : reportedModelName(named);
|
|
5610
|
+
if (identified !== undefined)
|
|
5611
|
+
opencodeModel = identified;
|
|
5612
|
+
};
|
|
5583
5613
|
const heard = (said) => {
|
|
5584
5614
|
if (refusal === undefined || refusal.retried === true)
|
|
5585
5615
|
refusal = said;
|
|
@@ -5795,6 +5825,7 @@ var transcriptRelay = (input) => {
|
|
|
5795
5825
|
asking: sync2(() => asking.size > 0),
|
|
5796
5826
|
loginLost: sync2(() => loginLost),
|
|
5797
5827
|
refusal: sync2(() => refusal),
|
|
5828
|
+
ranModel: sync2(() => opencodeModel ?? tokens.model()),
|
|
5798
5829
|
tokens: (source) => gen(function* () {
|
|
5799
5830
|
const own = tokens.tokens();
|
|
5800
5831
|
if (source?.kind !== "file" || source.subagents === undefined)
|
|
@@ -5812,8 +5843,10 @@ var transcriptRelay = (input) => {
|
|
|
5812
5843
|
yield* flush;
|
|
5813
5844
|
yield* yieldNow;
|
|
5814
5845
|
}
|
|
5815
|
-
if (extent !== errorReadAt)
|
|
5846
|
+
if (extent !== errorReadAt) {
|
|
5816
5847
|
heard(opencodeProviderRefusal(yield* readOpencode2(source, "lastError", { v2: true })));
|
|
5848
|
+
namedModel(yield* readOpencode2(source, "lastModel", { v2: true }));
|
|
5849
|
+
}
|
|
5817
5850
|
errorReadAt = extent;
|
|
5818
5851
|
return;
|
|
5819
5852
|
}
|
|
@@ -5826,6 +5859,7 @@ var transcriptRelay = (input) => {
|
|
|
5826
5859
|
yield* yieldNow;
|
|
5827
5860
|
}
|
|
5828
5861
|
heard(opencodeProviderRefusal(yield* readOpencode2(source, "lastError", { v2: false })));
|
|
5862
|
+
namedModel(yield* readOpencode2(source, "lastModel", { v2: false }));
|
|
5829
5863
|
return;
|
|
5830
5864
|
}
|
|
5831
5865
|
yield* drain;
|
|
@@ -6316,6 +6350,9 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
|
|
|
6316
6350
|
});
|
|
6317
6351
|
let source;
|
|
6318
6352
|
let tokens;
|
|
6353
|
+
let ranModel;
|
|
6354
|
+
let launched = false;
|
|
6355
|
+
const attemptScope = yield* scope2;
|
|
6319
6356
|
const relayed = relay === undefined || adapter === undefined ? void_3 : gen(function* () {
|
|
6320
6357
|
source ??= yield* transcriptSource(adapter, {
|
|
6321
6358
|
...sessions,
|
|
@@ -6411,7 +6448,9 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
|
|
|
6411
6448
|
host: refusal.host.slice(0, 300),
|
|
6412
6449
|
reason: refusal.reason.slice(0, 500)
|
|
6413
6450
|
}
|
|
6414
|
-
])
|
|
6451
|
+
]), andThen2(sync2(() => {
|
|
6452
|
+
launched = true;
|
|
6453
|
+
}), input.harnessStarted === undefined ? void_3 : asVoid(forkIn(input.harnessStarted(work).pipe(retry({ times: 3, schedule: exponential("1 second") }), catch_((error) => logWarning("runner_harness_started_report_failed", error.message))), attemptScope)))).pipe(raceFirst(stalled), raceFirst(parked), raceFirst(providerRefused), raceFirst(loginLost), onExit((exit) => gen(function* () {
|
|
6415
6454
|
if (relay === undefined || relaying === undefined)
|
|
6416
6455
|
return;
|
|
6417
6456
|
yield* interrupt(relaying);
|
|
@@ -6419,7 +6458,12 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
|
|
|
6419
6458
|
yield* relayed.pipe(timeout("5 seconds"), ignore);
|
|
6420
6459
|
const spentNow = yield* relay.tokens(source).pipe(timeoutOrElse({ duration: "5 seconds", orElse: () => relay.tokens(undefined) }));
|
|
6421
6460
|
tokens = spentNow;
|
|
6422
|
-
|
|
6461
|
+
ranModel = yield* relay.ranModel;
|
|
6462
|
+
if (launched && !(isSuccess2(exit) && failedToStart(exit.value)))
|
|
6463
|
+
input.spending?.set(work.id, {
|
|
6464
|
+
tokens: spentNow,
|
|
6465
|
+
...ranModel === undefined ? undefined : { ranModel }
|
|
6466
|
+
});
|
|
6423
6467
|
yield* andThen2(relay.record([{ kind: "lifecycle", state }]), relay.lastFlush).pipe(timeout("5 seconds"), ignore);
|
|
6424
6468
|
const sending = yield* forkIn(relay.sendRest, input.runnerScope ?? makeUnsafe6());
|
|
6425
6469
|
resending.set(work.id, sending);
|
|
@@ -6428,7 +6472,7 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
|
|
|
6428
6472
|
})));
|
|
6429
6473
|
if (checkpointing !== undefined)
|
|
6430
6474
|
yield* interrupt(checkpointing);
|
|
6431
|
-
const spent = tokens === undefined ? undefined : { tokens };
|
|
6475
|
+
const spent = tokens === undefined || !launched ? undefined : { tokens, ...ranModel === undefined ? undefined : { ranModel } };
|
|
6432
6476
|
if (ran.status === "parked")
|
|
6433
6477
|
return { status: "deferred", ...spent };
|
|
6434
6478
|
const refused = ran.status === "failed" && !("harnessHold" in ran) && relay !== undefined ? yield* relay.refusal : undefined;
|
|
@@ -6474,6 +6518,7 @@ var stepAttempt = (input, resending) => (work) => gen(function* () {
|
|
|
6474
6518
|
return yield* deliver(work.branch, spent);
|
|
6475
6519
|
}).pipe(scoped);
|
|
6476
6520
|
var agentStepExecutor = (input) => stepAttempt(input, new Map);
|
|
6521
|
+
var failedToStart = (ran) => ran.status === "failed" && ran.harnessHold?.reason === "failed_to_start";
|
|
6477
6522
|
var checkpointRef = (work) => `refs/kitman/checkpoints/${work.runId}/${work.id}`;
|
|
6478
6523
|
|
|
6479
6524
|
// packages/agent-runtime/src/herdr-executor.ts
|