Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-18590-spek-status-plain.md
Original file line number Diff line number Diff line change
@@ -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))
2 changes: 1 addition & 1 deletion src/docs/meetings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 29 additions & 0 deletions src/pkg/meetings/live/live_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type fakeSpek struct {
in []string
lines chan []byte
startErr error
sendErr error
closed bool
once sync.Once
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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 } })
Expand Down
35 changes: 32 additions & 3 deletions src/pkg/meetings/live/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
Loading