Skip to content

Add zero-config quick mode for thv vmcp serve#4913

Merged
yrobla merged 2 commits intomainfrom
issue-4886
Apr 20, 2026
Merged

Add zero-config quick mode for thv vmcp serve#4913
yrobla merged 2 commits intomainfrom
issue-4886

Conversation

@yrobla
Copy link
Copy Markdown
Contributor

@yrobla yrobla commented Apr 17, 2026

Summary

When --config is omitted, --group enables quick mode: a minimal in-memory config is generated from the named ToolHive group so no config file is needed for the common local-aggregation case.

  • Add GroupRef field to ServeConfig; Serve() branches on ConfigPath vs GroupRef vs neither (error)
  • Add generateQuickModeConfig: anonymous auth, inline outgoing, prefix aggregation, validated before use
  • Remove MarkFlagRequired("config"); add --group flag to serve command
  • Regenerate docs/cli/thv_vmcp_serve.md

Fixes #4886

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

Changes

File Change

Does this introduce a user-facing change?

Implementation plan

Approved implementation plan

Special notes for reviewers

@github-actions github-actions Bot added the size/S Small PR: 100-299 lines changed label Apr 17, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 72.91667% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.39%. Comparing base (f5e0dbd) to head (14ca6b8).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/vmcp/cli/serve.go 72.91% 11 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4913      +/-   ##
==========================================
- Coverage   69.40%   69.39%   -0.01%     
==========================================
  Files         538      539       +1     
  Lines       55494    55677     +183     
==========================================
+ Hits        38513    38636     +123     
- Misses      14023    14069      +46     
- Partials     2958     2972      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a “zero-config quick mode” for thv vmcp serve so users can run the vMCP server without a YAML config by specifying --group, generating a minimal in-memory config for the common local aggregation workflow.

Changes:

  • Extend ServeConfig with GroupRef and update Serve() to load config from --config or generate quick-mode config from --group.
  • Add generateQuickModeConfig() helper and unit tests for quick-mode config generation and the “neither flag provided” error path.
  • Update thv vmcp serve CLI flags/docs: remove required --config, add --group, regenerate command docs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
pkg/vmcp/cli/serve.go Adds GroupRef quick-mode branching and helper to generate/validate an in-memory config.
pkg/vmcp/cli/serve_test.go Adds tests for quick-mode config generation and for erroring when neither --config nor --group is provided.
cmd/thv/app/vmcp.go Updates Cobra command flags: --config no longer required; adds --group and passes it to Serve().
docs/cli/thv_vmcp_serve.md Documents quick mode and updates the options list to include --group.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/vmcp/cli/serve.go
Comment thread cmd/thv/app/vmcp.go
Comment thread pkg/vmcp/cli/serve_test.go
Comment thread pkg/vmcp/cli/serve.go
jerm-dro
jerm-dro previously approved these changes Apr 17, 2026
Base automatically changed from issue-4883 to main April 17, 2026 16:09
@yrobla yrobla dismissed jerm-dro’s stale review April 17, 2026 16:09

The base branch was changed.

JAORMX
JAORMX previously approved these changes Apr 17, 2026
jerm-dro
jerm-dro previously approved these changes Apr 19, 2026
When --config is omitted, --group enables quick mode: a minimal in-memory
config is generated from the named ToolHive group so no config file is
needed for the common local-aggregation case.

- Add GroupRef field to ServeConfig; Serve() branches on ConfigPath vs
  GroupRef vs neither (error)
- Add generateQuickModeConfig: anonymous auth, inline outgoing, prefix
  aggregation, validated before use
- Remove MarkFlagRequired("config"); add --group flag to serve command
- Regenerate docs/cli/thv_vmcp_serve.md

Closes #4886
@yrobla yrobla dismissed stale reviews from jerm-dro and JAORMX via 1094a1e April 20, 2026 07:54
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Apr 20, 2026
@yrobla yrobla requested review from JAORMX, Copilot and jerm-dro April 20, 2026 07:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/vmcp/cli/serve.go
Comment thread pkg/vmcp/cli/serve.go
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/vmcp/cli/serve.go Outdated
Comment thread pkg/vmcp/cli/serve.go
Comment thread pkg/vmcp/cli/serve_test.go Outdated
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Apr 20, 2026
@yrobla yrobla merged commit 8223bec into main Apr 20, 2026
41 checks passed
@yrobla yrobla deleted the issue-4886 branch April 20, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement zero-config quick mode for thv vmcp serve

5 participants