Skip to content

🐛 fix(adminmcp): settings_read returns a section whole, not its first 20 entries - #16892

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/adminmcp-settings-read-no-row-cap
Nov 6, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/adminmcp-settings-read-no-row-cap

Conversation

@Danathar

@Danathar Danathar commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Summary

settings_read shows what the dashboard Settings page shows. It was passed through the row cap meant for the list tools, which keeps the first 20 entries of any list. settings_read has no limit argument, so nothing could raise that cap. On a hive with more than 20 agents, the governor settings came back with 20 agents and the rest could not be read through MCP. This PR returns a section whole.

What an operator saw

settings_read (the default governor section) on a hive with 30 agents:

agents:            20 entries
agents_truncated:  true
_admin_mcp:        {"limit": 20, "truncated": true, "truncated_fields": ["agents"]}

The tool's schema has only section and agent, with no other argument allowed, so a client that follows the schema cannot send limit. Even one that does is stopped at 50. A section that is a list itself, such as backends, was cut to 20 entries and wrapped in {"items": [...], "truncated": true} instead of being returned as the list.

Hives with 20 agents or fewer never saw this.

What changes

Both transports return a settings_read answer without the row cap. The 256 KiB text cap still applies and still says what it cut. The list tools (agents_list, runs_list, claims_list and the others) keep their cap and their limit argument.

Files

  • src/pkg/dashboard/admin_mcp.go: the HTTP provider returns the section as read.
  • src/cmd/hive-admin-mcp/main.go: the stdio provider does the same.
  • src/cmd/hive-admin-mcp/settings_read_cap_test.go, src/pkg/dashboard/admin_mcp_settings_cap_test.go: new.
  • src/docs/admin-mcp.md: one sentence in "Settings sections".
  • changelog.d/fixed-admin-mcp-settings-read-whole-section.md

Tests

  • TestStdioSettingsReadReturnsTheWholeSection and TestDashboardAdminMCPSettingsReadReturnsTheWholeSection: 30 agents in the governor section and a 25-entry backends list come back whole on each transport.
  • TestStdioListToolsStillCapRows: agents_list still keeps 20 of 30.
  • The two whole-section tests fail on v6 without the change.
  • go test ./pkg/adminmcp/ ./cmd/hive-admin-mcp/ and the AdminMCP and SettingsRead tests in ./pkg/dashboard/ pass.

🤖 Generated with Claude Code

… 20 entries

settings_read went through CapResult, the list tools' row cap, which
keeps the first 20 entries of a list by default. settings_read has no limit
argument (its schema allows only section and agent), so on a hive with more
than 20 agents the governor settings came back with 20 agents and the rest
could not be read. A section that is itself a list (backends) was cut and
wrapped in {items, truncated}.

Both transports now return the section as read. The 256 KiB text cap still
bounds it; the list tools keep their cap.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 6, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16893 🐛 fix(adminmcp): the HTTP endpoint answers ping and acknowledges notifications same files src/docs/admin-mcp.md
#16889 🐛 fix(adminmcp): reads stop masking values that cannot be a credential same files src/docs/admin-mcp.md
#16890 🐛 fix(adminmcp): version_read names the fields the hive returns; guide matches the tools same files src/docs/admin-mcp.md
#16884 ✨ feat(adminmcp): read and act on the Activity monitor; writes run as the verified caller CONFLICT src/docs/admin-mcp.md

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 6, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Reviewed by reviewer-2 — no findings.

Reviewer notes

Looks correct to me.

Read both providers against v6. CapResult (src/pkg/adminmcp/adminmcp.go:783) truncates any cappedField list inside a map, and settingsReadSchema (src/pkg/adminmcp/tools_settings.go:94) exposes only section/agent — so the 20-row cut on agents really was unrecoverable through MCP. The early returns at src/cmd/hive-admin-mcp/main.go:369 and src/pkg/dashboard/admin_mcp.go:140 bypass only the row cap; MaxTextBytes (adminmcp.go:49, result_cap.go:21) still bounds the answer, as the doc change states. Both providers get a test. No findings.

Evidence bundle `#16892709f534` sha256:65e013c9166953753069a23fe83e64289ac75930e99f0975bb2d140b150e1f48 — download from the dashboard or `hivectl review evidence #16892`.

@hivecommons-hive
hivecommons-hive Bot merged commit 7544fe3 into hivecommons:v6 Nov 6, 2026
72 of 75 checks passed
Danathar added a commit to Danathar/hive that referenced this pull request Nov 6, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant