Add /-/debug hub page with debug_menu() plugin hook

Replace the scattered debug tool links in the app menu with a single
"Debug" link to a new /-/debug page. This page aggregates all debug
tools using a new debug_menu() plugin hook, which plugins can implement
to contribute DebugItem(title, description, path) entries.

Hook implementations are responsible for their own permission checks,
so the page only shows items the current actor can access. Core debug
items (databases, plugins, versions, settings, permissions, etc.) are
registered via default_debug_menu.py.

https://claude.ai/code/session_01QE3BkTNRLvLEpLXy7ZDCeU
This commit is contained in:
Claude 2026-02-16 16:25:09 +00:00
commit 4c635a1d99
No known key found for this signature in database
15 changed files with 238 additions and 32 deletions

View file

@ -927,6 +927,18 @@ async def test_hook_handle_exception_custom_response(ds_client, param):
assert response.text == param
@pytest.mark.asyncio
async def test_hook_debug_menu(ds_client):
# Without authentication, no plugin debug items
response = await ds_client.get("/-/debug")
assert "Test debug item" not in response.text
# With authentication, plugin debug items appear
response_2 = await ds_client.get("/-/debug?_bot=1")
assert "Test debug item" in response_2.text
assert "From test plugin" in response_2.text
@pytest.mark.asyncio
async def test_hook_menu_links(ds_client):
def get_menu_links(html):