Fix ⌘F focus, hung-turn Stop, narrow tabs and other QA findings
This commit is contained in:
@@ -324,6 +324,11 @@ func (m *Manager) Interrupt(ctx context.Context, sessionID string) (api.AgentSes
|
||||
defer cancel()
|
||||
|
||||
err = l.sess.interrupt(ictx)
|
||||
if errors.Is(err, context.DeadlineExceeded) {
|
||||
slog.Warn("agent didn't answer interrupt, ending its process", "session", sess.Id)
|
||||
l.sess.kill()
|
||||
return sess, nil
|
||||
}
|
||||
if err != nil {
|
||||
return api.AgentSession{}, err
|
||||
}
|
||||
@@ -999,6 +1004,7 @@ func (m *Manager) pump(l *live) {
|
||||
delete(m.live, l.id)
|
||||
closing := m.closing
|
||||
quiet := closing || l.stopping
|
||||
interrupted := l.interrupted
|
||||
m.mu.Unlock()
|
||||
|
||||
orphaned := len(l.subagents) > 0 && !closing
|
||||
@@ -1040,14 +1046,18 @@ func (m *Manager) pump(l *live) {
|
||||
}
|
||||
}
|
||||
m.endMergeTurn(l.id, true)
|
||||
end, err := m.store.EndTurn(ctx, l.id, agentActor, map[string]any{"error": "agent process exited mid-turn", "stopped": true}, nil, false, false, false)
|
||||
reason := "agent process exited mid-turn"
|
||||
if interrupted {
|
||||
reason = "interrupted; the agent didn't answer, so byre ended its process"
|
||||
}
|
||||
end, err := m.store.EndTurn(ctx, l.id, agentActor, map[string]any{"error": reason, "stopped": true}, nil, false, false, false)
|
||||
if err != nil {
|
||||
slog.Error("record session exit", "session", l.id, "err", err)
|
||||
}
|
||||
if end.Discard != store.DiscardNone {
|
||||
return
|
||||
}
|
||||
if l.owner == "" {
|
||||
if l.owner == "" && !interrupted {
|
||||
m.recordError(l, "The agent process exited mid-turn. Send a message to resume it.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user