mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-15 06:17:28 +08:00
pause autonomy during active user chats and expose waiting/retry telemetry
This commit is contained in:
@@ -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":
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user