The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
Block stale trace selection during search
Justin D'Souzafa0e96edc7ce
diff --git a/cli/beacon/internal/endpoint/traceview/traceview.go b/cli/beacon/internal/endpoint/traceview/traceview.goindex f5002063..2c976aa6 100644--- a/cli/beacon/internal/endpoint/traceview/traceview.go+++ b/cli/beacon/internal/endpoint/traceview/traceview.go@@ -219,6 +219,16 @@ func (m Model) Update(message tea.Msg) (tea.Model, tea.Cmd) {if msg.String() == "ctrl+c" || msg.String() == "q" {return m, tea.Quit}+ if m.loading {+ // A list refresh changes the meaning of every selected row, so do+ // not allow stale rows to be opened while it is in flight. Detail+ // loads still allow back/escape so a slow local read cannot trap+ // the user in that view.+ if m.mode == detailMode && (msg.String() == "esc" || msg.String() == "backspace") {+ return m.updateDetail(msg)+ }+ return m, nil+ }if m.mode == detailMode {return m.updateDetail(msg)}diff --git a/cli/beacon/internal/endpoint/traceview/traceview_test.go b/cli/beacon/internal/endpoint/traceview/traceview_test.goindex d065fb79..49837fe3 100644--- a/cli/beacon/internal/endpoint/traceview/traceview_test.go+++ b/cli/beacon/internal/endpoint/traceview/traceview_test.go@@ -127,6 +127,40 @@ func TestModelSearchesAndOpensTrace(t *testing.T) {}}+func TestSearchBlocksOpeningStaleRowsUntilResultsLoad(t *testing.T) {+ store := fixtureStore()+ model := NewModel(store)+ model.width, model.height = 100, 30+ model = runCmd(t, model, model.Init())++ next, _ := model.Update(key("/"))+ model = next.(Model)+ for _, r := range "filtered" {+ next, _ = model.Update(key(string(r)))+ model = next.(Model)+ }+ next, pending := model.Update(key("enter"))+ model = next.(Model)+ if !model.loading || model.mode != listMode {+ t.Fatalf("search state = loading %t mode %v", model.loading, model.mode)+ }++ next, command := model.Update(key("enter"))+ model = next.(Model)+ if command != nil || model.mode != listMode {+ t.Fatalf("enter during search load opened stale trace: command=%v mode=%v", command != nil, model.mode)+ }++ next, _ = model.Update(pending())+ model = next.(Model)+ if model.loading || model.mode != listMode || model.query != "filtered" {+ t.Fatalf("loaded search state = loading %t mode %v query %q", model.loading, model.mode, model.query)+ }+ if got := store.listQueries[len(store.listQueries)-1]; got != "filtered" {+ t.Fatalf("search query = %q", got)+ }+}+func TestDetailFilterReloadsTrace(t *testing.T) {store := fixtureStore()model := NewModel(store)