Skip to content

feat: add live meeting Q&A with bounded transcript context - #280

Merged
qiuethan merged 6 commits into
stagingfrom
feat/225/qna-meeting
Oct 18, 2026
Merged

qiuethan merged 6 commits into
stagingfrom
feat/225/qna-meeting

Conversation

@kr1shap

@kr1shap kr1shap commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Adds /qna question in a meeting's recording text channel. Replies are private and concise, using finalized speech from the last 15 minutes of elapsed meeting time, with up to three validated speaker/timestamp references. Each reply identifies the meeting using the exact filename shared with its minutes PDF.

The command registers globally with beta: false and an “In progress” description. It requires the invoking guild's active recording and exact recording text channel; threads are separate channels. No directory lookup or user-specific filtering is added, and existing service authentication remains intact.

Why

Participants can ask about the current discussion without waiting for recording to finish. The implementation reuses the current transcript and existing LLM /chat, with no database, embeddings, retrieval index, or conversation history.

  • Snapshot finalized segments when a question arrives. Silence counts toward the 15-minute window; short meetings use the meeting so far.
  • Cap serialized transcript evidence at 60,000 characters. Oversized windows retain the newest contiguous complete segments and disclose the shortened range. An individually oversized newest segment fails without a model call. This is a coarse guard, not an exact token limit.
  • Treat spoken instructions as evidence, validate structured model output and request-local source IDs, and derive references from the snapshot. Unsupported questions receive “Not discussed in the transcript available for MM:SS–MM:SS.” Empty windows make no model call.
  • Use thinking: false, a 1,024-token output budget, and the existing configured request timeout; minutes generation retains its existing behavior.
  • Isolate Q&A from audio/stop workers in one bounded process-wide executor. Capacity is max(1, default_shared_workers // 4): a base of 14 allows 3 Q&A workers, and 32 allows 8. Excess requests fail immediately with 429; cancellation holds a slot until the actual worker finishes.
  • Accepted questions finish using their original snapshot if recording stops. New questions are rejected once stopping begins. Questions and answers are neither persisted nor logged; generated replies disable mention parsing and fit Discord's message limit.

Zone

Deliberately spans services/meeting, discord-bot, shared documentation, and root: the authenticated HTTP contract, Discord consumer, and recording documentation must agree.

File rationale

Paths below are relative to their indicated directory.

Directory Files Purpose
Root README.md, AGENTS.md, docs/MEETING-RECORDING.md Publish the command/flow and record the worker-isolation invariant.
services/meeting README.md, docs/API.md, docs/ARCHITECTURE.md Document the endpoint, bounds, errors, lifecycle, and quarter-size pool.
services/meeting src/contracts.py Define validated request/response/reference DTOs.
services/meeting src/pipeline/qna.py Select bounded windows and validate grounded model answers and citations.
services/meeting src/pipeline/qna_runner.py, src/api/app.py Own bounded isolated workers and their application lifecycle.
services/meeting src/pipeline/llm_client.py Add optional thinking control and normalize malformed envelopes/timeouts.
services/meeting src/api/wiring.py, src/api/routers/meetings.py, src/sessions.py Inject collaborators, expose authenticated Q&A, and preserve snapshot/stop/audio sequencing.
services/meeting tests/conftest.py Close test pools and clear cached wiring.
services/meeting tests/test_qna.py, tests/test_qna_runner.py Cover window/size/citation rules, pool sizing, saturation, cancellation, and shutdown.
services/meeting tests/test_llm_client.py, tests/test_meetings_api.py, tests/test_openapi.py, tests/test_sessions.py Cover client failures, HTTP/schema behavior, snapshots, and ingestion/stop races.
discord-bot README.md, src/commands/qna.js, src/commands/index.js Document and globally register the in-progress command.
discord-bot src/adapters/discord/qna.js, src/adapters/discord/index.js, src/context.js Route private deferral/replies and safe unconfigured/error behavior.
discord-bot src/meeting/meetingClient.js, src/meeting/meetingSurface.js Call the authenticated endpoint and enforce original guild/session/channel selection.
discord-bot src/meeting/meetingFilename.js, src/adapters/discord/meetingPosts.js Share the existing filename rule between Q&A labels and PDF attachments.
discord-bot src/messages/qna.js Render bounded private answers, meeting names, references, and window disclosure.
discord-bot test/commands.test.js, test/qna.test.js Cover global registration, private delivery, channel errors, transport failures, rendering, and stop/replacement races.

How to verify

All suites use offline fakes; no paid live calls were made.

cd services/meeting
uv run pytest
uv run ruff check .
uv run ruff format --check .

cd ../../discord-bot
npm test
npm run lint
npm run format:check

Meeting and bot suites, both lint/format checks, and Git whitespace checks passed. After the final pool reduction, the full meeting suite and Ruff checks passed again. Python imports were verified to resolve to this checkout. One existing Starlette/httpx deprecation warning remains.

Regression coverage includes exact window boundaries and silence, size-cap retention, malformed/invented citations, unsupported answers, private errors, recording-channel selection, stable meeting filenames, stop races, and audio ingestion/stop remaining responsive while Q&A capacity is saturated.

Deployment notes

  • No new dependencies, environment variables, migrations, or API-key scopes.
  • Ship the meeting service and bot changes together; an older meeting service cannot serve the new command.
  • The bot's existing pre-deploy command registration must succeed so /qna becomes available globally. Global availability does not change ephemeral reply visibility.
  • Actual Q&A worker capacity is logged at startup and depends on runtime CPU availability. Production CPU allocation and live Discord/AWS behavior were not verified by these offline tests.

@github-actions github-actions Bot added size/xl >= 500 lines changed zone: discord-bot Owned by the discord-bot zone (docs/CODE-OWNERSHIP.md) zone: services/meeting Owned by the services/meeting zone (docs/CODE-OWNERSHIP.md) zone: docs Owned by the docs zone (docs/CODE-OWNERSHIP.md) zone: root Owned by the root zone (docs/CODE-OWNERSHIP.md) labels Oct 17, 2026
@kr1shap
kr1shap marked this pull request as ready for review October 17, 2026 01:47
@kr1shap kr1shap self-assigned this Oct 17, 2026
Refresh the dev preview through staging commit 4dd459a, including the OpenAI response-compatibility fix and current catalog changes. Keep the newer gateway rollout separate until its dev infrastructure is provisioned.

@qiuethan qiuethan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved the refreshed Q&A implementation. CI and local checks passed, and live GPT probes produced valid Q&A JSON. The refreshed commit is deployed successfully on Misty dev.

@qiuethan
qiuethan added this pull request to the merge queue Oct 18, 2026
Merged via the queue into staging with commit c3b91c6 Oct 18, 2026
21 checks passed
@qiuethan
qiuethan deleted the feat/225/qna-meeting branch October 18, 2026 05:31

This branch was successfully deployed

1 active deployment
Misty / dev — 4c690f47 Deployed Oct 18, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl >= 500 lines changed zone: discord-bot Owned by the discord-bot zone (docs/CODE-OWNERSHIP.md) zone: docs Owned by the docs zone (docs/CODE-OWNERSHIP.md) zone: root Owned by the root zone (docs/CODE-OWNERSHIP.md) zone: services/meeting Owned by the services/meeting zone (docs/CODE-OWNERSHIP.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants