Repository navigation
🐛 fix(adminmcp): version_read names the fields the hive returns; guide matches the tools - #16890
Conversation
…e matches the tools The version_read description and docs/admin-mcp.md told the reader to look at currentCommit. GET /api/version returns the running commit as hash and short and has no currentCommit, so the named field was never there. docs/admin-mcp.md also omitted the triggers settings_read section and said the write tools appear only when writes are on; they are always listed, with metadata.preview.enabled false and the reason. Two tests keep these from drifting: the description must name fields the real /api/version handler answers with, and the guide must list every settings_read section. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Checked each corrected claim against the v6 tree rather than the diff alone:
/api/versionreally does answerhashandshort, notcurrentCommit(src/pkg/dashboard/api_version.go:34-35;currentCommitlives only on the autoupdate status struct,autoupdate_status.go:75). The newversion_readdescription and the guide row now name the fields the endpoint returns.triggersis a registeredsettings_readsection (src/pkg/adminmcp/tools_settings.go:43) and was missing from the guide's list.toolDefsappendswrite_preview/write_confirmunconditionally and only variesmetadataviawriteMetadata(writesEnabled, …)(adminmcp.go:371-376,:401-408), so "always listed,preview.enabled=falsewith a note when off" is the accurate description; the old "appear only when writes are on" was wrong.
TestOperatorGuideListsEverySettingsSection reads ../../docs/admin-mcp.md from the package dir and iterates SettingsSections(), which will keep the guide honest for future sections. All checks green except tide. Looks correct to me. (Carries conflicts-with-open-pr — overlaps adminmcp.go with #16889/#16885; a one-line rebase for whichever lands second.)
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Checked each of the three corrections against the tree and they are all right:
The guide-vs-sections test is a nice ratchet. Looks correct to me. Evidence bundle `#1689089878b3` sha256:c7cc737b7158958f0308f392bd1b5d1dc9fa213a059e5d22be300e13df0a344a — download from the dashboard or `hivectl review evidence #16890`. |
…cker src/docs/admin-mcp.md: kept the reorganized guide and carried over v6's changes to it: ping and notification answers (hivecommons#16893), version_read hash/short (hivecommons#16890), settings_read takes no limit and the triggers section (hivecommons#16892), What a read masks (hivecommons#16889), and write tools always listed with metadata.preview.enabled (hivecommons#16890); the troubleshooting row follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Summary
Three statements about the admin MCP were wrong, one of them in a tool description the model reads. This PR corrects them and adds two tests so they cannot drift again. No behavior changes.
What was wrong
version_readnamed a field that does not exist. The tool description and the operator guide both said the running build is incurrentCommit.GET /api/versionreturns the running commit ashash(full) andshort, and has nocurrentCommitat the top level. A model asked "which commit is this hive on?" was pointed at a field that is never there. The existing test for this tool stubbed the endpoint with a made-upcurrentCommit, so it could not notice.triggerssettings section.settings_readoffers it, and the tool's own schema lists it, butsrc/docs/admin-mcp.mddid not.write_previewandwrite_confirmare always intools/list. When writes are off, or not available to the caller, they carrymetadata.preview.enabled: falseand a note with the reason, and a call is refused.Files
src/pkg/adminmcp/adminmcp.go: theversion_readdescription.src/docs/admin-mcp.md: the three corrections.src/pkg/dashboard/admin_mcp_test.go: the stubbed test uses a real field; newTestVersionReadDescriptionNamesTheCommitFieldsTheHiveReturnsruns the real/api/versionhandler.src/pkg/adminmcp/tools_settings_test.go: newTestOperatorGuideListsEverySettingsSection.changelog.d/fixed-admin-mcp-docs-match-tools.mdTests
TestVersionReadDescriptionNamesTheCommitFieldsTheHiveReturns: the real handler answers withhash,shortandbranch, and the description names them.TestOperatorGuideListsEverySettingsSection: fails onv6with "does not list the settings_read section triggers".go test ./pkg/adminmcp/ ./cmd/hive-admin-mcp/and theAdminMCPand version tests in./pkg/dashboard/pass.check-docs-citations.pyandcheck-docs-links.pypass.🤖 Generated with Claude Code