|
@@ -547,12 +547,12 @@ namespace ClankerSaddle.Services {
|
|
|
throw new Error(Quark.from_string("clanker-saddle"), 45,
|
|
throw new Error(Quark.from_string("clanker-saddle"), 45,
|
|
|
@"task-update cancel returned HTTP $(status_code)");
|
|
@"task-update cancel returned HTTP $(status_code)");
|
|
|
}
|
|
}
|
|
|
- yield tasks.add_comment(session.task_id, "bot", @"$(verb); daemon aborted");
|
|
|
|
|
|
|
+ yield tasks.add_comment(session.task_id, "agent", @"$(verb); daemon aborted");
|
|
|
} catch (Error e) {
|
|
} catch (Error e) {
|
|
|
warning(@"[ClankerSaddle] Abort for task $(session.task_id) failed: $(e.message); marking saddle '$(((!)saddle).name)' offline");
|
|
warning(@"[ClankerSaddle] Abort for task $(session.task_id) failed: $(e.message); marking saddle '$(((!)saddle).name)' offline");
|
|
|
yield mark_saddle_unreachable(((!)saddle).id, tasks,
|
|
yield mark_saddle_unreachable(((!)saddle).id, tasks,
|
|
|
@"abort delivery failed ($(e.message))");
|
|
@"abort delivery failed ($(e.message))");
|
|
|
- yield tasks.add_comment(session.task_id, "bot",
|
|
|
|
|
|
|
+ yield tasks.add_comment(session.task_id, "agent",
|
|
|
@"$(verb); daemon unreachable — saddle marked offline");
|
|
@"$(verb); daemon unreachable — saddle marked offline");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -563,7 +563,7 @@ namespace ClankerSaddle.Services {
|
|
|
* pass they would wait forever for a daemon that will not answer.
|
|
* pass they would wait forever for a daemon that will not answer.
|
|
|
* Only `assigned`/`working` tasks move: parked tasks
|
|
* Only `assigned`/`working` tasks move: parked tasks
|
|
|
* (blocked/review/suspended) keep their sessions, which the
|
|
* (blocked/review/suspended) keep their sessions, which the
|
|
|
- * resume machinery needs. Each move lands a bot comment so the
|
|
|
|
|
|
|
+ * resume machinery needs. Each move lands a agent comment so the
|
|
|
* timeline shows why the task restarted.
|
|
* timeline shows why the task restarted.
|
|
|
*/
|
|
*/
|
|
|
public async void requeue_tasks_on_offline_saddles(TaskService tasks) throws Error {
|
|
public async void requeue_tasks_on_offline_saddles(TaskService tasks) throws Error {
|
|
@@ -586,7 +586,7 @@ namespace ClankerSaddle.Services {
|
|
|
}
|
|
}
|
|
|
print(@"[ClankerSaddle] Task $(task.id) requeued: its saddle went offline\n");
|
|
print(@"[ClankerSaddle] Task $(task.id) requeued: its saddle went offline\n");
|
|
|
yield tasks.requeue_task(task.id);
|
|
yield tasks.requeue_task(task.id);
|
|
|
- yield tasks.add_comment(task.id, "bot",
|
|
|
|
|
|
|
+ yield tasks.add_comment(task.id, "agent",
|
|
|
"saddle went offline; task requeued");
|
|
"saddle went offline; task requeued");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -626,7 +626,7 @@ namespace ClankerSaddle.Services {
|
|
|
* Marks a saddle offline when its control server cannot be
|
|
* Marks a saddle offline when its control server cannot be
|
|
|
* reached, releasing the task it was holding back to 'queued'
|
|
* reached, releasing the task it was holding back to 'queued'
|
|
|
* and closing that task's open session (outcome 'stopped'). The
|
|
* and closing that task's open session (outcome 'stopped'). The
|
|
|
- * requeue lands as a bot comment on the task, so the timeline
|
|
|
|
|
|
|
+ * requeue lands as a agent comment on the task, so the timeline
|
|
|
* shows the interruption; combined with the daemon's
|
|
* shows the interruption; combined with the daemon's
|
|
|
* crash-resume, the next dispatch restores the workspace and
|
|
* crash-resume, the next dispatch restores the workspace and
|
|
|
* reports `resumed` on /status.
|
|
* reports `resumed` on /status.
|
|
@@ -661,7 +661,7 @@ namespace ClankerSaddle.Services {
|
|
|
string unreachable_text = reason != null && reason.length > 0
|
|
string unreachable_text = reason != null && reason.length > 0
|
|
|
? @"Saddle became unreachable ($(reason)); task requeued"
|
|
? @"Saddle became unreachable ($(reason)); task requeued"
|
|
|
: "Saddle became unreachable; task requeued";
|
|
: "Saddle became unreachable; task requeued";
|
|
|
- yield tasks.add_comment(task_id, "bot", unreachable_text);
|
|
|
|
|
|
|
+ yield tasks.add_comment(task_id, "agent", unreachable_text);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1228,7 +1228,7 @@ namespace ClankerSaddle.Services {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Projects the agent's conversation-level events onto the task:
|
|
* Projects the agent's conversation-level events onto the task:
|
|
|
- * `saddle comment` lines become bot comments, `saddle plan`
|
|
|
|
|
|
|
+ * `saddle comment` lines become agent comments, `saddle plan`
|
|
|
* lines update the plan, `saddle progress-update` lines append
|
|
* lines update the plan, `saddle progress-update` lines append
|
|
|
* progress, `saddle review` raises the review banner, the
|
|
* progress, `saddle review` raises the review banner, the
|
|
|
* `saddle done` entry completes the task with the summary the
|
|
* `saddle done` entry completes the task with the summary the
|
|
@@ -1258,9 +1258,9 @@ namespace ClankerSaddle.Services {
|
|
|
body = output;
|
|
body = output;
|
|
|
}
|
|
}
|
|
|
if (body.length > 0) {
|
|
if (body.length > 0) {
|
|
|
- yield tasks.add_comment(task_id, "bot", body);
|
|
|
|
|
|
|
+ yield tasks.add_comment(task_id, "agent", body);
|
|
|
if (goal_id > 0) {
|
|
if (goal_id > 0) {
|
|
|
- yield goal_service.add_comment(goal_id, "bot", body);
|
|
|
|
|
|
|
+ yield goal_service.add_comment(goal_id, "agent", body);
|
|
|
yield goal_service.record_event(goal_id, "comment",
|
|
yield goal_service.record_event(goal_id, "comment",
|
|
|
snippet_text(body));
|
|
snippet_text(body));
|
|
|
}
|
|
}
|
|
@@ -1674,7 +1674,7 @@ namespace ClankerSaddle.Services {
|
|
|
* window, so ONE exceptional `GET /status` decides its fate —
|
|
* window, so ONE exceptional `GET /status` decides its fate —
|
|
|
* an answer means the daemon is alive (the health snapshot is
|
|
* an answer means the daemon is alive (the health snapshot is
|
|
|
* refreshed and the task keeps running; the silence episode
|
|
* refreshed and the task keeps running; the silence episode
|
|
|
- * gets no second probe), a failure requeues the task with a bot
|
|
|
|
|
|
|
+ * gets no second probe), a failure requeues the task with an agent
|
|
|
* comment and marks the saddle offline (the normal unreachable
|
|
* comment and marks the saddle offline (the normal unreachable
|
|
|
* bookkeeping). The probe flag was taken by the caller; the
|
|
* bookkeeping). The probe flag was taken by the caller; the
|
|
|
* next push resets it.
|
|
* next push resets it.
|