From b139725609d99197c698cb8c6462c698cd7a6f0c Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Mon, 16 Nov 2026 21:15:33 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Meetings=20panel=20says=20plainl?= =?UTF-8?q?y=20when=20notes=20and=20questions=20are=20off?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The panel only showed a Spektacular status once the child's lines channel closed (after it gave up restarting), so a meeting whose Spek child was down showed nothing while every forward failed with "stream child is not running". A failed forward now sets a plain "Notes and clarifying questions are paused" status, cleared when Spek writes again; the final status leads with "Notes and clarifying questions are off for this meeting". Part of hivecommons/hive#18590 Signed-off-by: Andy Anderson --- changelog.d/fixed-18590-spek-status-plain.md | 1 + src/docs/meetings.md | 2 +- src/pkg/meetings/live/live_test.go | 29 ++++++++++++++++ src/pkg/meetings/live/session.go | 35 ++++++++++++++++++-- 4 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 changelog.d/fixed-18590-spek-status-plain.md diff --git a/changelog.d/fixed-18590-spek-status-plain.md b/changelog.d/fixed-18590-spek-status-plain.md new file mode 100644 index 0000000000..fedf422456 --- /dev/null +++ b/changelog.d/fixed-18590-spek-status-plain.md @@ -0,0 +1 @@ +- **The Meetings panel says plainly when notes and clarifying questions are off.** When Spektacular live mode is not running for a meeting the panel now leads with "Notes and clarifying questions are off" (or "paused" while hive cannot reach a restarting child, cleared when it writes again) instead of showing nothing until the child gives up. ([#18590](https://github.com/hivecommons/hive/issues/18590)) diff --git a/src/docs/meetings.md b/src/docs/meetings.md index adfca57afe..574689cae7 100644 --- a/src/docs/meetings.md +++ b/src/docs/meetings.md @@ -126,7 +126,7 @@ A refused backend fails config validation and `PUT /api/meetings/model` with its The warm process is replaced after `HIVE_MEETINGS_CLI_RECYCLE_TURNS` turns (default 8, which bounds the history each turn re-reads and pays for), and at once after any error, timeout or crash, so a late reply can never answer the next request and the next call finds a fresh process. Calls from one meeting run one at a time inside the shared in-flight limit. On a CLI backend Betty's timeouts are wider than the API modes' 4 s, 2.5 s and 800 ms: `HIVE_MEETINGS_CLI_ADDRESSED_TIMEOUT_MS`, `HIVE_MEETINGS_CLI_UNPROMPTED_TIMEOUT_MS` and `HIVE_MEETINGS_CLI_RESTYLE_TIMEOUT_MS`, default 8000, 6000 and 3000 on `claude` and 20000, 15000 and 10000 on `copilot` and `omp`, which start the CLI on every call. Spek's per-prompt call uses `HIVE_MEETINGS_CLI_ONESHOT_TIMEOUT_MS` (30000). `HIVE_MEETINGS_CLI_BINARY` overrides the CLI binary. The panel shows the model in use, for example "claude CLI claude-sonnet-5-5" or "vllm model llama-4". -Spektacular must be a version that includes the `meeting` command ([hivecommons/spektacular#126](https://github.com/hivecommons/spektacular/pull/126)). With an older binary the live mode exits at once; hive keeps the meeting going (transcript, consent, `hive leave`, research approvals, the panel) without Spek's questions and notes, and the panel says Spektacular live mode is not running. +Spektacular must be a version that includes the `meeting` command ([hivecommons/spektacular#126](https://github.com/hivecommons/spektacular/pull/126)). With an older binary the live mode exits at once; hive keeps the meeting going (transcript, consent, `hive leave`, research approvals, the panel) without Spek's questions and notes, and the panel says plainly that notes and clarifying questions are off for the meeting. While hive cannot reach a Spektacular child that is restarting, the panel says they are paused, and clears it when Spek writes again. ## Using it diff --git a/src/pkg/meetings/live/live_test.go b/src/pkg/meetings/live/live_test.go index cdd1133df9..15e2832a8a 100644 --- a/src/pkg/meetings/live/live_test.go +++ b/src/pkg/meetings/live/live_test.go @@ -87,6 +87,7 @@ type fakeSpek struct { in []string lines chan []byte startErr error + sendErr error closed bool once sync.Once } @@ -109,6 +110,9 @@ func (f *fakeSpek) SendLine(line []byte) error { if f.closed { return errors.New("closed") } + if f.sendErr != nil { + return f.sendErr + } f.in = append(f.in, string(line)) return nil } @@ -584,6 +588,31 @@ func TestSpekExitKeepsSessionDegraded(t *testing.T) { h.eventually("session gone", func() bool { _, ok := h.r.session(h.m.ID); return !ok }) } +// TestSpekDownSaidPlainly pins hivecommons/hive#18590 finding 8: while +// hive cannot reach Spektacular the panel says notes and clarifying +// questions are off, and clears it when Spek writes again. +func TestSpekDownSaidPlainly(t *testing.T) { + h := newHarness(t, Policy{}, nil) + h.live() + h.spek.mu.Lock() + h.spek.sendErr = errors.New("spektacular: stream child is not running") + h.spek.mu.Unlock() + h.line(meetings.EventSegment, "Ana", "let's start", true) + h.eventually("paused status", func() bool { + return strings.HasPrefix(h.state().SpekStatus, "Notes and clarifying questions are paused") + }) + h.spek.mu.Lock() + h.spek.sendErr = nil + h.spek.mu.Unlock() + h.spek.intent(`{"type":"heartbeat"}`) + h.eventually("cleared", func() bool { return h.state().SpekStatus == "" }) + h.spek.Close(nil) + h.eventually("stopped status", func() bool { + st := h.state().SpekStatus + return strings.HasPrefix(st, "Notes and clarifying questions are off for this meeting") && strings.Contains(st, "#126") + }) +} + func TestUsageFileCharged(t *testing.T) { usage := filepath.Join(t.TempDir(), "usage.jsonl") h := newHarness(t, Policy{MaxTokensPerMeeting: 50}, func(o *Options) { o.UsageFile = func(string) string { return usage } }) diff --git a/src/pkg/meetings/live/session.go b/src/pkg/meetings/live/session.go index be0b8a14ba..8a67fcfb47 100644 --- a/src/pkg/meetings/live/session.go +++ b/src/pkg/meetings/live/session.go @@ -25,6 +25,27 @@ var ( ErrSessionEnded = errors.New("meetings: live session has ended") ) +// Spektacular live mode statuses shown on the Meetings panel +// (hivecommons/hive#18590 finding 8; live mode itself is +// hivecommons/spektacular#126). They lead with what the room loses. +const ( + // spekStoppedStatus: the child exited for good for this meeting. + spekStoppedStatus = "Notes and clarifying questions are off for this meeting: Spektacular live mode is not running (it needs a spektacular with the meeting command, hivecommons/spektacular#126). The transcript, the persona and research still work." + // spekPausedStatus: hive could not reach the child (it is restarting, + // or never came up); cleared when Spek writes again. + spekPausedStatus = "Notes and clarifying questions are paused: Spektacular live mode is not running right now (restarting, or it needs a spektacular with the meeting command, hivecommons/spektacular#126). The transcript, the persona and research still work." +) + +// setSpekStatus updates the panel's Spektacular status when it changes. +func (s *session) setSpekStatus(status string) { + if s.state.SpekStatus == status { + return + } + s.state.SpekStatus = status + s.emit(Event{Kind: EventSpek, Reason: status}) + s.save() +} + // defaultPersonaName names the attendee in hive's notices without a // persona. const defaultPersonaName = "Hive" @@ -183,10 +204,8 @@ func (s *session) run(ctx context.Context) { // research signals and approvals; only Spek's questions and // notes stop. spekGone, lines = true, nil - s.state.SpekStatus = "Spektacular live mode is not running for this meeting (needs a spektacular with the meeting command, hivecommons/spektacular#126); the transcript and research still work, questions and notes do not" s.log().Warn("[meetings] spektacular live mode stopped; continuing without it") - s.emit(Event{Kind: EventSpek, Reason: s.state.SpekStatus}) - s.save() + s.setSpekStatus(spekStoppedStatus) continue } s.onIntent(ctx, line) @@ -232,6 +251,12 @@ func (s *session) onUpdate(u meetings.Update) { if len(ev.Raw) > 0 { if err := s.spek.SendLine(ev.Raw); err != nil { s.log().Warn("[meetings] forwarding to spek", "error", err) + // The child is down (between restarts, or a spektacular + // without the meeting command): say so on the panel now rather + // than only once it gives up. + if s.state.SpekStatus == "" { + s.setSpekStatus(spekPausedStatus) + } } } if s.persona != nil { @@ -280,6 +305,10 @@ func (s *session) onIntent(ctx context.Context, line []byte) { s.log().Warn("[meetings] spek wrote a non-JSON line; skipped", "error", err) return } + // Spek is talking again after a restart: notes and questions are back. + if s.state.SpekStatus == spekPausedStatus { + s.setSpekStatus("") + } if in.Type == intentHeartbeat { now := s.now() s.state.LastHeartbeat = &now