mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-13 07:46:54 +08:00
fix(agent): keep suspended-task snapshots on the legacy stack
suspendActiveContexts clears all active contexts after parking a task on the snapshot stack, so the active-context guard alone let the agentic loop hijack resume requests and strand suspended tasks. Check the snapshot stack in shouldUseAgenticTurn.
This commit is contained in:
@@ -46,6 +46,11 @@ func (a *Agent) shouldUseAgenticTurn(userID int64) bool {
|
||||
if _, ok := a.getPendingProposalSession(userID); ok {
|
||||
return false
|
||||
}
|
||||
// Suspended tasks are parked on the snapshot stack with all active
|
||||
// contexts cleared; only the legacy router knows how to resume them.
|
||||
if len(a.SnapshotManager(userID).Stack()) > 0 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user