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.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,13 +86,17 @@ func (m *Manager) settleFacts(ctx context.Context, dirty map[string]bool) error
|
||||
func (m *Manager) settleTaskFacts(ctx context.Context, t api.Task, p api.Project) error {
|
||||
m.factsRun.Lock()
|
||||
defer m.factsRun.Unlock()
|
||||
if t.WorktreePath != "" {
|
||||
gone := func() bool {
|
||||
_, err := os.Stat(t.WorktreePath)
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
return nil
|
||||
}
|
||||
return t.WorktreePath != "" && errors.Is(err, fs.ErrNotExist)
|
||||
}
|
||||
if gone() {
|
||||
return nil
|
||||
}
|
||||
g, err := m.gitFacts(ctx, t, p)
|
||||
if err != nil && gone() {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
slog.Error("compute merge facts", "task", t.Id, "err", err)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user