pause autonomy during active user chats and expose waiting/retry telemetry

This commit is contained in:
DBT
2026-02-24 01:51:55 +00:00
parent 1328c1feec
commit af9ccbaae3
4 changed files with 51 additions and 9 deletions

View File

@@ -123,6 +123,7 @@ func (e *Engine) tick() {
for _, st := range e.state {
if st.Status == "running" {
st.Status = "waiting"
e.writeReflectLog("waiting", st, "paused due to active user conversation")
}
}
e.persistStateLocked()
@@ -204,6 +205,10 @@ func (e *Engine) tick() {
if st.Status == "completed" {
continue
}
if st.Status == "waiting" {
st.Status = "idle"
e.writeReflectLog("resume", st, "user conversation idle, autonomy resumed")
}
if st.Status == "blocked" {
if !st.RetryAfter.IsZero() && now.Before(st.RetryAfter) {
continue
@@ -437,6 +442,8 @@ func (e *Engine) persistStateLocked() {
switch st.Status {
case "running":
status = "doing"
case "waiting":
status = "waiting"
case "blocked":
status = "blocked"
case "completed":

View File

@@ -14,7 +14,7 @@ type TaskItem struct {
Content string `json:"content"`
Priority string `json:"priority"`
DueAt string `json:"due_at,omitempty"`
Status string `json:"status"` // todo|doing|blocked|done
Status string `json:"status"` // todo|doing|waiting|blocked|done
RetryAfter string `json:"retry_after,omitempty"`
Source string `json:"source"`
DedupeHits int `json:"dedupe_hits,omitempty"`