fix(sqlite): add missing agent fields to scanIssues and related queries (#1176)

The scanIssues() function and multiple SQL queries were not selecting or
scanning agent-related fields (hook_bead, role_bead, agent_state, last_activity,
role_type, rig, mol_type) and time-based scheduling fields (due_at, defer_until).

This caused bd list --json to return null for last_activity even when the
database contained valid timestamps, preventing proper agent health monitoring.

Updated files:
- dependencies.go: scanIssues() variable declarations, scan calls, assignments
- queries.go: SearchIssues query
- labels.go: GetIssuesByLabel query
- ready.go: GetReadyWork and GetNewlyUnblockedByClose queries
- transaction.go: GetIssue query, SearchIssues query, scanIssueRow()

Fixes steveyegge/beads#1175
This commit is contained in:
Daniel Sauer
2026-01-19 19:11:03 +01:00
committed by GitHub
parent f4ee7ee73b
commit 4fffdb7fae
5 changed files with 102 additions and 6 deletions

View File

@@ -2021,7 +2021,9 @@ func (s *SQLiteStorage) SearchIssues(ctx context.Context, query string, filter t
created_at, created_by, owner, updated_at, closed_at, external_ref, source_repo, close_reason,
deleted_at, deleted_by, delete_reason, original_type,
sender, ephemeral, pinned, is_template, crystallizes,
await_type, await_id, timeout_ns, waiters
await_type, await_id, timeout_ns, waiters,
hook_bead, role_bead, agent_state, last_activity, role_type, rig, mol_type,
due_at, defer_until
FROM issues
%s
ORDER BY priority ASC, created_at DESC