Skip to content

fix: constrain speculative domain discovery - #199

Merged
FreeOnePlus merged 1 commit into
masterfrom
agent/refine-domain-routing
Aug 1, 2026
Merged

fix: constrain speculative domain discovery#199
FreeOnePlus merged 1 commit into
masterfrom
agent/refine-domain-routing

Conversation

@FreeOnePlus

Copy link
Copy Markdown
Member

Summary

  • define mutually exclusive scopes for all eight stable top-level domains
  • require single-domain-first progressive discovery instead of speculative multi-manifest browsing
  • guide unqualified cluster-history requests to preserve every usable recorded series
  • document the deterministic Host orchestration rule in English and Simplified Chinese
  • update the changelog and regression contracts

Root cause

A Dify 1.16.1 Agent expanded Catalog, Cluster, Pipeline, Query, and Governance manifests for one unqualified cluster-history question. Each later model step carried the accumulated manifests again, increasing context cost and encouraging unrelated probes. The Server contract did not state the domain exclusions or the single-domain-first rule strongly enough.

Contract behavior

  • the registered top-level list remains eight stable read-only domains
  • no probabilistic Server-side router or dynamic re-registration is introduced
  • each domain declares both its owned capability categories and excluded scopes
  • the common discovery instruction forbids speculative multi-domain expansion
  • unqualified current or historical cluster-operation questions use doris_cluster
  • unqualified resource-history calls omit resource, preserving usable series and reporting unavailable series separately
  • the final top-level tools/list remains bounded at 22,883 bytes

Real Host validation

Tested through Dify 1.16.1, /mcp/legacy, and a real Doris 4.0.5 environment:

  • before: five domain manifests expanded; 100,093 cumulative tokens
  • after: only doris_cluster expanded; 33,510 cumulative tokens
  • reduction: approximately 66.5%
  • Server audit log contained only Cluster-domain discovery and resource-history child calls
  • storage history remained readable with zero points; audit-backed query/user series reported permission denial separately

Validation

  • focused manifest, Host-exposure, and dispatcher suites: 112 passed
  • full suite: 1782 passed, 83 skipped
  • mypy doris_mcp_server
  • ruff check .
  • python generate_tool_catalog.py --check
  • git diff --check

@FreeOnePlus
FreeOnePlus merged commit b7b66f5 into master Aug 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant