fix(dashboard): use runBdCmd for bd show routing in getIssueDetailsBatch
getIssueDetailsBatch was using runCmd for bd show, which doesn't set cmd.Dir. This caused bd to use default routing instead of the town's routes.jsonl, leading to dashboard slowness or missing data. Use runBdCmd(f.townBeads, ...) to ensure proper database routing, consistent with other bd commands in fetcher.go. (gt-0v19) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,9 +19,9 @@ import (
|
||||
|
||||
// Command timeout constants
|
||||
const (
|
||||
cmdTimeout = 5 * time.Second // timeout for most commands
|
||||
ghCmdTimeout = 10 * time.Second // longer timeout for GitHub API calls
|
||||
tmuxCmdTimeout = 2 * time.Second // short timeout for tmux queries
|
||||
cmdTimeout = 5 * time.Second // timeout for most commands
|
||||
ghCmdTimeout = 10 * time.Second // longer timeout for GitHub API calls
|
||||
tmuxCmdTimeout = 2 * time.Second // short timeout for tmux queries
|
||||
)
|
||||
|
||||
// runCmd executes a command with a timeout and returns stdout.
|
||||
@@ -81,7 +81,6 @@ func NewLiveConvoyFetcher() (*LiveConvoyFetcher, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
// FetchConvoys fetches all open convoys with their activity data.
|
||||
func (f *LiveConvoyFetcher) FetchConvoys() ([]ConvoyRow, error) {
|
||||
// List all open convoy-type issues
|
||||
@@ -278,7 +277,7 @@ func (f *LiveConvoyFetcher) getIssueDetailsBatch(issueIDs []string) map[string]*
|
||||
args := append([]string{"show"}, issueIDs...)
|
||||
args = append(args, "--json")
|
||||
|
||||
stdout, err := runCmd(cmdTimeout, "bd", args...)
|
||||
stdout, err := runBdCmd(f.townBeads, args...)
|
||||
if err != nil {
|
||||
return result
|
||||
}
|
||||
@@ -736,7 +735,7 @@ func (f *LiveConvoyFetcher) FetchPolecats() ([]PolecatRow, error) {
|
||||
if issue, ok := assignedIssues[assignee]; ok {
|
||||
issueID = issue.ID
|
||||
issueTitle = issue.Title
|
||||
// Keep full title - CSS handles overflow
|
||||
// Keep full title - CSS handles overflow
|
||||
}
|
||||
|
||||
// Calculate work status based on activity age and issue assignment
|
||||
@@ -913,13 +912,13 @@ func (f *LiveConvoyFetcher) FetchMail() ([]MailRow, error) {
|
||||
}
|
||||
|
||||
var messages []struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Status string `json:"status"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
Priority int `json:"priority"`
|
||||
Assignee string `json:"assignee"` // "to" address stored here
|
||||
CreatedBy string `json:"created_by"` // "from" address
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Status string `json:"status"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
Priority int `json:"priority"`
|
||||
Assignee string `json:"assignee"` // "to" address stored here
|
||||
CreatedBy string `json:"created_by"` // "from" address
|
||||
Labels []string `json:"labels"`
|
||||
}
|
||||
if err := json.Unmarshal(stdout.Bytes(), &messages); err != nil {
|
||||
@@ -1013,7 +1012,7 @@ func formatAgentAddress(addr string) string {
|
||||
if addr == "mayor/" || addr == "mayor" {
|
||||
return "Mayor"
|
||||
}
|
||||
|
||||
|
||||
parts := strings.Split(addr, "/")
|
||||
if len(parts) >= 3 && parts[1] == "polecats" {
|
||||
return fmt.Sprintf("%s (%s)", parts[2], parts[0])
|
||||
|
||||
Reference in New Issue
Block a user