Repository navigation
✨ meetings: agent-backend model mode with a warm tool-less Claude Code CLI and Settings picker (part 1 of #18517) - #18528
Conversation
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Why:
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: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
Mutation testing⏱️ The 900s mutation budget ran out, so 3 package(s) were not fully mutated and the results below do not cover them:
5 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
Verdict: |
|
[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 DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
…e CLI (#18517) Betty and Spektacular live mode can answer through one of the hive's agent backends: meetings.llm.mode agent-backend (meetings.llm.backend, meetings.llm.model) or claude-cli. Each backend runs in a narrow completion profile (single turn, no tools, no MCP, no hooks, no settings files, no session, empty temp cwd, fixed system prompt, usage from the CLI result). Claude runs one warm stream-json process per meeting for Betty, recycled after N turns or on any error, and one claude -p per prompt for Spek's hive meeting-llm. LiteLLM maps onto the OpenAI path; other backends are refused at validation. Usage is charged to the meeting ledger, budget and ceilings. Settings, Meeting attendee gains a Model section fed by the agents' backend and model catalog, and the panel shows the model name. Refs #18517 Signed-off-by: Andy Anderson <andy@clubanderson.com>
Send the CLI turn without HTML escaping, document GET/PUT /api/meetings/model in dashboard/openapi.json, keep backend discovery off the boot path, resync api-reference citations, and give the usage failure test a non-zero usage. Refs #18517 Signed-off-by: Andy Anderson <andy@clubanderson.com>
9eda746 to
fc4ac75
Compare
|
New changes are detected. LGTM label has been removed. |
Refs #18517
Part 1 of #18517: the shared agent-backend interface, the Claude Code CLI backend and the Settings picker. The remaining CLIs follow in a second PR that closes the issue.
What changes
New modes.
meetings.llm.mode: agent-backendtakesmeetings.llm.backendandmeetings.llm.model.claude-cliis the same mode with the backend fixed toclaude. With no backend set, the mode uses the backend most of the hive's agents run on. With no model set onclaude, it usesclaude-sonnet-5-5.openai,anthropic,noneandautowork as before, andautonever picks an agent backend.Completion profile (
pkg/meetings/meetllm/cli.go). Each backend runs single-turn with:--tools "",--strict-mcp-configand--disable-slash-commands--setting-sources ""and--settings {"disableAllHooks":true,"alwaysThinkingEnabled":false}--no-session-persistenceand a fixed--system-promptCLAUDE_CONFIG_DIR, andHOMEset to the shared agent home/data/home, where the fleet's sign-in lives.Hive never reads, copies or passes a token. Each call's instructions travel inside the user turn, and the system prompt treats meeting text as untrusted data.
Betty, warm path. Each meeting gets one
claude -p --input-format stream-json --output-format stream-json --verbose, started when the meeting starts.resultevent.HIVE_MEETINGS_CLI_RECYCLE_TURNSturns (default 8), and immediately on any error, timeout or crash, so a late reply can never answer the next request.Spek.
hive meeting-llmreadsHIVE_MEETING_LLM_BACKENDand runsclaude -p --output-format jsononce per prompt with the same profile and a cold-start timeout.Usage and budget. Every turn charges the result's usage (input, output and both cache counts) to the meeting's usage ledger. That feeds the per-meeting budget and the hive-wide ceilings, as the API modes do. A call is refused once the budget is spent.
Timeouts. Mode-specific timeouts are named constants that can be overridden by env: addressed 8 s, unprompted 6 s, restyle 3 s, Spek one-shot 30 s (
HIVE_MEETINGS_CLI_*_TIMEOUT_MS).LiteLLM maps onto the existing OpenAI-compatible path.
Other backends are refused at config validation and in the Settings PUT. The message says the backend has no meetings completion profile yet.
Status. The panel and
GET /api/meetings/settingsshowclaude CLI claude-sonnet-5-5instead of "rules only". The effective settings now includemeetings.llm.backend.Settings, Meeting attendee, Model is a new section with its own Save model button and a new
GET/PUT /api/meetings/model.backendOptionListandmodelsForBackendover/api/config/backends).maRenderthat adds the section.Path taken: warm stream-json
I checked Claude Code 2.1.325, the version pinned in
src/Dockerfile:--input-format stream-jsonworks with--output-format stream-json --verbose.resultevent with per-turnusage.--tools ""plus--strict-mcp-configproduced an init event withtools: []andmcp_servers: [].claude-sonnet-5-5took 0.86 to 1.2 s, well inside Betty's addressed timeout, so the one-call-per-completion fallback was not needed for Betty.Spek's
hive meeting-llmis a separate process per prompt, so it cannot share the warm process and usesclaude -pwith the cold-start timeout. Routing Spek through the warm process (for example over a local socket) is a possible follow-up.Follow-ups (second PR, closes #18517)
copilot,ompand the other CLIs: a completion profile for each CLI whose pinned non-interactive mode can run with no tools at a meeting-friendly latency (copilot and omp have tool-less flags, perpkg/ioscan/cli_client.go). Each needs a fake-binary test.codexandgeminiexpose no flag that removes every tool, so they stay refused unless that changes.vllm/llm-donto the OpenAI path.HIVE_CLAUDE_OAUTH_TOKEN, no credentials file) are not covered, because hive does not pass the token to the meetings CLI.Tests
pkg/meetings/meetllm/cli_test.gouses a fakeclaudescript to cover:GH_TOKEN,HOMEset to the shared home, and an empty temp cwdhive meeting-llmone-shot path and its failurespkg/configtests cover mode resolution, defaults from the agents, LiteLLM mapping, validation refusals and env overrides.pkg/dashboardtests cover the model API (roles, save, refusal, env overrides) and the Model section's JS rules, run in node.cmd/hivetests cover the Spek env and the persona factory warming the CLI.pkg/meetings/bettytests check that the engine closes the model.Docs:
src/docs/meetings.mdhas a new Agent backends section with per-backend latency, plus the config table and the API reference.🤖 Generated with Claude Code