@caseyharalson/orrery 0.8.0 → 0.9.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.
|
@@ -410,6 +410,7 @@ async function invokeAgentWithTimeout(
|
|
|
410
410
|
* @param {string[]} stepIds - Step IDs to execute
|
|
411
411
|
* @param {string} repoRoot - Repository root path
|
|
412
412
|
* @param {Object} options - Options including callbacks
|
|
413
|
+
* @param {number} [options.timeoutMs] - Timeout in milliseconds (overrides config.failover.timeoutMs)
|
|
413
414
|
* @returns {Object} - Handle with completion promise
|
|
414
415
|
*/
|
|
415
416
|
function invokeAgentWithFailover(
|
|
@@ -420,6 +421,10 @@ function invokeAgentWithFailover(
|
|
|
420
421
|
options = {}
|
|
421
422
|
) {
|
|
422
423
|
const failoverConfig = config.failover || { enabled: false };
|
|
424
|
+
const timeoutMs =
|
|
425
|
+
options.timeoutMs !== undefined
|
|
426
|
+
? options.timeoutMs
|
|
427
|
+
: failoverConfig.timeoutMs;
|
|
423
428
|
|
|
424
429
|
// If failover is disabled, use default agent directly
|
|
425
430
|
if (!failoverConfig.enabled) {
|
|
@@ -487,7 +492,7 @@ function invokeAgentWithFailover(
|
|
|
487
492
|
planFile,
|
|
488
493
|
stepIds,
|
|
489
494
|
repoRoot,
|
|
490
|
-
|
|
495
|
+
timeoutMs,
|
|
491
496
|
options
|
|
492
497
|
);
|
|
493
498
|
|
|
@@ -93,8 +93,11 @@ Step to review: {stepIds}
|
|
|
93
93
|
## Workflow
|
|
94
94
|
|
|
95
95
|
1. Read the plan file to understand the step's description, requirements, and acceptance criteria
|
|
96
|
-
2.
|
|
97
|
-
|
|
96
|
+
2. Discover all changes:
|
|
97
|
+
- Run \`git status --porcelain\` to list all modified, staged, and untracked files
|
|
98
|
+
- Run \`git diff\` for unstaged changes to tracked files
|
|
99
|
+
- Run \`git diff --cached\` for staged changes
|
|
100
|
+
3. Read modified/created files for full context
|
|
98
101
|
4. Evaluate if changes correctly implement the requirements
|
|
99
102
|
|
|
100
103
|
## Output Format (JSON)
|
|
@@ -142,6 +145,7 @@ module.exports = {
|
|
|
142
145
|
enabled: true,
|
|
143
146
|
|
|
144
147
|
// Timeout in milliseconds before trying next agent (15 minutes)
|
|
148
|
+
// Can be overridden via ORRERY_AGENT_TIMEOUT environment variable
|
|
145
149
|
timeoutMs: 900000,
|
|
146
150
|
|
|
147
151
|
// Patterns to detect failover-triggering errors from stderr
|
|
@@ -165,6 +165,19 @@ function resolveReviewMaxIterations(cliValue) {
|
|
|
165
165
|
return config.review.maxIterations;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
function resolveAgentTimeout(cliValue) {
|
|
169
|
+
if (typeof cliValue === "number" && cliValue > 0) {
|
|
170
|
+
return cliValue;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const envValue = parseEnvInteger(process.env.ORRERY_AGENT_TIMEOUT);
|
|
174
|
+
if (envValue !== undefined) {
|
|
175
|
+
return envValue;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return config.failover.timeoutMs;
|
|
179
|
+
}
|
|
180
|
+
|
|
168
181
|
function resolvePlanFile(planArg, plansDir) {
|
|
169
182
|
if (!planArg) return null;
|
|
170
183
|
|
|
@@ -760,6 +773,7 @@ async function startSteps(planFile, stepIds, activeAgents, tracker) {
|
|
|
760
773
|
stepIds,
|
|
761
774
|
REPO_ROOT,
|
|
762
775
|
{
|
|
776
|
+
timeoutMs: resolveAgentTimeout(),
|
|
763
777
|
onStdout: (text, ids) => {
|
|
764
778
|
if (config.logging.streamOutput) {
|
|
765
779
|
const prefix = `[${ids.join(",")}]`;
|
|
@@ -855,6 +869,7 @@ async function waitForAgentCompletion(
|
|
|
855
869
|
if (maxIterations > 0) {
|
|
856
870
|
let approved = false;
|
|
857
871
|
let currentResult = stepResult;
|
|
872
|
+
const originalCommitMessage = stepResult.commitMessage;
|
|
858
873
|
const reviews = [];
|
|
859
874
|
stepReviews = reviews;
|
|
860
875
|
|
|
@@ -867,7 +882,7 @@ async function waitForAgentCompletion(
|
|
|
867
882
|
tempPlanFile,
|
|
868
883
|
[stepId],
|
|
869
884
|
REPO_ROOT,
|
|
870
|
-
{ stepId }
|
|
885
|
+
{ stepId, timeoutMs: resolveAgentTimeout() }
|
|
871
886
|
);
|
|
872
887
|
|
|
873
888
|
if (reviewResult.error) {
|
|
@@ -924,7 +939,8 @@ async function waitForAgentCompletion(
|
|
|
924
939
|
REPO_ROOT,
|
|
925
940
|
{
|
|
926
941
|
stepId,
|
|
927
|
-
stepIds: [stepId]
|
|
942
|
+
stepIds: [stepId],
|
|
943
|
+
timeoutMs: resolveAgentTimeout()
|
|
928
944
|
}
|
|
929
945
|
);
|
|
930
946
|
|
|
@@ -932,6 +948,10 @@ async function waitForAgentCompletion(
|
|
|
932
948
|
editResults.find((r) => r.stepId === stepId) ||
|
|
933
949
|
createDefaultResult(stepId, null, "Edit agent returned no report");
|
|
934
950
|
currentResult = editedResult;
|
|
951
|
+
// Preserve original commit message from execute agent
|
|
952
|
+
if (originalCommitMessage) {
|
|
953
|
+
currentResult.commitMessage = originalCommitMessage;
|
|
954
|
+
}
|
|
935
955
|
|
|
936
956
|
if (currentResult.status !== "complete") {
|
|
937
957
|
console.log(
|
|
@@ -18,6 +18,7 @@ class ProgressTracker {
|
|
|
18
18
|
this.startTime = Date.now();
|
|
19
19
|
this.stepCompletionTimes = []; // Duration of each completed step
|
|
20
20
|
this.stepStartTimes = new Map(); // stepId -> startTime
|
|
21
|
+
this.isFirstStep = true;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -148,6 +149,12 @@ class ProgressTracker {
|
|
|
148
149
|
* @param {string[]} stepIds - Array of step IDs starting
|
|
149
150
|
*/
|
|
150
151
|
logStepStart(stepIds) {
|
|
152
|
+
if (this.isFirstStep) {
|
|
153
|
+
this.isFirstStep = false;
|
|
154
|
+
} else {
|
|
155
|
+
console.log("");
|
|
156
|
+
console.log("----------------------------------------");
|
|
157
|
+
}
|
|
151
158
|
this.recordStart(stepIds);
|
|
152
159
|
const processed = this.completedCount + this.blockedCount;
|
|
153
160
|
const stepList = stepIds.join(", ");
|