patchrelay 0.83.2 → 0.83.3
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/build-info.json +3 -3
- package/dist/service.js +22 -4
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
package/dist/service.js
CHANGED
|
@@ -20,6 +20,15 @@ import { parseStringArray, TrackedIssueListQuery } from "./tracked-issue-list-qu
|
|
|
20
20
|
import { AgentInputService } from "./agent-input-service.js";
|
|
21
21
|
import { CodexFollowupIntentClassifier } from "./followup-intent.js";
|
|
22
22
|
import { FanoutPatchRelayTelemetry, LoggerTelemetrySink, OperatorFeedTelemetrySink } from "./telemetry.js";
|
|
23
|
+
function readPositiveIntegerEnv(name) {
|
|
24
|
+
const raw = process.env[name]?.trim();
|
|
25
|
+
if (!raw)
|
|
26
|
+
return undefined;
|
|
27
|
+
const value = Number(raw);
|
|
28
|
+
if (!Number.isFinite(value) || value < 1)
|
|
29
|
+
return undefined;
|
|
30
|
+
return Math.floor(value);
|
|
31
|
+
}
|
|
23
32
|
export class PatchRelayService {
|
|
24
33
|
config;
|
|
25
34
|
db;
|
|
@@ -70,6 +79,18 @@ export class PatchRelayService {
|
|
|
70
79
|
leaseRelease = (projectId, issueId) => this.orchestrator.leaseService.release(projectId, issueId);
|
|
71
80
|
this.webhookHandler = new WebhookHandler(config, db, this.linearProvider, codex, dispatcher, logger, this.feed, undefined, agentInput, telemetry);
|
|
72
81
|
this.githubWebhookHandler = new GitHubWebhookHandler(config, db, this.linearProvider, dispatcher, logger, codex, this.feed);
|
|
82
|
+
const runtimeOptions = {
|
|
83
|
+
assertStorageReady: () => db.assertSchemaReady(),
|
|
84
|
+
describeStorage: () => db.describeSchema(),
|
|
85
|
+
};
|
|
86
|
+
const maxActiveIssueRuns = readPositiveIntegerEnv("PATCHRELAY_MAX_ACTIVE_ISSUE_RUNS");
|
|
87
|
+
if (maxActiveIssueRuns !== undefined) {
|
|
88
|
+
runtimeOptions.maxActiveIssueRuns = maxActiveIssueRuns;
|
|
89
|
+
}
|
|
90
|
+
const issueRunCapacityRetryDelayMs = readPositiveIntegerEnv("PATCHRELAY_ISSUE_RUN_CAPACITY_RETRY_DELAY_MS");
|
|
91
|
+
if (issueRunCapacityRetryDelayMs !== undefined) {
|
|
92
|
+
runtimeOptions.issueRunCapacityRetryDelayMs = issueRunCapacityRetryDelayMs;
|
|
93
|
+
}
|
|
73
94
|
const runtime = new ServiceRuntime(codex, logger, this.orchestrator, {
|
|
74
95
|
listIssuesReadyForExecution: () => db.listIssuesReadyForExecution(),
|
|
75
96
|
countActiveIssueRuns: () => db.runs.listActiveRuns().length,
|
|
@@ -77,10 +98,7 @@ export class PatchRelayService {
|
|
|
77
98
|
processIssue: async (item) => {
|
|
78
99
|
await this.orchestrator.run(item);
|
|
79
100
|
},
|
|
80
|
-
},
|
|
81
|
-
assertStorageReady: () => db.assertSchemaReady(),
|
|
82
|
-
describeStorage: () => db.describeSchema(),
|
|
83
|
-
});
|
|
101
|
+
}, runtimeOptions);
|
|
84
102
|
enqueueIssue = (projectId, issueId) => runtime.enqueueIssue(projectId, issueId);
|
|
85
103
|
this.oauthService = new LinearOAuthService(config, { linearInstallations: db.linearInstallations }, logger);
|
|
86
104
|
this.queryService = new IssueQueryService(db, codex, this.orchestrator);
|