replicas-engine 0.1.1578 → 0.1.1580
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/src/{asp-host-LECNSTZX.js → asp-host-VLVA2YFI.js} +5 -5
- package/dist/src/{chunk-EHI2HOND.js → chunk-CEBOAXL7.js} +26 -65
- package/dist/src/{chunk-Z2EMZN3D.js → chunk-KASB62W3.js} +12 -7
- package/dist/src/{chunk-77WDDGJ7.js → chunk-KMTY4GTY.js} +1 -1
- package/dist/src/{chunk-RXPPCO4J.js → chunk-QDBI5OGL.js} +2 -2
- package/dist/src/{chunk-QJKTRUZV.js → chunk-QWCOEM7R.js} +2 -2
- package/dist/src/{chunk-JSGC7ML6.js → chunk-TJKPM3VM.js} +3 -3
- package/dist/src/{chunk-QLZQEDJC.js → chunk-W2VY74XF.js} +1 -1
- package/dist/src/{chunk-MN6KU3A7.js → chunk-XSOJIRAF.js} +2 -2
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +68 -31
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
listCodexModelsForDetails,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-KASB62W3.js";
|
|
12
|
+
import "./chunk-XSOJIRAF.js";
|
|
13
|
+
import "./chunk-TJKPM3VM.js";
|
|
14
|
+
import "./chunk-KMTY4GTY.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-CEBOAXL7.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -9840,16 +9840,6 @@ var CLAUDE_SONNET_5_5_MODEL = "claude-sonnet-5-5";
|
|
|
9840
9840
|
var CLAUDE_SONNET_5_MODEL = "claude-sonnet-5";
|
|
9841
9841
|
var CLAUDE_HAIKU_5_5_MODEL = "claude-haiku-5-5";
|
|
9842
9842
|
var CLAUDE_HAIKU_4_5_MODEL = "claude-haiku-4-5";
|
|
9843
|
-
var CLAUDE_FABLE_5_2_BEDROCK_MODEL = "anthropic.claude-fable-5-2";
|
|
9844
|
-
var CLAUDE_FABLE_5_1_BEDROCK_MODEL = "anthropic.claude-fable-5-1";
|
|
9845
|
-
var CLAUDE_FABLE_5_BEDROCK_MODEL = "anthropic.claude-fable-5";
|
|
9846
|
-
var CLAUDE_OPUS_5_5_BEDROCK_MODEL = "anthropic.claude-opus-5-5";
|
|
9847
|
-
var CLAUDE_OPUS_5_BEDROCK_MODEL = "anthropic.claude-opus-5";
|
|
9848
|
-
var CLAUDE_OPUS_4_8_BEDROCK_MODEL = "us.anthropic.claude-opus-4-8";
|
|
9849
|
-
var CLAUDE_SONNET_5_5_BEDROCK_MODEL = "anthropic.claude-sonnet-5-5";
|
|
9850
|
-
var CLAUDE_SONNET_5_BEDROCK_MODEL = "anthropic.claude-sonnet-5";
|
|
9851
|
-
var CLAUDE_HAIKU_5_5_BEDROCK_MODEL = "anthropic.claude-haiku-5-5";
|
|
9852
|
-
var CLAUDE_HAIKU_4_5_BEDROCK_MODEL = "us.anthropic.claude-haiku-4-5-20251001-v1:0";
|
|
9853
9843
|
var DEFAULT_CLAUDE_MODEL = CLAUDE_OPUS_5_5_MODEL;
|
|
9854
9844
|
var GPT_6_ASTRA_MODEL = "gpt-6-astra";
|
|
9855
9845
|
var GPT_6_1_SOL_MODEL = "gpt-6.1-sol";
|
|
@@ -9912,35 +9902,6 @@ function normalizeClaudeModel(model2) {
|
|
|
9912
9902
|
}
|
|
9913
9903
|
return model2;
|
|
9914
9904
|
}
|
|
9915
|
-
function toClaudeCodeModel(model2, bedrock) {
|
|
9916
|
-
if (!bedrock) {
|
|
9917
|
-
return model2;
|
|
9918
|
-
}
|
|
9919
|
-
switch (normalizeClaudeModel(model2)) {
|
|
9920
|
-
case CLAUDE_FABLE_5_2_MODEL:
|
|
9921
|
-
return CLAUDE_FABLE_5_2_BEDROCK_MODEL;
|
|
9922
|
-
case CLAUDE_FABLE_5_1_MODEL:
|
|
9923
|
-
return CLAUDE_FABLE_5_1_BEDROCK_MODEL;
|
|
9924
|
-
case CLAUDE_FABLE_5_MODEL:
|
|
9925
|
-
return CLAUDE_FABLE_5_BEDROCK_MODEL;
|
|
9926
|
-
case CLAUDE_OPUS_5_5_MODEL:
|
|
9927
|
-
return CLAUDE_OPUS_5_5_BEDROCK_MODEL;
|
|
9928
|
-
case CLAUDE_OPUS_5_MODEL:
|
|
9929
|
-
return CLAUDE_OPUS_5_BEDROCK_MODEL;
|
|
9930
|
-
case CLAUDE_OPUS_4_8_MODEL:
|
|
9931
|
-
return "opus";
|
|
9932
|
-
case CLAUDE_SONNET_5_5_MODEL:
|
|
9933
|
-
return CLAUDE_SONNET_5_5_BEDROCK_MODEL;
|
|
9934
|
-
case CLAUDE_SONNET_5_MODEL:
|
|
9935
|
-
return "sonnet";
|
|
9936
|
-
case CLAUDE_HAIKU_5_5_MODEL:
|
|
9937
|
-
return CLAUDE_HAIKU_5_5_BEDROCK_MODEL;
|
|
9938
|
-
case CLAUDE_HAIKU_4_5_MODEL:
|
|
9939
|
-
return "haiku";
|
|
9940
|
-
default:
|
|
9941
|
-
return model2;
|
|
9942
|
-
}
|
|
9943
|
-
}
|
|
9944
9905
|
var CLAUDE_MODEL_CONTEXT_WINDOWS = {
|
|
9945
9906
|
[CLAUDE_FABLE_5_2_MODEL]: 1e6,
|
|
9946
9907
|
[CLAUDE_FABLE_5_1_MODEL]: 1e6,
|
|
@@ -9952,26 +9913,14 @@ var CLAUDE_MODEL_CONTEXT_WINDOWS = {
|
|
|
9952
9913
|
[CLAUDE_SONNET_5_MODEL]: 1e6,
|
|
9953
9914
|
[CLAUDE_HAIKU_5_5_MODEL]: 1e6,
|
|
9954
9915
|
[CLAUDE_HAIKU_4_5_MODEL]: 2e5,
|
|
9955
|
-
[CLAUDE_FABLE_5_2_BEDROCK_MODEL]: 1e6,
|
|
9956
|
-
[CLAUDE_FABLE_5_1_BEDROCK_MODEL]: 1e6,
|
|
9957
|
-
[CLAUDE_FABLE_5_BEDROCK_MODEL]: 1e6,
|
|
9958
|
-
[CLAUDE_OPUS_5_5_BEDROCK_MODEL]: 1e6,
|
|
9959
|
-
[CLAUDE_OPUS_5_BEDROCK_MODEL]: 1e6,
|
|
9960
|
-
[CLAUDE_OPUS_4_8_BEDROCK_MODEL]: 1e6,
|
|
9961
|
-
[CLAUDE_SONNET_5_5_BEDROCK_MODEL]: 1e6,
|
|
9962
|
-
[CLAUDE_SONNET_5_BEDROCK_MODEL]: 1e6,
|
|
9963
|
-
[CLAUDE_HAIKU_5_5_BEDROCK_MODEL]: 1e6,
|
|
9964
|
-
[CLAUDE_HAIKU_4_5_BEDROCK_MODEL]: 2e5,
|
|
9965
|
-
"anthropic.claude-opus-4-8": 1e6,
|
|
9966
|
-
"us.anthropic.claude-sonnet-5": 1e6,
|
|
9967
|
-
"anthropic.claude-haiku-4-5": 2e5,
|
|
9968
9916
|
"claude-haiku-4-5-20251001": 2e5,
|
|
9969
9917
|
"claude-haiku-4-5@20251001": 2e5
|
|
9970
9918
|
};
|
|
9971
9919
|
function getClaudeModelContextWindow(model2) {
|
|
9972
9920
|
if (!model2) return null;
|
|
9973
|
-
const
|
|
9974
|
-
|
|
9921
|
+
const firstParty = model2.replace(/^(?:[a-z-]+\.)?anthropic\./, "").replace(/-v\d+(?::\d+)?$/, "");
|
|
9922
|
+
const normalized = normalizeClaudeModel(firstParty) ?? firstParty;
|
|
9923
|
+
return CLAUDE_MODEL_CONTEXT_WINDOWS[normalized] ?? CLAUDE_MODEL_CONTEXT_WINDOWS[firstParty] ?? null;
|
|
9975
9924
|
}
|
|
9976
9925
|
function canUseClaudeFastMode(model2) {
|
|
9977
9926
|
const normalized = normalizeClaudeModel(model2);
|
|
@@ -10085,7 +10034,7 @@ function getAgentModelOptions(provider2, overrides) {
|
|
|
10085
10034
|
if (provider2 === "cursor") return DEFAULT_CURSOR_MODELS;
|
|
10086
10035
|
return AGENT_MODELS[provider2] ?? [];
|
|
10087
10036
|
}
|
|
10088
|
-
var
|
|
10037
|
+
var MODEL_PREDECESSORS = {
|
|
10089
10038
|
[CLAUDE_FABLE_5_2_MODEL]: CLAUDE_FABLE_5_1_MODEL,
|
|
10090
10039
|
[CLAUDE_OPUS_5_5_MODEL]: CLAUDE_OPUS_5_MODEL,
|
|
10091
10040
|
[CLAUDE_SONNET_5_5_MODEL]: CLAUDE_SONNET_5_MODEL,
|
|
@@ -10895,7 +10844,7 @@ var AUTH_RETRY_STATUS_EVENT_TYPE = "auth-retry-status";
|
|
|
10895
10844
|
var CURSOR_CONNECTION_STATUS_EVENT_TYPE = "cursor-connection-status";
|
|
10896
10845
|
var AUTH_FALLBACK_EVENT_TYPE = "auth-fallback";
|
|
10897
10846
|
function coerceAuthFallbackPayload(payload) {
|
|
10898
|
-
const { provider: provider2, reason, exhaustedMethod, exhaustedScope, candidateMethod, candidateScope, status, detail } = payload;
|
|
10847
|
+
const { provider: provider2, reason, exhaustedMethod, exhaustedScope, candidateMethod, candidateScope, status, detail, fromModel, toModel } = payload;
|
|
10899
10848
|
const exhaustedAccount = credentialAccountSchema.safeParse(payload.exhaustedAccount).data;
|
|
10900
10849
|
const candidateAccount = credentialAccountSchema.safeParse(payload.candidateAccount).data;
|
|
10901
10850
|
if (typeof provider2 !== "string" || !isValidAgentProvider(provider2) || !isAgentFallbackReason(reason) || !isAuthMethod(exhaustedMethod) || !isAuthMethod(candidateMethod) || !isCredentialScope(candidateScope) || status !== "switched" && status !== "failed") {
|
|
@@ -10911,7 +10860,8 @@ function coerceAuthFallbackPayload(payload) {
|
|
|
10911
10860
|
candidateScope,
|
|
10912
10861
|
...candidateAccount ? { candidateAccount } : {},
|
|
10913
10862
|
status,
|
|
10914
|
-
...typeof detail === "string" && detail ? { detail } : {}
|
|
10863
|
+
...typeof detail === "string" && detail ? { detail } : {},
|
|
10864
|
+
...typeof fromModel === "string" && typeof toModel === "string" ? { fromModel, toModel } : {}
|
|
10915
10865
|
};
|
|
10916
10866
|
}
|
|
10917
10867
|
var CHAT_GOAL_STATUSES = [
|
|
@@ -11849,6 +11799,12 @@ function describeAuthFallback(payload) {
|
|
|
11849
11799
|
account: payload.exhaustedAccount
|
|
11850
11800
|
});
|
|
11851
11801
|
const switched = payload.status === "switched";
|
|
11802
|
+
if (payload.fromModel && payload.toModel) {
|
|
11803
|
+
return {
|
|
11804
|
+
headline: `${MODEL_LABELS[payload.fromModel] ?? payload.fromModel} isn't available on ${exhausted}`,
|
|
11805
|
+
outcomeClause: `switched to ${MODEL_LABELS[payload.toModel] ?? payload.toModel}`
|
|
11806
|
+
};
|
|
11807
|
+
}
|
|
11852
11808
|
return {
|
|
11853
11809
|
headline: payload.reason === "out_of_credits" ? `${agent} is out of credits on ${exhausted}` : payload.reason === "auth_failed" ? `${agent} could not authenticate with ${exhausted}` : payload.reason === "credits_required" ? `The selected model needs usage credits on ${exhausted}` : payload.reason === "model_unavailable" ? `The selected model is not available on ${exhausted}` : `${agent} hit its usage limit on ${exhausted}`,
|
|
11854
11810
|
outcomeClause: switched ? `switched to ${describeCredential(payload.provider, {
|
|
@@ -12258,6 +12214,7 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
12258
12214
|
linkSlackChannel: "link_slack_channel",
|
|
12259
12215
|
createSlackChannel: "create_slack_channel",
|
|
12260
12216
|
unlinkSlackChannel: "unlink_slack_channel",
|
|
12217
|
+
setSlackChannelLevel: "set_slack_channel_level",
|
|
12261
12218
|
createReplica: "create_replica",
|
|
12262
12219
|
listReplicas: "list_replicas",
|
|
12263
12220
|
getReplica: "get_replica",
|
|
@@ -16056,7 +16013,7 @@ ${operation.diff}` : ""}`).join("\n\n");
|
|
|
16056
16013
|
}
|
|
16057
16014
|
if (message2.type === "auth_fallback") {
|
|
16058
16015
|
const { headline, outcomeClause } = describeAuthFallback(message2);
|
|
16059
|
-
return { kind: "error", title: "Credential fallback", summary: headline, content: [`The workspace ${outcomeClause}.`, message2.detail].filter(Boolean).join("\n\n") };
|
|
16016
|
+
return { kind: "error", title: message2.toModel ? "Model fallback" : "Credential fallback", summary: headline, content: [`The workspace ${outcomeClause}.`, message2.detail].filter(Boolean).join("\n\n") };
|
|
16060
16017
|
}
|
|
16061
16018
|
if (message2.type === "harness_switch") return { kind: "error", title: describeHarnessSwitch(message2), summary: "", content: "" };
|
|
16062
16019
|
if (message2.type === "interruption") return { kind: "error", title: "Agent stopped", summary: "", content: "" };
|
|
@@ -16736,6 +16693,7 @@ var REPLICAS_API_STEPS = {
|
|
|
16736
16693
|
[REPLICAS_MCP_TOOLS.linkSlackChannel]: { icon: "wrench", live: "Linking Slack channel", done: "Linked Slack channel" },
|
|
16737
16694
|
[REPLICAS_MCP_TOOLS.createSlackChannel]: { icon: "wrench", live: "Creating Slack channel", done: "Created Slack channel" },
|
|
16738
16695
|
[REPLICAS_MCP_TOOLS.unlinkSlackChannel]: { icon: "trash", live: "Unlinking Slack channel", done: "Unlinked Slack channel" },
|
|
16696
|
+
[REPLICAS_MCP_TOOLS.setSlackChannelLevel]: { icon: "wrench", live: "Changing Slack channel level", done: "Changed Slack channel level" },
|
|
16739
16697
|
[REPLICAS_MCP_TOOLS.getBoard]: { icon: "book", live: "Reading board", done: "Read board" },
|
|
16740
16698
|
[REPLICAS_MCP_TOOLS.updateBoard]: { icon: "file-pen", live: "Updating board", done: "Updated board" },
|
|
16741
16699
|
[REPLICAS_MCP_TOOLS.updateTicket]: { icon: "file-pen", live: "Updating ticket", done: "Updated ticket" },
|
|
@@ -20188,7 +20146,7 @@ var VOICE_WAVEFORM = {
|
|
|
20188
20146
|
};
|
|
20189
20147
|
|
|
20190
20148
|
// ../shared/src/e2b.ts
|
|
20191
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-15-
|
|
20149
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-15-v5";
|
|
20192
20150
|
|
|
20193
20151
|
// ../shared/src/e2b-retry.ts
|
|
20194
20152
|
var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
|
|
@@ -21245,6 +21203,9 @@ var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.ext
|
|
|
21245
21203
|
proactivity: z31.enum([...SCOUT_PROACTIVITY_LEVELS, "organization"]).optional().describe("Slack only: this channel's or group DM's own level, overriding the organization's here alone. `organization` makes it follow the organization's level again. Omit to keep it. 1:1 DMs are always addressed to Replicas, so they take no level."),
|
|
21246
21204
|
muted: z31.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` mutes Replicas in this channel, \`off\` unmutes it here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`)
|
|
21247
21205
|
});
|
|
21206
|
+
var mothershipSlackChannelLevelToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21207
|
+
proactivity: scoutUpdateChannelSettingsToolInputSchema.shape.proactivity.unwrap().describe("This channel's own level. `organization` makes it follow the organization's level again, which a Mothership's channel raises to at least `balanced`.")
|
|
21208
|
+
});
|
|
21248
21209
|
var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
21249
21210
|
muted: z31.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
|
|
21250
21211
|
});
|
|
@@ -22536,8 +22497,6 @@ export {
|
|
|
22536
22497
|
TERMINAL_RTC_ICE_SERVER,
|
|
22537
22498
|
exhaustedUntil,
|
|
22538
22499
|
detectAgentQuotaLimit,
|
|
22539
|
-
describeCredential,
|
|
22540
|
-
fallbackPlanResponseSchema,
|
|
22541
22500
|
ASTER_PROVIDER,
|
|
22542
22501
|
ASTER_BASE_URL,
|
|
22543
22502
|
ASTER_MODELS,
|
|
@@ -22554,9 +22513,6 @@ export {
|
|
|
22554
22513
|
isDefaultChat,
|
|
22555
22514
|
hasGeneratedChatTitle,
|
|
22556
22515
|
isPullRequestFeedbackChat,
|
|
22557
|
-
CLAUDE_OPUS_4_8_BEDROCK_MODEL,
|
|
22558
|
-
CLAUDE_SONNET_5_BEDROCK_MODEL,
|
|
22559
|
-
CLAUDE_HAIKU_4_5_BEDROCK_MODEL,
|
|
22560
22516
|
DEFAULT_CLAUDE_MODEL,
|
|
22561
22517
|
DEFAULT_CODEX_MODEL,
|
|
22562
22518
|
DEFAULT_CURSOR_MODEL,
|
|
@@ -22565,10 +22521,11 @@ export {
|
|
|
22565
22521
|
DEFAULT_PI_MODEL,
|
|
22566
22522
|
getDefaultAgentModel,
|
|
22567
22523
|
normalizeClaudeModel,
|
|
22568
|
-
toClaudeCodeModel,
|
|
22569
22524
|
getClaudeModelContextWindow,
|
|
22570
22525
|
canUseClaudeFastMode,
|
|
22571
22526
|
AGENT_MODELS,
|
|
22527
|
+
MODEL_PREDECESSORS,
|
|
22528
|
+
MODEL_LABELS,
|
|
22572
22529
|
IMAGE_MEDIA_TYPES,
|
|
22573
22530
|
MAX_PENDING_RESOURCE_MINUTES,
|
|
22574
22531
|
MAX_CANVAS_FILE_BYTES,
|
|
@@ -22579,6 +22536,9 @@ export {
|
|
|
22579
22536
|
classifyCanvasFilename,
|
|
22580
22537
|
isValidEngineLogSessionId,
|
|
22581
22538
|
paginateEngineLogContent,
|
|
22539
|
+
describeCredential,
|
|
22540
|
+
describeAuthFallback,
|
|
22541
|
+
fallbackPlanResponseSchema,
|
|
22582
22542
|
coerceChatForkInfo,
|
|
22583
22543
|
forkChatRequestSchema,
|
|
22584
22544
|
describeQuotaLimit,
|
|
@@ -22612,6 +22572,7 @@ export {
|
|
|
22612
22572
|
AUTH_RETRY_STATUS_EVENT_TYPE,
|
|
22613
22573
|
CURSOR_CONNECTION_STATUS_EVENT_TYPE,
|
|
22614
22574
|
AUTH_FALLBACK_EVENT_TYPE,
|
|
22575
|
+
coerceAuthFallbackPayload,
|
|
22615
22576
|
coerceChatGoalPayload,
|
|
22616
22577
|
CONTEXT_USAGE_EVENT_TYPE,
|
|
22617
22578
|
MERGED_MESSAGE_SEPARATOR,
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
resolveDiffBase,
|
|
13
13
|
runGitCommand,
|
|
14
14
|
setAgentCredentialSnapshot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XSOJIRAF.js";
|
|
16
16
|
import {
|
|
17
17
|
AppServerProcess,
|
|
18
18
|
buildCodexAgentEnv
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TJKPM3VM.js";
|
|
20
20
|
import {
|
|
21
21
|
SUBPROCESS_MAX_BUFFER,
|
|
22
22
|
execFileAsync
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-KMTY4GTY.js";
|
|
24
24
|
import {
|
|
25
25
|
isRecord
|
|
26
26
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
shrunkImageSize,
|
|
62
62
|
splitMothershipInstructions,
|
|
63
63
|
withTimeout
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-CEBOAXL7.js";
|
|
65
65
|
|
|
66
66
|
// src/managers/codex-token-manager.ts
|
|
67
67
|
import { promises as fs } from "fs";
|
|
@@ -123,9 +123,13 @@ function routineRefreshRequest(provider) {
|
|
|
123
123
|
...live ? { currentCredential: live } : {}
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
+
var exhaustedKey = (credential) => `${credential.method}|${credential.scope}|${credential.credentialId ?? ""}`;
|
|
127
|
+
function forgetExhaustedCredentials(provider, credentials) {
|
|
128
|
+
for (const credential of credentials) exhaustedByAgent.get(provider)?.delete(exhaustedKey(credential));
|
|
129
|
+
}
|
|
126
130
|
function recordExhaustedCredential(provider, credential, resetsAt) {
|
|
127
131
|
const spent = exhaustedByAgent.get(provider) ?? /* @__PURE__ */ new Map();
|
|
128
|
-
spent.set(
|
|
132
|
+
spent.set(exhaustedKey(credential), {
|
|
129
133
|
credential,
|
|
130
134
|
until: exhaustedUntil(resetsAt).getTime()
|
|
131
135
|
});
|
|
@@ -457,7 +461,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
457
461
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
458
462
|
await this.applyCredentialsResponse(data);
|
|
459
463
|
setAgentCredentialSnapshot("codex", data);
|
|
460
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
464
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-VLVA2YFI.js");
|
|
461
465
|
await restartCodexAspHostIfRunning2();
|
|
462
466
|
});
|
|
463
467
|
await this.start(true);
|
|
@@ -479,7 +483,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
479
483
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
480
484
|
await this.applyCredentialsResponse(data);
|
|
481
485
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
482
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
486
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-VLVA2YFI.js");
|
|
483
487
|
await restartCodexAspHostIfRunning2();
|
|
484
488
|
}
|
|
485
489
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -2278,6 +2282,7 @@ export {
|
|
|
2278
2282
|
recordCredentialFallback,
|
|
2279
2283
|
listCredentialFallbacks,
|
|
2280
2284
|
routineRefreshRequest,
|
|
2285
|
+
forgetExhaustedCredentials,
|
|
2281
2286
|
recordExhaustedCredential,
|
|
2282
2287
|
refreshDelayMs,
|
|
2283
2288
|
BaseRefreshManager,
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CEBOAXL7.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getOriginDefaultBranch,
|
|
7
7
|
monolithRequest,
|
|
8
8
|
runGitCommand
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XSOJIRAF.js";
|
|
10
10
|
import {
|
|
11
11
|
extractCommandProtectionCommandText,
|
|
12
12
|
findCommandProtectionGitLookups,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
findScoutRepoWriteSignals,
|
|
16
16
|
parseCommandProtectionRequest,
|
|
17
17
|
withE2BRetry
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CEBOAXL7.js";
|
|
19
19
|
|
|
20
20
|
// src/services/command-protection-service.ts
|
|
21
21
|
import { readFile, stat } from "fs/promises";
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
AspClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TJKPM3VM.js";
|
|
7
7
|
import {
|
|
8
8
|
ASTER_BASE_URL,
|
|
9
9
|
ASTER_PROVIDER,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isRecord,
|
|
16
16
|
readOllamaAuthEnv,
|
|
17
17
|
readOpenAICompatibleAuthEnv
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CEBOAXL7.js";
|
|
19
19
|
|
|
20
20
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
21
21
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
execFileAsync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KMTY4GTY.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CEBOAXL7.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
|
|
|
240
240
|
if (method === "foundry") return "azure";
|
|
241
241
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
242
242
|
}
|
|
243
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
243
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1579";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
SUBPROCESS_MAX_BUFFER,
|
|
6
6
|
execFileAsync
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KMTY4GTY.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord as isRecord2
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
provisionedDeviceSchema,
|
|
22
22
|
readReplicasRuntimeEnv,
|
|
23
23
|
serializePosixEnvFile
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CEBOAXL7.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-QDBI5OGL.js";
|
|
7
|
+
import "./chunk-XSOJIRAF.js";
|
|
8
|
+
import "./chunk-KMTY4GTY.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-CEBOAXL7.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
recoverCompletedTurn,
|
|
15
15
|
spawnMuseMsp,
|
|
16
16
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QWCOEM7R.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-TJKPM3VM.js";
|
|
22
|
+
import "./chunk-KMTY4GTY.js";
|
|
23
23
|
import {
|
|
24
24
|
AGENT,
|
|
25
25
|
OPENCODE_GO_PROVIDER,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
headlessAgentUsagePath,
|
|
30
30
|
isRecord,
|
|
31
31
|
withTimeout
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-CEBOAXL7.js";
|
|
33
33
|
import "./chunk-VEQXQN22.js";
|
|
34
34
|
|
|
35
35
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
evaluateCommandProtection,
|
|
28
28
|
extractToolCommand,
|
|
29
29
|
reportCommandProtectionBlock
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-QDBI5OGL.js";
|
|
31
31
|
import {
|
|
32
32
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
33
33
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -65,10 +65,10 @@ import {
|
|
|
65
65
|
spawnMuseMsp,
|
|
66
66
|
startMuseSession,
|
|
67
67
|
uuidV7
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-QWCOEM7R.js";
|
|
69
69
|
import {
|
|
70
70
|
publishedPullRequestUrls
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-W2VY74XF.js";
|
|
72
72
|
import {
|
|
73
73
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
74
74
|
AsyncLock,
|
|
@@ -114,6 +114,7 @@ import {
|
|
|
114
114
|
codexTokenManager,
|
|
115
115
|
configureManagedGitCredentialHelper,
|
|
116
116
|
extractRateLimitsSnapshot,
|
|
117
|
+
forgetExhaustedCredentials,
|
|
117
118
|
formatTurnFailure,
|
|
118
119
|
getAgentAdditionalDirectories,
|
|
119
120
|
getCodexAspHost,
|
|
@@ -146,7 +147,7 @@ import {
|
|
|
146
147
|
transcriptSecrets,
|
|
147
148
|
upsertCredentialFileLines,
|
|
148
149
|
writeSecureCredentialFile
|
|
149
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-KASB62W3.js";
|
|
150
151
|
import {
|
|
151
152
|
ENGINE_ENV,
|
|
152
153
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -157,15 +158,15 @@ import {
|
|
|
157
158
|
resolveDiffBase,
|
|
158
159
|
setAgentCredentialSnapshot,
|
|
159
160
|
setLinearSessionId
|
|
160
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-XSOJIRAF.js";
|
|
161
162
|
import {
|
|
162
163
|
getCodexModelProvider
|
|
163
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-TJKPM3VM.js";
|
|
164
165
|
import {
|
|
165
166
|
SUBPROCESS_MAX_BUFFER,
|
|
166
167
|
execAsync,
|
|
167
168
|
execFileAsync
|
|
168
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-KMTY4GTY.js";
|
|
169
170
|
import {
|
|
170
171
|
isRecord as isRecord2
|
|
171
172
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -190,11 +191,8 @@ import {
|
|
|
190
191
|
CHAT_TURN_LOST_MESSAGE,
|
|
191
192
|
CLAUDE_AUTH_ENV_KEYS,
|
|
192
193
|
CLAUDE_AUTH_ENV_KEYS_BY_METHOD,
|
|
193
|
-
CLAUDE_HAIKU_4_5_BEDROCK_MODEL,
|
|
194
|
-
CLAUDE_OPUS_4_8_BEDROCK_MODEL,
|
|
195
194
|
CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE,
|
|
196
195
|
CLAUDE_PEER_MESSAGE_EVENT_TYPE,
|
|
197
|
-
CLAUDE_SONNET_5_BEDROCK_MODEL,
|
|
198
196
|
CLAUDE_STOPPED_TOOL_RESULT,
|
|
199
197
|
CODEX_ASP_ITEM_ID_PAYLOAD_KEY,
|
|
200
198
|
CODEX_HISTORY_FORMAT_EVENT_TYPE,
|
|
@@ -248,6 +246,8 @@ import {
|
|
|
248
246
|
MAX_PENDING_RESOURCE_MINUTES,
|
|
249
247
|
MAX_REPO_FILE_CONTENT_BYTES,
|
|
250
248
|
MERGED_MESSAGE_SEPARATOR,
|
|
249
|
+
MODEL_LABELS,
|
|
250
|
+
MODEL_PREDECESSORS,
|
|
251
251
|
MOTHERSHIP_EVENT_MESSAGE_TYPE,
|
|
252
252
|
MOTHERSHIP_INSTRUCTIONS_TAG,
|
|
253
253
|
MOTHERSHIP_TURN_ERROR_SUMMARY,
|
|
@@ -297,6 +297,7 @@ import {
|
|
|
297
297
|
codexTranscriptToEvents,
|
|
298
298
|
codexTurnEvent,
|
|
299
299
|
codexTurnFromEvent,
|
|
300
|
+
coerceAuthFallbackPayload,
|
|
300
301
|
coerceBackgroundTaskPayload,
|
|
301
302
|
coerceChatForkInfo,
|
|
302
303
|
coerceChatGoalPayload,
|
|
@@ -311,6 +312,7 @@ import {
|
|
|
311
312
|
createUuidFromHex,
|
|
312
313
|
currentStepLabel,
|
|
313
314
|
defaultForkChatTitle,
|
|
315
|
+
describeAuthFallback,
|
|
314
316
|
describeCredential,
|
|
315
317
|
describeQuotaLimit,
|
|
316
318
|
detectAgentQuotaLimit,
|
|
@@ -437,7 +439,6 @@ import {
|
|
|
437
439
|
steerQueuedInOrder,
|
|
438
440
|
stripAgentDiagnosticErrors,
|
|
439
441
|
threadHandoffText,
|
|
440
|
-
toClaudeCodeModel,
|
|
441
442
|
toolInputAnswer,
|
|
442
443
|
truncateMothershipEventResponse,
|
|
443
444
|
updateChatDisplayNameRequestSchema,
|
|
@@ -448,7 +449,7 @@ import {
|
|
|
448
449
|
workspaceTokenRequestSchema,
|
|
449
450
|
workspaceTokenResponseSchema,
|
|
450
451
|
wrapInTag
|
|
451
|
-
} from "./chunk-
|
|
452
|
+
} from "./chunk-CEBOAXL7.js";
|
|
452
453
|
import {
|
|
453
454
|
cloneMcpConfig,
|
|
454
455
|
ensureCompatibilityImports,
|
|
@@ -11486,6 +11487,11 @@ function describeLoginFailure(provider, login, configuredMethod, revoked) {
|
|
|
11486
11487
|
const reconnect = orgLogin ? `An organization admin can reconnect it in ${agentsPage}` : `Reconnect it in ${agentsPage}`;
|
|
11487
11488
|
return `${agent} could not sign in with ${name}. ${why} ${reconnect}`;
|
|
11488
11489
|
}
|
|
11490
|
+
function describeModelUnavailable(provider, models, credential) {
|
|
11491
|
+
const bedrock = credential?.method === "bedrock";
|
|
11492
|
+
const where = credential ? describeCredential(provider, credential) : `the ${getProviderDisplayName(provider)} credential this workspace uses`;
|
|
11493
|
+
return `${models.map((model) => MODEL_LABELS[model] ?? model).join(" and ")} ${models.length > 1 ? "are" : "is"} not available on ${where}${bedrock && ENGINE_ENV.AWS_REGION ? ` in ${ENGINE_ENV.AWS_REGION}` : ""}.` + (bedrock ? " Turn on access for that region in the Amazon Bedrock console (Model access)," : "") + " pick a different model in the chat's model picker, or add a credential that serves it in Settings \u2192 Fallbacks.";
|
|
11494
|
+
}
|
|
11489
11495
|
var fallbackLocks = /* @__PURE__ */ new Map();
|
|
11490
11496
|
var AuthFallbackCoordinator = class {
|
|
11491
11497
|
constructor(provider, record3, context) {
|
|
@@ -12789,11 +12795,8 @@ function buildClaudeAgentEnv(overrides) {
|
|
|
12789
12795
|
if (method === "ollama" || method === "anthropic-compatible") env.ANTHROPIC_API_KEY = "";
|
|
12790
12796
|
if (isBedrock) {
|
|
12791
12797
|
env.CLAUDE_CODE_USE_BEDROCK = "1";
|
|
12792
|
-
env.CLAUDE_CODE_USE_MANTLE = "1";
|
|
12793
|
-
env.ANTHROPIC_DEFAULT_OPUS_MODEL = CLAUDE_OPUS_4_8_BEDROCK_MODEL;
|
|
12794
|
-
env.ANTHROPIC_DEFAULT_SONNET_MODEL = CLAUDE_SONNET_5_BEDROCK_MODEL;
|
|
12795
|
-
env.ANTHROPIC_DEFAULT_HAIKU_MODEL = CLAUDE_HAIKU_4_5_BEDROCK_MODEL;
|
|
12796
12798
|
}
|
|
12799
|
+
if (method === "bedrock" || env.REPLICAS_CLAUDE_AUTH_METHOD === "bedrock") env.AWS_BEARER_TOKEN_BEDROCK = void 0;
|
|
12797
12800
|
env.GH_TOKEN = void 0;
|
|
12798
12801
|
env.GITHUB_TOKEN = void 0;
|
|
12799
12802
|
env.GH_CONFIG_DIR = void 0;
|
|
@@ -13939,6 +13942,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13939
13942
|
let loginRevoked = false;
|
|
13940
13943
|
let namedLogin;
|
|
13941
13944
|
let failedCredentials = [];
|
|
13945
|
+
let modelRejected = [];
|
|
13942
13946
|
let walkLimit;
|
|
13943
13947
|
let attempt = 0;
|
|
13944
13948
|
let authRetries = 0;
|
|
@@ -14018,6 +14022,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14018
14022
|
const detail = error instanceof ClaudeQuotaError || error instanceof ClaudeModelUnavailableError ? error.message : extractErrorText(error);
|
|
14019
14023
|
const repeated = !!attemptedCredential && failedCredentials.some((failed) => isSameCredential(failed, attemptedCredential));
|
|
14020
14024
|
if (attemptedCredential) failedCredentials.push(attemptedCredential);
|
|
14025
|
+
if (attemptedCredential && modelUnavailable) modelRejected.push(attemptedCredential);
|
|
14021
14026
|
const limit = quotaKind ? { kind: quotaKind, credential: attemptedCredential } : walkLimit;
|
|
14022
14027
|
const fallback = repeated ? { outcome: "unavailable" } : await this.fallBackCredential(reason, detail, attemptedCredential, error instanceof ClaudeQuotaError ? error.resetsAt : void 0, !!walkLimit);
|
|
14023
14028
|
if (fallback.outcome === "switched") {
|
|
@@ -14041,7 +14046,38 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14041
14046
|
return;
|
|
14042
14047
|
}
|
|
14043
14048
|
if (modelUnavailable) {
|
|
14044
|
-
|
|
14049
|
+
const model = normalizeClaudeModel(currentRequest.model) ?? DEFAULT_CLAUDE_MODEL;
|
|
14050
|
+
const predecessor = MODEL_PREDECESSORS[model];
|
|
14051
|
+
if (predecessor) {
|
|
14052
|
+
currentRequest = { ...currentRequest, model: predecessor };
|
|
14053
|
+
if (attemptedCredential) {
|
|
14054
|
+
const { method, scope, account } = attemptedCredential;
|
|
14055
|
+
this.record({
|
|
14056
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
14057
|
+
type: AUTH_FALLBACK_EVENT_TYPE,
|
|
14058
|
+
payload: {
|
|
14059
|
+
provider: "claude",
|
|
14060
|
+
reason: "model_unavailable",
|
|
14061
|
+
status: "switched",
|
|
14062
|
+
detail,
|
|
14063
|
+
exhaustedMethod: method,
|
|
14064
|
+
exhaustedScope: scope,
|
|
14065
|
+
candidateMethod: method,
|
|
14066
|
+
candidateScope: scope,
|
|
14067
|
+
...account ? { exhaustedAccount: account, candidateAccount: account } : {},
|
|
14068
|
+
fromModel: model,
|
|
14069
|
+
toModel: predecessor
|
|
14070
|
+
}
|
|
14071
|
+
});
|
|
14072
|
+
}
|
|
14073
|
+
forgetExhaustedCredentials("claude", modelRejected);
|
|
14074
|
+
failedCredentials = [];
|
|
14075
|
+
modelRejected = [];
|
|
14076
|
+
attempt++;
|
|
14077
|
+
continue;
|
|
14078
|
+
}
|
|
14079
|
+
const requested = normalizeClaudeModel(request.model) ?? DEFAULT_CLAUDE_MODEL;
|
|
14080
|
+
await this.emitTerminalErrorResult(detail, [describeModelUnavailable("claude", [.../* @__PURE__ */ new Set([requested, model])], attemptedCredential)]);
|
|
14045
14081
|
return;
|
|
14046
14082
|
}
|
|
14047
14083
|
failedLogin = { credential: attemptedCredential ?? namedLogin, revoked: loginRevoked };
|
|
@@ -14184,10 +14220,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14184
14220
|
const authMethod = resolveClaudeAuthMethodForMessage();
|
|
14185
14221
|
const isClaudeModel = !!requestedModel && /^claude-/i.test(requestedModel);
|
|
14186
14222
|
const resolvedModel = authMethod === "ollama" ? getFallbackModel("claude") ?? (requestedModel && !isClaudeModel ? requestedModel : DEFAULT_OLLAMA_MODEL) : (authMethod === "oauth" || authMethod === "api_key") && requestedModel && !isClaudeModel ? DEFAULT_CLAUDE_MODEL : requestedModel || DEFAULT_CLAUDE_MODEL;
|
|
14187
|
-
const claudeCodeModel = toClaudeCodeModel(
|
|
14188
|
-
resolvedModel,
|
|
14189
|
-
ENGINE_ENV.REPLICAS_CLAUDE_AUTH_METHOD === "bedrock" || ENGINE_ENV.CLAUDE_CODE_USE_BEDROCK === "1"
|
|
14190
|
-
);
|
|
14191
14223
|
const resolvedPermissionMode = planMode ? "plan" : "bypassPermissions";
|
|
14192
14224
|
const resolvedFastMode = Boolean(fastMode && canUseClaudeFastMode(resolvedModel));
|
|
14193
14225
|
this.onChatCredential("workspace");
|
|
@@ -14205,7 +14237,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14205
14237
|
signature,
|
|
14206
14238
|
combinedInstructions,
|
|
14207
14239
|
resolvedModel,
|
|
14208
|
-
claudeCodeModel,
|
|
14209
14240
|
resolvedPermissionMode,
|
|
14210
14241
|
enableInteractiveTools: signature.enableInteractiveTools,
|
|
14211
14242
|
thinkingLevel
|
|
@@ -14294,16 +14325,15 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14294
14325
|
signature,
|
|
14295
14326
|
combinedInstructions,
|
|
14296
14327
|
resolvedModel,
|
|
14297
|
-
claudeCodeModel,
|
|
14298
14328
|
resolvedPermissionMode,
|
|
14299
14329
|
enableInteractiveTools,
|
|
14300
14330
|
thinkingLevel
|
|
14301
14331
|
} = args;
|
|
14302
14332
|
if (this.activeQuery && this.activeSessionSignature && (this.sessionSignaturesMatch(this.activeSessionSignature, signature) || this.backgroundTasks.active.size > 0 && this.activeSessionSignature.credential === signature.credential)) {
|
|
14303
|
-
if (this.activeSessionModel !==
|
|
14333
|
+
if (this.activeSessionModel !== resolvedModel) {
|
|
14304
14334
|
try {
|
|
14305
|
-
await this.activeQuery.setModel(
|
|
14306
|
-
this.activeSessionModel =
|
|
14335
|
+
await this.activeQuery.setModel(resolvedModel);
|
|
14336
|
+
this.activeSessionModel = resolvedModel;
|
|
14307
14337
|
} catch (err) {
|
|
14308
14338
|
console.warn("[ClaudeManager] setModel failed; recreating session:", err);
|
|
14309
14339
|
await this.tearDownSession();
|
|
@@ -14316,7 +14346,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14316
14346
|
await this.startSession({
|
|
14317
14347
|
combinedInstructions,
|
|
14318
14348
|
resolvedModel,
|
|
14319
|
-
claudeCodeModel,
|
|
14320
14349
|
resolvedPermissionMode,
|
|
14321
14350
|
enableInteractiveTools,
|
|
14322
14351
|
thinkingLevel,
|
|
@@ -14350,7 +14379,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14350
14379
|
const {
|
|
14351
14380
|
combinedInstructions,
|
|
14352
14381
|
resolvedModel,
|
|
14353
|
-
claudeCodeModel,
|
|
14354
14382
|
resolvedPermissionMode,
|
|
14355
14383
|
enableInteractiveTools,
|
|
14356
14384
|
thinkingLevel,
|
|
@@ -14404,7 +14432,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14404
14432
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: resolvedModel
|
|
14405
14433
|
} : {}
|
|
14406
14434
|
},
|
|
14407
|
-
model:
|
|
14435
|
+
model: resolvedModel,
|
|
14408
14436
|
...this.chatTitle ? { title: this.chatTitle() } : {},
|
|
14409
14437
|
settings: {
|
|
14410
14438
|
fastMode: signature.fastMode,
|
|
@@ -14459,7 +14487,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14459
14487
|
this.activeQuery = response;
|
|
14460
14488
|
this.activePromptStream = promptStream;
|
|
14461
14489
|
this.activeSessionSignature = signature;
|
|
14462
|
-
this.activeSessionModel =
|
|
14490
|
+
this.activeSessionModel = resolvedModel;
|
|
14463
14491
|
this.sessionLinearForwarder = new LinearEventForwarder(() => this.linearSessionId);
|
|
14464
14492
|
this.sessionLoop = this.runSessionLoop(response).catch((err) => {
|
|
14465
14493
|
console.error("[ClaudeManager] Session loop crashed:", err);
|
|
@@ -63048,6 +63076,7 @@ ${note}`;
|
|
|
63048
63076
|
hasActiveTurn: false,
|
|
63049
63077
|
observedBranchesByRepo: /* @__PURE__ */ new Map(),
|
|
63050
63078
|
lastTurnErrors: null,
|
|
63079
|
+
turnNotices: [],
|
|
63051
63080
|
turnRequest: null,
|
|
63052
63081
|
turnAnswer: null,
|
|
63053
63082
|
turnCompletion: null,
|
|
@@ -63230,6 +63259,11 @@ ${note}`;
|
|
|
63230
63259
|
if (terminalErrors !== void 0) {
|
|
63231
63260
|
chat.lastTurnErrors = terminalErrors;
|
|
63232
63261
|
}
|
|
63262
|
+
const fallback = event.type === AUTH_FALLBACK_EVENT_TYPE ? coerceAuthFallbackPayload(event.payload) : null;
|
|
63263
|
+
if (fallback?.toModel) {
|
|
63264
|
+
const { headline, outcomeClause } = describeAuthFallback(fallback);
|
|
63265
|
+
chat.turnNotices.push(`${headline}, so this turn ${outcomeClause}.`);
|
|
63266
|
+
}
|
|
63233
63267
|
if (event.type === AGENT_QUOTA_EXHAUSTED_EVENT_TYPE) {
|
|
63234
63268
|
chat.quotaExhaustion = agentQuotaExhaustedPayloadSchema.safeParse(event.payload).data ?? null;
|
|
63235
63269
|
}
|
|
@@ -63538,6 +63572,8 @@ ${note}`;
|
|
|
63538
63572
|
const linearSessionId = ENGINE_ENV.REPLICAS_LINEAR_SESSION_ID;
|
|
63539
63573
|
const errors = chat.persisted.parentChatId === null ? chat.lastTurnErrors : null;
|
|
63540
63574
|
chat.lastTurnErrors = null;
|
|
63575
|
+
const notices = errors?.length ? [] : chat.turnNotices;
|
|
63576
|
+
chat.turnNotices = [];
|
|
63541
63577
|
const errorNotificationTargets = chat.activeErrorNotificationTargets;
|
|
63542
63578
|
chat.activeErrorNotificationTargets = [];
|
|
63543
63579
|
const observedBranches = chat.observedBranchesByRepo;
|
|
@@ -63563,8 +63599,9 @@ ${note}`;
|
|
|
63563
63599
|
repoStatuses,
|
|
63564
63600
|
...unlinkedPullRequestUrls.length > 0 ? { unlinkedPullRequestUrls } : {},
|
|
63565
63601
|
...errors?.length ? { errors } : {},
|
|
63602
|
+
...notices.length ? { notices } : {},
|
|
63566
63603
|
...turnLost ? { turnLost } : {},
|
|
63567
|
-
...(errors?.length || quotaExhaustion) && errorNotificationTargets.length > 0 ? { errorNotificationTargets } : {},
|
|
63604
|
+
...(errors?.length || notices.length || quotaExhaustion) && errorNotificationTargets.length > 0 ? { errorNotificationTargets } : {},
|
|
63568
63605
|
...quotaExhaustion ? { quotaExhaustion } : {},
|
|
63569
63606
|
...isPullRequestFeedbackChat(chat.persisted) ? { pullRequestFeedback: true } : {}
|
|
63570
63607
|
};
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
publishedPullRequestUrls
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-W2VY74XF.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
10
|
import {
|
|
11
11
|
shouldRefreshPullRequests
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CEBOAXL7.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/services/post-tool-pr-notifier.ts
|
package/dist/src/subagent-mcp.js
CHANGED