Skip to content

✨ meetings: agent-backend model mode with a warm tool-less Claude Code CLI and Settings picker (part 1 of #18517) - #18528

Merged
kubestellar-prow[bot] merged 2 commits into
v5from
feat/18517-meetings-claude-cli
Nov 16, 2026
Merged

kubestellar-prow[bot] merged 2 commits into
v5from
feat/18517-meetings-claude-cli

Conversation

@clubanderson

Copy link
Copy Markdown
Member

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-backend takes meetings.llm.backend and meetings.llm.model. claude-cli is the same mode with the backend fixed to claude. With no backend set, the mode uses the backend most of the hive's agents run on. With no model set on claude, it uses claude-sonnet-5-5. openai, anthropic, none and auto work as before, and auto never picks an agent backend.

  • Completion profile (pkg/meetings/meetllm/cli.go). Each backend runs single-turn with:

    • --tools "", --strict-mcp-config and --disable-slash-commands
    • --setting-sources "" and --settings {"disableAllHooks":true,"alwaysThinkingEnabled":false}
    • --no-session-persistence and a fixed --system-prompt
    • an empty temp cwd
    • an allowlisted environment: PATH, locale, proxy and CA settings, CLAUDE_CONFIG_DIR, and HOME set 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.

    • Each completion is one user turn, read until the result event.
    • Calls from one meeting are serialised: the session lock is taken before the in-flight slot.
    • The process is recycled after HIVE_MEETINGS_CLI_RECYCLE_TURNS turns (default 8), and immediately on any error, timeout or crash, so a late reply can never answer the next request.
    • The process stops with the Betty engine.
  • Spek. hive meeting-llm reads HIVE_MEETING_LLM_BACKEND and runs claude -p --output-format json once 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/settings show claude CLI claude-sonnet-5-5 instead of "rules only". The effective settings now include meetings.llm.backend.

  • Settings, Meeting attendee, Model is a new section with its own Save model button and a new GET/PUT /api/meetings/model.

    • It lists backends and models from the same catalog the agent backend and model pickers use (backendOptionList and modelsForBackend over /api/config/backends).
    • Backends without a profile are shown but disabled.
    • Default is the hive's most common agent backend and its meetings default model.
    • The existing persona, email and actions code is unchanged apart from one line in maRender that adds the section.

Path taken: warm stream-json

I checked Claude Code 2.1.325, the version pinned in src/Dockerfile:

  • --input-format stream-json works with --output-format stream-json --verbose.
  • One process answers several user lines, each ending in its own result event with per-turn usage.
  • --tools "" plus --strict-mcp-config produced an init event with tools: [] and mcp_servers: [].
  • Measured warm turns with claude-sonnet-5-5 took 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-llm is a separate process per prompt, so it cannot share the warm process and uses claude -p with 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, omp and 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, per pkg/ioscan/cli_client.go). Each needs a fake-binary test.
  • codex and gemini expose no flag that removes every tool, so they stay refused unless that changes.
  • Named model gateways and vllm/llm-d onto the OpenAI path.
  • Hives that sign Claude agents in only with the operator token (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.go uses a fake claude script to cover:
    • streaming turns on one warm process
    • tool-disable flags and other profile flags in argv, and no bypass flags
    • a scrubbed env with no GH_TOKEN, HOME set to the shared home, and an empty temp cwd
    • recycle after N turns, and a fresh process after a timeout
    • crash and restart, and error results that still count their tokens
    • usage accounting, and budget refusal without a turn
    • a busy session, a closed session, and start failures
    • the hive meeting-llm one-shot path and its failures
  • pkg/config tests cover mode resolution, defaults from the agents, LiteLLM mapping, validation refusals and env overrides.
  • pkg/dashboard tests cover the model API (roles, save, refusal, env overrides) and the Model section's JS rules, run in node.
  • cmd/hive tests cover the Spek env and the persona factory warming the CLI.
  • pkg/meetings/betty tests check that the engine closes the model.

Docs: src/docs/meetings.md has a new Agent backends section with per-backend latency, plus the config table and the API reference.

🤖 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
#18536 ✨ feature: choose remote repository write identity same files dashboard/openapi.json
src/docs/api-reference/auth.md
src/docs/api-reference/configuration.md
src/pkg/dashboard/api.go
src/pkg/dashboard/static/index.html
#18505 ✨ Discover agents declared in a managed repo's .hive/agents/ behind owner approval same files dashboard/openapi.json
src/pkg/dashboard/api.go
src/pkg/dashboard/static/index.html

@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.

Why:

  • the branch conflicts with the base and needs a rebase

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: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

⏱️ The 900s mutation budget ran out, so 3 package(s) were not fully mutated and the results below do not cover them:

  • pkg/dashboard: cut short (partial, no report)
  • pkg/meetings/betty: skipped (not started)
  • pkg/meetings/meetllm: skipped (not started)

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/cmd/hive/meetingswire.go 209 CONDITIONALS_NEGATION
src/cmd/hive/meetingswire.go 209 CONDITIONALS_NEGATION
src/cmd/hive/meetingswire.go 210 CONDITIONALS_NEGATION
src/pkg/config/meetings_llm_agent.go 199 CONDITIONALS_NEGATION
src/pkg/config/meetings_llm_agent.go 208 CONDITIONALS_NEGATION

Verdict: uncovered (#17349).

@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

…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>
@hivecommons-hive
hivecommons-hive Bot force-pushed the feat/18517-meetings-claude-cli branch from 9eda746 to fc4ac75 Compare November 16, 2026 23:10
@kubestellar-prow kubestellar-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 16, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@clubanderson clubanderson added the lgtm Indicates that a PR is ready to be merged. label Nov 16, 2026
@kubestellar-prow
kubestellar-prow Bot merged commit 4bda017 into v5 Nov 16, 2026
95 of 97 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/18517-meetings-claude-cli branch November 16, 2026 23:28
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.

✨ Meetings: Betty and Spek use any of the hive's configured agent backends and models (Claude CLI, Codex, Copilot, LiteLLM, ...)

1 participant