Skip to content

✨ meetings: Betty answers from the web, speaks when asked and digs into hard questions (phase B) - #18413

Merged
kubestellar-prow[bot] merged 5 commits into
v5from
feat/betty-voice-web
Nov 16, 2026
Merged

kubestellar-prow[bot] merged 5 commits into
v5from
feat/betty-voice-web

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Part of #18393 (phase B of #18391). The quorum v0.2.0 pin and the TTS wiring follow in a second PR.

What

  • Web answers. betty.WebRetriever queries SearXNG (GET /search?format=json&q=, 1.2 s timeout, top 3 title/url/snippet, HTML stripped, delimiters sanitized, untrusted data inside the data block). Wired when meetings.persona.searxng_url is set; the in-cluster Service on hive-oke is http://searxng.meetings.svc.cluster.local:8080.
  • Voice replies. When a request is spoken or asks to be said aloud, Betty says a short rotating, language-aware acknowledgement at once (never charged, never posted to chat), then the answer clipped to 2 sentences / 200 characters with links and Markdown stripped, through the existing say path with chat fallback. A spoken request with no question gets one clarifying question or 1-2 sentences on the last 3 minutes.
  • Deep dive. An addressed question whose answer sets needs_research or is below min_confidence (when the meeting has a research path) says "I'll dig into that and report back", dispatches through the existing research path and cap with meta betty=1 (item betty-N, never reported to Spek), and posts exactly one restyled follow-up when it completes (raw summary if restyling fails).
  • Anthropic-only hives. meetllm gains an Anthropic Messages API path (net/http, x-api-key, anthropic-version), used for Betty's calls when the meetings backend resolves to Anthropic. Model: meetings.llm.model, default claude-haiku-5-5 (thinking disabled on Haiku 5.x for latency). Same timeouts, in-flight slots and usage ledger, which the live loop now charges on the Anthropic backend too.
  • False triggers. Aliases sharing no word with the persona's name ("hive") address her only as "hive, ..." / "hive: ...", after "hey"/"ok", or closing a question after a comma ("..., hive?"). "betty" stays looser.
  • Async restyle. Spek ask rewording runs off the session goroutine; later asks and chat offers queue behind it so Spek's order holds; raw text on timeout.
  • Inbox notes header uses the persona name.
  • Discord voice off. The existing say gate (meeting voice toggle + voice_on_address) is platform-agnostic; new tests pin that no say is ever sent for a Discord meeting with voice off, from Betty or Spek.

Tests

betty: strict alias table, ClipVoice/phrases, ack-then-answer, thoughts, deep dive + follow-up, web retriever against httptest (shapes, limits, errors, timeout). live: ack latency against a slow model with a fake say, Discord voice off, deep dive dispatch/meta/one follow-up/approval cap, async restyle ordering and timeout. meetllm: Anthropic request/response, usage and budget, refusal and error paths. config + wiring + inbox header.

🤖 Generated with Claude Code

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18424 ✨ meetings: Betty drafts issues, RFCs, Spek sessions and knowledge notes for approval (Betty F) same files src/docs/env-vars.md
src/docs/meetings.md
src/pkg/config/meetings_persona.go
src/pkg/meetings/betty/betty.go
src/pkg/meetings/betty/queue.go
src/pkg/meetings/live/session.go
#18423 ✨ mailin: hive-mx receive-only mail receiver (Betty C2 part 1) same files src/docs/env-vars.md
src/docs/meetings.md
#18417 ✨ meetings: Settings tab "Meeting attendee" with Kokoro persona presets (Betty E) same files src/docs/meetings.md
src/pkg/config/meetings_persona.go
#18416 ✨ meetings: Quorum v0.2.0 and Discord speech through the TTS service same files src/cmd/hive/meetingswire.go
src/docs/env-vars.md
src/docs/meetings.md
src/pkg/config/meetings_config.go
#18405 ✨ Inbox: send items into an Inception (spek) session same files src/docs/env-vars.md

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 5 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.

File Line Mutation
src/pkg/meetings/live/session.go 518 CONDITIONALS_NEGATION
src/pkg/meetings/live/session.go 680 INCREMENT_DECREMENT
src/pkg/meetings/live/session.go 751 CONDITIONALS_NEGATION
src/pkg/meetings/live/session.go 777 INCREMENT_DECREMENT
src/pkg/meetings/live/session.go 797 INCREMENT_DECREMENT

11 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the mutation/acknowledged label to accept this.

File Line Mutation
src/cmd/hive/meetingswire.go 199 CONDITIONALS_NEGATION
src/cmd/hive/meetingswire.go 199 CONDITIONALS_NEGATION
src/cmd/hive/meetingswire.go 215 CONDITIONALS_NEGATION
src/pkg/meetings/betty/trigger.go 141 CONDITIONALS_BOUNDARY
src/pkg/meetings/betty/trigger.go 141 CONDITIONALS_NEGATION
src/pkg/meetings/betty/trigger.go 143 CONDITIONALS_BOUNDARY
src/pkg/meetings/betty/trigger.go 143 CONDITIONALS_NEGATION
src/pkg/meetings/betty/trigger.go 192 CONDITIONALS_NEGATION
src/pkg/meetings/betty/trigger.go 194 CONDITIONALS_NEGATION
src/pkg/meetings/betty/web.go 19 ARITHMETIC_BASE
src/pkg/meetings/live/session.go 725 INCREMENT_DECREMENT

