Skip to content

✨ Betty times every answer stage and answers live-state questions without waiting for search - #18629

Closed
clubanderson wants to merge 1 commit into
v5from
betty-stage-timings
Closed

clubanderson wants to merge 1 commit into
v5from
betty-stage-timings

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Part 4 of the concurrent-requests work on #18590: speed visibility and the live-state fast path.

Stage timings. Every answer to a request carries Reply.Timing: heard (final line), ack (engine side, and early_ack when it was said from the partial transcript), retrieval, model call, answer ready, source (hive-status, retrieval, model, fallback) and budget: HiveStatusBudget 4 s for questions about the hive's live state, AnswerBudget 8 s otherwise. Over-budget answers are logged with their stages.

The live session adds delivery (answer ready to posted or handed to the voice) and the say call time (Quorum accepts after TTS on Discord), and keeps the last 20 in State.PersonaTimings plus State.PersonaLatency (answers, over budget, p50, max, last ack say time). The meeting detail API already returns the live state (GET /api/meetings/{id}/live → live), so both appear there with no API change.

Live-state fast path. Gather waited for every retriever up to 1.5 s, so a hive-status question waited for SearXNG. It now stops as soon as the hive status retriever returns its snippet: the in-memory status plus one model call, well inside the 4 s budget on the API backends.

Expected latencies (estimates, not measured live: running hives and the meetings namespace are off limits for this work): hive-status question on Haiku: retrieval about 10 to 50 ms (was up to 1.5 s behind web search), model about 1 to 2 s, answer ready about 1 to 2 s after the final line. Knowledge/web question: retrieval up to 1.5 s, model 1 to 2.5 s, about 3 to 4 s. On the claude CLI backend add a few seconds per warm turn. The new timings give the real numbers per meeting.

Touches the same lines as #18625 (attribution) in onAnswer/onAddressedAnswer; whichever merges second rebases and keeps both.

Tests: betty/timing_test.go (stage timings with a stepped clock, hive-status budget and over-budget flag, fallback source, Gather stops at the live state but waits otherwise), live/timing_test.go (timings and summary in the live state after an answer, last 20 kept, untimed replies not counted).

🤖 Generated with Claude Code

…hout waiting for search

Each answer carries heard, retrieval, model and answer-ready timings with
its source and budget (4 s for the hive's live state, 8 s otherwise); the
live session adds delivery and say times and keeps the last 20 with a
latency summary in the live state served by the meeting detail API.
Gather stops waiting once the hive status retriever answers.

Part of #18590.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 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
#18611 ✨ meetings: desktop companion meetings (/api/companion/*) same files src/docs/meetings.md
#18631 ✨ Betty cites the sources of chat answers and says when she is not sure CONFLICT src/docs/meetings.md (conflict)
src/pkg/meetings/betty/queue.go (conflict)
#18627 ✨ Betty speaks ready answers shortest first and moves a long voice queue to chat CONFLICT src/docs/meetings.md (conflict)
src/pkg/meetings/live/session.go (conflict)
#18633 🐛 Meetings: don't restart-loop the Spektacular stream child when live mode isn't available same files src/pkg/meetings/live/session.go
#18623 ✨ Betty runs several model calls per meeting at once same files src/docs/meetings.md
#18625 ✨ Betty names who and what each answer is for when requests overlap CONFLICT src/docs/meetings.md
src/pkg/meetings/betty/betty.go
src/pkg/meetings/betty/queue.go (conflict)
src/pkg/meetings/live/session.go
#18615 ✨ Meetings: delete finished meetings and stale join requests same files src/docs/meetings.md
#18602 📖 docs: Betty on Zoom without a Zoom app, options and recommendation same files src/docs/meetings.md

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 4 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/betty/queue.go 219 CONDITIONALS_BOUNDARY
src/pkg/meetings/betty/queue.go 219 CONDITIONALS_NEGATION
src/pkg/meetings/betty/timing.go 60 CONDITIONALS_BOUNDARY
src/pkg/meetings/betty/timing.go 101 CONDITIONALS_BOUNDARY

5 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/pkg/meetings/betty/timing.go 26 ARITHMETIC_BASE
src/pkg/meetings/betty/timing.go 28 ARITHMETIC_BASE
src/pkg/meetings/betty/timing.go 91 CONDITIONALS_BOUNDARY
src/pkg/meetings/betty/timing.go 91 CONDITIONALS_NEGATION
src/pkg/meetings/live/session.go 792 CONDITIONALS_NEGATION

ℹ️ 1 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/queue.go 169 CONDITIONALS_NEGATION

Verdict: lived (#17349).

@clubanderson

Copy link
Copy Markdown
Member Author

Combined into #18635 to get through CI and review together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant