agentxchain 2.155.19 → 2.155.20
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/package.json +1 -1
- package/src/commands/step.js +29 -0
package/package.json
CHANGED
package/src/commands/step.js
CHANGED
|
@@ -100,6 +100,35 @@ export async function stepCommand(opts) {
|
|
|
100
100
|
process.exit(1);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
if (opts.resume && !opts.turn) {
|
|
104
|
+
const activeTurnsBeforeStaleCheck = getActiveTurns(state);
|
|
105
|
+
const activeTurnListBeforeStaleCheck = Object.values(activeTurnsBeforeStaleCheck);
|
|
106
|
+
const retainedTurn = activeTurnListBeforeStaleCheck.length === 1 ? activeTurnListBeforeStaleCheck[0] : null;
|
|
107
|
+
const materializationResolution = resolveGovernedRole({ state, config });
|
|
108
|
+
if (
|
|
109
|
+
retainedTurn
|
|
110
|
+
&& state.status === 'active'
|
|
111
|
+
&& state.charter_materialization_pending
|
|
112
|
+
&& state.phase === 'planning'
|
|
113
|
+
&& materializationResolution.roleId
|
|
114
|
+
&& materializationResolution.roleId !== retainedTurn.assigned_role
|
|
115
|
+
) {
|
|
116
|
+
const reason = `charter materialization pending superseded stale active ${retainedTurn.assigned_role} turn`;
|
|
117
|
+
const reissued = reissueTurn(root, config, {
|
|
118
|
+
turnId: retainedTurn.turn_id,
|
|
119
|
+
roleId: materializationResolution.roleId,
|
|
120
|
+
reason,
|
|
121
|
+
});
|
|
122
|
+
if (!reissued.ok) {
|
|
123
|
+
console.log(chalk.red(`Failed to reissue active turn for materialization: ${reissued.error}`));
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}
|
|
126
|
+
state = reissued.state;
|
|
127
|
+
console.log(chalk.yellow(`Reissued active turn for charter materialization: ${reissued.newTurn.turn_id}`));
|
|
128
|
+
console.log(` Role: ${reissued.newTurn.assigned_role}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
103
132
|
const staleReconciliation = reconcileStaleTurns(root, state, config);
|
|
104
133
|
state = staleReconciliation.state || state;
|
|
105
134
|
if (staleReconciliation.ghost_turns.length > 0) {
|