ℹ️ 2 mutant(s) on added lines were SKIPPED because gremlins v0.6.0 only honours the first lines added lines of each default-context hunk, so non-contiguous edits in one hunk are partly missed. This does not affect the verdict.

File Line Mutation
src/pkg/meetings/betty/trigger.go 202 ARITHMETIC_BASE
src/pkg/meetings/betty/trigger.go 202 INVERT_NEGATIVES

Verdict: lived (#17349).

@hivecommons-hive

hivecommons-hive Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • golangci-lint

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

hive/awaiting-ci: merged v5 into the branch (was behind); CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 3a7fbf5ca

— hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325

…to hard questions (phase B)

- betty: SearXNG WebRetriever (GET /search?format=json, 1.2 s timeout,
  top 3 title/url/snippet, HTML stripped, untrusted data), wired when
  meetings.persona.searxng_url is set
- voice: spoken or "say it aloud" requests get an immediate rotating,
  language-aware acknowledgement, then an answer of at most 2 sentences
  and 200 characters with no links or Markdown, through the say path with
  chat fallback; a spoken request with no question gets a clarifying
  question or thoughts on the last 3 minutes
- deep dive: an addressed question with needs_research or low confidence
  says "I'll dig into that and report back", dispatches research with
  betty=1 through the existing cap and approval, and posts exactly one
  restyled follow-up when it completes
- Anthropic Messages API path for Betty's calls on hives with only an
  Anthropic key (meetings.llm.model, default claude-haiku-5-5), same
  timeouts, slots and usage ledger
- the "hive" alias only addresses Betty as "hive, ...", "hive: ...",
  after hey/ok, or closing a question as "..., hive?"
- Spek ask rewording runs off the session goroutine; Spek's later asks
  and chat offers keep their order; raw text on timeout
- the Inbox notes header names the persona
- docs: meetings.md, env-vars.md

Part of #18393

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two CI failures on this head (51cfe11) trace to the PR's own code; both are small.

  1. test (rest 4/4) — TestStripHTML fails (src/pkg/meetings/betty/voice_web_test.go:327, got "a & b c "). In stripHTML (web.go:35-41) the strings.Fields join runs before sanitize, and sanitize (betty.go/answer.go, func sanitize) deletes the trailing >>> without trimming, so the space preceding it survives. Fix: run sanitize first, or strings.TrimSpace its result / apply Fields after it.
  2. golangci-lint — misspell flags momento at src/pkg/meetings/betty/voice.go:39, 54, 59 (the Spanish/Portuguese/Italian "Un/Um momento" acks). These are correct in those languages; the linter is applying its English dictionary. Fix: a //nolint:misspell on those lines or a misspell ignore-words entry in the golangci config.

coverage and test fail downstream of (1). I did a targeted read of these paths only, not a full review of the 1.6k-line change.

— hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.325

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness delta review at 7109a7c (read the betty, live and meetllm changes since 51cfe11).

Previous findings

  • web.go:35 stripHTML trailing space: fixed. stripHTML now ends in strings.Join(strings.Fields(...), " ") (web.go:40), so there is no leading or trailing space.
  • voice.go:39 misspell lint on non-English strings: still present (style perspective, not mine). The es/fr/de/pt/it phrase tables are unchanged and I saw no //nolint or lint ignore.

New finding (low, in-scope)
Betty says "I'll dig into that and report back" but a deep dive that fails or stalls never reports back.

  • session.go onPersonaReply calls deepDive after the promise is spoken.
  • deepDive parks the item as ResearchPendingApproval when over the research cap.
  • onSignal's SignalError case (about line 614) only calls s.update(...), and update skips Spek for it.Betty. So nobody hears about the failure.
  • Only SignalComplete triggers persona.FollowUp.
  • Net effect: the room hears a promise that is silently dropped on error or over-cap.

Suggested fix in the SignalError branch:

case SignalError:
    s.update(it, ResearchFailed, text)
    if it.Betty && s.persona != nil && !it.Posted {
        it.Posted = true
        s.deliver(ctx, "I couldn't finish digging into that one.")
    }
    s.r.unregisterKick(sig.KickID)

The same applies when dispatch fails. Not blocking.

The rest of the delta looks correct:

  • Strict-alias matching: spans and words use the same split rule.
  • ack and follow-up paths.
  • The restyle queue ordering.
  • The Anthropic client.
  • Tests cover the new paths: voice_web_test.go, persona_voice_test.go, anthropic_test.go.

I did not review the inbox-recording files in the delta; they are unrelated to this PR's title.

— hive: agent=adjudicator-4 backend=claude model=claude-sonnet-5-5 claude=2.1.325

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 16, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
kubestellar-prow Bot merged commit 48e3441 into v5 Nov 16, 2026
88 of 90 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/betty-voice-web branch November 16, 2026 14:25
clubanderson added a commit that referenced this pull request Nov 16, 2026
Phase B (#18413, #18416) added meetings.tts_url and the TTS token, so the
persona sample now speaks through them by default (SetMeetingsTTSResolver
still overrides). Resynced the API reference citations.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant