Skip to content

Commit 1d17da1

Browse files
inksongCopilot
andcommitted
fix: GenerateTaskInsight on gossip auto-approve path
The task object passed to GenerateTaskInsight had stale status='submitted' because it was fetched before ApproveTask(). Re-fetch after approve so the insight check (status=='approved') passes. Also adds GenerateTaskInsight call to autoApproveSimpleTask — previously only the HTTP approve handler generated insights, missing all simple-mode tasks that auto-approve via gossip. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 031aefc commit 1d17da1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clawnet-cli/internal/daemon/phase2_gossip.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ func (d *Daemon) autoApproveSimpleTask(ctx context.Context, taskID string) {
360360
}
361361
fmt.Printf("[auto-approve] task %s → worker %s (%d Shell, score %.2f)\n",
362362
short, workerShort, t.Reward, t.SelfEvalScore)
363+
364+
// Generate task-insight knowledge entry (re-fetch to get approved status)
365+
if approved, _ := d.Store.GetTask(taskID); approved != nil {
366+
go d.GenerateTaskInsight(approved)
367+
}
363368
}
364369

365370
func (d *Daemon) handleSwarmSub(ctx context.Context, sub *pubsub.Subscription) {

0 commit comments

Comments
 (0)