opencara 0.25.0 → 0.25.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/index.js +19 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -499,6 +499,7 @@ function ensureConfigDir() {
|
|
|
499
499
|
fs.mkdirSync(dir, { recursive: true });
|
|
500
500
|
}
|
|
501
501
|
var DEFAULT_MAX_DIFF_SIZE_KB = 100;
|
|
502
|
+
var DEFAULT_MAX_SUMMARY_INPUT_KB = 500;
|
|
502
503
|
var DEFAULT_MAX_CONSECUTIVE_ERRORS = 10;
|
|
503
504
|
var DEFAULT_MAX_REPO_SIZE_MB = 100;
|
|
504
505
|
var DEFAULT_COMMAND_TEST_TIMEOUT_MS = 1e4;
|
|
@@ -705,6 +706,12 @@ function validateConfigData(data, envPlatformUrl) {
|
|
|
705
706
|
);
|
|
706
707
|
overrides.maxDiffSizeKb = DEFAULT_MAX_DIFF_SIZE_KB;
|
|
707
708
|
}
|
|
709
|
+
if (typeof data.max_summary_input_kb === "number" && data.max_summary_input_kb <= 0) {
|
|
710
|
+
console.warn(
|
|
711
|
+
`\u26A0 Config warning: max_summary_input_kb must be > 0, got ${data.max_summary_input_kb}, using default (${DEFAULT_MAX_SUMMARY_INPUT_KB})`
|
|
712
|
+
);
|
|
713
|
+
overrides.maxSummaryInputKb = DEFAULT_MAX_SUMMARY_INPUT_KB;
|
|
714
|
+
}
|
|
708
715
|
if (typeof data.max_consecutive_errors === "number" && data.max_consecutive_errors <= 0) {
|
|
709
716
|
console.warn(
|
|
710
717
|
`\u26A0 Config warning: max_consecutive_errors must be > 0, got ${data.max_consecutive_errors}, using default (${DEFAULT_MAX_CONSECUTIVE_ERRORS})`
|
|
@@ -745,6 +752,7 @@ function loadConfig() {
|
|
|
745
752
|
platformUrl: envPlatformUrl || DEFAULT_PLATFORM_URL,
|
|
746
753
|
authFile: null,
|
|
747
754
|
maxDiffSizeKb: DEFAULT_MAX_DIFF_SIZE_KB,
|
|
755
|
+
maxSummaryInputKb: DEFAULT_MAX_SUMMARY_INPUT_KB,
|
|
748
756
|
maxConsecutiveErrors: DEFAULT_MAX_CONSECUTIVE_ERRORS,
|
|
749
757
|
maxRepoSizeMb: DEFAULT_MAX_REPO_SIZE_MB,
|
|
750
758
|
codebaseDir: null,
|
|
@@ -804,6 +812,7 @@ function loadConfig() {
|
|
|
804
812
|
platformUrl: envPlatformUrl || (typeof data.platform_url === "string" ? data.platform_url : DEFAULT_PLATFORM_URL),
|
|
805
813
|
authFile: typeof data.auth_file === "string" && data.auth_file.trim() ? resolveFilePath(data.auth_file) : null,
|
|
806
814
|
maxDiffSizeKb: overrides.maxDiffSizeKb ?? (typeof data.max_diff_size_kb === "number" ? data.max_diff_size_kb : DEFAULT_MAX_DIFF_SIZE_KB),
|
|
815
|
+
maxSummaryInputKb: overrides.maxSummaryInputKb ?? (typeof data.max_summary_input_kb === "number" ? data.max_summary_input_kb : DEFAULT_MAX_SUMMARY_INPUT_KB),
|
|
807
816
|
maxConsecutiveErrors: overrides.maxConsecutiveErrors ?? (typeof data.max_consecutive_errors === "number" ? data.max_consecutive_errors : DEFAULT_MAX_CONSECUTIVE_ERRORS),
|
|
808
817
|
maxRepoSizeMb: overrides.maxRepoSizeMb ?? (typeof data.max_repo_size_mb === "number" ? data.max_repo_size_mb : DEFAULT_MAX_REPO_SIZE_MB),
|
|
809
818
|
codebaseDir: typeof data.codebase_dir === "string" ? data.codebase_dir : null,
|
|
@@ -2613,7 +2622,7 @@ function sleep(ms, signal) {
|
|
|
2613
2622
|
|
|
2614
2623
|
// src/summary.ts
|
|
2615
2624
|
var TIMEOUT_SAFETY_MARGIN_MS2 = 3e4;
|
|
2616
|
-
var MAX_INPUT_SIZE_BYTES =
|
|
2625
|
+
var MAX_INPUT_SIZE_BYTES = 500 * 1024;
|
|
2617
2626
|
var InputTooLargeError = class extends Error {
|
|
2618
2627
|
constructor(message) {
|
|
2619
2628
|
super(message);
|
|
@@ -2663,9 +2672,10 @@ function calculateInputSize(prompt2, reviews, diffContent, contextBlock) {
|
|
|
2663
2672
|
}
|
|
2664
2673
|
async function executeSummary(req, deps, runTool = executeTool) {
|
|
2665
2674
|
const inputSize = calculateInputSize(req.prompt, req.reviews, req.diffContent, req.contextBlock);
|
|
2666
|
-
|
|
2675
|
+
const maxInputBytes = deps.maxSummaryInputKb !== void 0 ? deps.maxSummaryInputKb * 1024 : MAX_INPUT_SIZE_BYTES;
|
|
2676
|
+
if (inputSize > maxInputBytes) {
|
|
2667
2677
|
throw new InputTooLargeError(
|
|
2668
|
-
`Summary input too large (${Math.round(inputSize / 1024)}KB > ${Math.round(
|
|
2678
|
+
`Summary input too large (${Math.round(inputSize / 1024)}KB > ${Math.round(maxInputBytes / 1024)}KB limit)`
|
|
2669
2679
|
);
|
|
2670
2680
|
}
|
|
2671
2681
|
const timeoutMs = req.timeout * 1e3;
|
|
@@ -5793,7 +5803,7 @@ function sleep2(ms, signal) {
|
|
|
5793
5803
|
async function startAgent(agentId, platformUrl, agentInfo, reviewDeps, consumptionDeps, options) {
|
|
5794
5804
|
const client = new ApiClient(platformUrl, {
|
|
5795
5805
|
authToken: options?.authToken,
|
|
5796
|
-
cliVersion: "0.25.
|
|
5806
|
+
cliVersion: "0.25.1",
|
|
5797
5807
|
versionOverride: options?.versionOverride,
|
|
5798
5808
|
onTokenRefresh: options?.onTokenRefresh
|
|
5799
5809
|
});
|
|
@@ -6158,7 +6168,7 @@ async function startBatchAgents(config, agents, pollIntervalMs, oauthToken, opti
|
|
|
6158
6168
|
const { versionOverride, verbose, instancesOverride, agentOwner, userOrgs } = options;
|
|
6159
6169
|
const client = new ApiClient(config.platformUrl, {
|
|
6160
6170
|
authToken: oauthToken,
|
|
6161
|
-
cliVersion: "0.25.
|
|
6171
|
+
cliVersion: "0.25.1",
|
|
6162
6172
|
versionOverride,
|
|
6163
6173
|
onTokenRefresh: () => getValidToken(config.platformUrl, { configPath: config.authFile })
|
|
6164
6174
|
});
|
|
@@ -6364,6 +6374,7 @@ async function startAgentRouter() {
|
|
|
6364
6374
|
const reviewDeps = {
|
|
6365
6375
|
commandTemplate: commandTemplate ?? "",
|
|
6366
6376
|
maxDiffSizeKb: config.maxDiffSizeKb,
|
|
6377
|
+
maxSummaryInputKb: config.maxSummaryInputKb,
|
|
6367
6378
|
maxRepoSizeMb: config.maxRepoSizeMb,
|
|
6368
6379
|
codebaseDir,
|
|
6369
6380
|
livenessTimeoutMs: agentConfig?.livenessTimeout != null ? agentConfig.livenessTimeout * 1e3 : void 0
|
|
@@ -6430,6 +6441,7 @@ function startAgentByIndex(config, agentIndex, pollIntervalMs, oauthToken, versi
|
|
|
6430
6441
|
const reviewDeps = {
|
|
6431
6442
|
commandTemplate,
|
|
6432
6443
|
maxDiffSizeKb: config.maxDiffSizeKb,
|
|
6444
|
+
maxSummaryInputKb: config.maxSummaryInputKb,
|
|
6433
6445
|
maxRepoSizeMb: config.maxRepoSizeMb,
|
|
6434
6446
|
codebaseDir,
|
|
6435
6447
|
livenessTimeoutMs: agentConfig?.livenessTimeout != null ? agentConfig.livenessTimeout * 1e3 : void 0
|
|
@@ -6507,7 +6519,7 @@ agentCommand.command("start").description("Start agents in polling mode").option
|
|
|
6507
6519
|
}
|
|
6508
6520
|
config = loadConfig();
|
|
6509
6521
|
}
|
|
6510
|
-
console.log(formatVersionBanner("0.25.
|
|
6522
|
+
console.log(formatVersionBanner("0.25.1", "085f9a8"));
|
|
6511
6523
|
if (config.agents && config.agents.length > 0) {
|
|
6512
6524
|
const toolEntries = config.agents.map((a) => ({
|
|
6513
6525
|
tool: a.tool,
|
|
@@ -7329,7 +7341,7 @@ var statusCommand = new Command4("status").description("Show agent config, conne
|
|
|
7329
7341
|
});
|
|
7330
7342
|
|
|
7331
7343
|
// src/index.ts
|
|
7332
|
-
var program = new Command5().name("opencara").description("OpenCara \u2014 distributed AI code review agent").version(`${"0.25.
|
|
7344
|
+
var program = new Command5().name("opencara").description("OpenCara \u2014 distributed AI code review agent").version(`${"0.25.1"} (${"085f9a8"})`);
|
|
7333
7345
|
program.addCommand(agentCommand);
|
|
7334
7346
|
program.addCommand(authCommand());
|
|
7335
7347
|
program.addCommand(dedupCommand());
|