Skip to content

feat: add default scope for powercontext web - #1453

Open
jiannnnyyyyy wants to merge 6 commits into
oceanbase:masterfrom
jiannnnyyyyy:fix2
Open

feat: add default scope for powercontext web#1453
jiannnnyyyyy wants to merge 6 commits into
oceanbase:masterfrom
jiannnnyyyyy:fix2

Conversation

@jiannnnyyyyy

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #1449.

Rationale for this change

On a fresh installation, users should be able to open the Dashboard without manually configuring a Scope. The default Scope should be created automatically and diagnostics should provide clear guidance when Dashboard Scope discovery fails.

What changes are included in this PR?

  • Added Dashboard Scope discovery diagnostics to powercontext doctor.
  • Reported actionable guidance for:
    • missing Dashboard Scopes;
    • disabled Dashboard;
    • authentication-protected Scope discovery;
    • invalid or unavailable responses.
  • Updated CLI tests for the new diagnostic check.
  • Updated English and Chinese quickstart documentation to describe automatic Default Scope creation and selection.
  • Verified the existing runtime behavior that bootstraps the persistent Default Scope on startup.

Are there any user-facing changes?

Yes.

  • First-time users see the automatically created Default Scope in the Dashboard.
  • powercontext doctor now reports Dashboard Scope availability.
  • No breaking API or persisted-format changes.

How was this change tested?

uv run pytest tests/test_system_cli.py tests/test_dashboard.py tests/builtin/test_scope_application.py -q
65 passed

uv run ruff check src/powercontext/cli/system.py tests/test_system_cli.py
All checks passed

git diff --check
Passed

Also manually verified that a fresh local Server exposes the persistent Default Scope through /dashboard/scopes.

AI usage statement

Implemented with OpenAI Codex powered by GPT-5. Changes were reviewed and validated with targeted automated tests and Ruff.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Scope detection skips serving degraded servers, misidentifies Handoff-only deployments, under-validates responses, and documentation overstates selection behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds Dashboard Scope diagnostics and documents automatic Default Scope creation.

Changes:

  • Adds Scope discovery checks to powercontext doctor.
  • Updates CLI expectations.
  • Updates English and Chinese quickstarts.
File summaries
File Description
src/powercontext/cli/system.py Adds Dashboard Scope diagnostics.
tests/test_system_cli.py Updates doctor test expectations.
docs/en/docs/tutorials/codex-quickstart.md Documents Default Scope behavior.
docs/zh/docs/tutorials/codex-quickstart.md Documents Default Scope behavior in Chinese.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/powercontext/cli/system.py Outdated
Comment thread src/powercontext/cli/system.py Outdated
Comment thread src/powercontext/cli/system.py
Comment thread docs/en/docs/tutorials/codex-quickstart.md Outdated
Comment thread docs/zh/docs/tutorials/codex-quickstart.md Outdated
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.

feat: Automatically use the default Scope when no Scope is configured on first startup

2 participants