workflow-ai 1.0.28 → 1.0.30
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/configs/ticket-movement-rules.yaml +1 -4
- package/package.json +1 -1
- package/src/runner.mjs +12 -2
package/package.json
CHANGED
package/src/runner.mjs
CHANGED
|
@@ -765,9 +765,13 @@ class StageExecutor {
|
|
|
765
765
|
let agentId = stage.agent || this.pipeline.default_agent;
|
|
766
766
|
const attempt = (stage.counter && this.counters[stage.counter]) || 0;
|
|
767
767
|
|
|
768
|
-
|
|
768
|
+
// Фоллбэк: если task_type не задан, вычисляем из префикса ticket_id (PMA-005 → pma)
|
|
769
|
+
const taskType = this.context.task_type
|
|
770
|
+
|| (this.context.ticket_id && this.context.ticket_id.split('-')[0].toLowerCase())
|
|
771
|
+
|| null;
|
|
772
|
+
|
|
773
|
+
if (attempt <= 1 && stage.agent_by_type && taskType) {
|
|
769
774
|
// Первая попытка: выбор по типу задачи
|
|
770
|
-
const taskType = this.context.task_type;
|
|
771
775
|
if (stage.agent_by_type[taskType]) {
|
|
772
776
|
agentId = stage.agent_by_type[taskType];
|
|
773
777
|
if (this.logger) {
|
|
@@ -940,8 +944,14 @@ class StageExecutor {
|
|
|
940
944
|
const err = new Error(`Agent exited with code ${code}`);
|
|
941
945
|
err.code = 'NON_ZERO_EXIT';
|
|
942
946
|
err.exitCode = code;
|
|
947
|
+
err.stderr = stderr;
|
|
943
948
|
if (this.logger) {
|
|
944
949
|
this.logger.error(`Agent exited with code ${code}`, stageId);
|
|
950
|
+
if (stderr.trim()) {
|
|
951
|
+
for (const line of stderr.trim().split('\n')) {
|
|
952
|
+
this.logger.error(` stderr: ${line}`, stageId);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
945
955
|
}
|
|
946
956
|
reject(err);
|
|
947
957
|
return;
|