Skip to content

feat(scopes): leave plugin-created Scopes out of Scope listings - #2715

Merged
hidb4ai merged 2 commits into
oceanbase:masterfrom
jasper-yl:feat/hide-plugin-scopes
Nov 18, 2026
Merged

hidb4ai merged 2 commits into
oceanbase:masterfrom
jasper-yl:feat/hide-plugin-scopes

Conversation

@jasper-yl

@jasper-yl jasper-yl commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Follows RFC #2579 (plugin-created Scopes). Requested by the knowledge-base plugin in #2658.

Rationale for this change

A plugin creates Scopes with ctx.scopes.create(), for example one per knowledge base. These Scopes hold what the plugin manages and are used through the plugin, but GET /v1/scopes lists them next to ordinary Scopes, so they appear in the Dashboard Scope selector, in Desktop, and in an agent's list_scopes.

What changes are included in this PR?

  • GET /v1/scopes leaves out Scopes that carry an external reference of kind powercontext.plugin, in the complete list, in pages, and with any filter. A request with external_reference_kind=powercontext.plugin lists exactly these Scopes.
  • Only listings change. Reading a Scope by ID, access to its data, authorization, and the plugin's own ctx.scopes.list() are unchanged. The Scopes of an unloaded plugin stay out of listings too.
  • The rule is stated in the list_scopes description in openapi/powercontext.yaml; the Python and Desktop generated sources follow. No parameter or schema changes.
  • The plugin guide and RFC docs(rfc): propose plugin hot reload and plugin-defined APIs #2579 describe the rule in both locales.

Are there any user-facing changes?

Yes, a behavior change of an existing operation: callers of GET /v1/scopes no longer receive plugin-created Scopes unless they ask for that reference kind. There is no request that returns ordinary and plugin-created Scopes together.

How was this change tested?

  • tests/e2e/test_plugin_access.py covers the complete list, a page, a filtered query, and the request for the plugin reference kind against a real Server.
  • Pre-commit hooks and ty check pass; make contract-test passes, 69 passed; the Scope and plugin access tests pass.
  • Desktop qualification sqlite-plugin-scope-listing-bc22089e-v1: anonymous loopback, static Bearer, HTTPS with CA/base path, and enforced Provider modes passed on a Linux VM (Ubuntu 24.04) against the wheel built from bc22089e9; tests/test_desktop_contract.py passes.

AI usage statement

Built with Claude Code (Claude). The author reviewed the design and the changes.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>

@frf12 frf12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed 549f7ae8ab80b8f6594c6ea9e490705a0adcbd3b. No blocking findings. Default filtering, explicit plugin-Scope discovery and pagination behave as documented; plugin-owned Scope queries and direct Scope/Artifact access remain intact. Verified the relevant tests and a real SQLite Server restart with the owning plugin removed. CI is still pending.

@Zxf-xufeng Zxf-xufeng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hidb4ai
hidb4ai merged commit 704c107 into oceanbase:master Nov 18, 2026
74 of 77 checks passed
@hidb4ai hidb4ai added the 1.6.0 v1.6.0 release tracking label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6.0 v1.6.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants