Conversation
serve/dashboard are not in _AGENT_COMMANDS, so the CLI-side register_from_config in _prepare_agent_startup never runs for the desktop backend. Result: the desktop app runs WITHOUT any pre_tool_call hooks (budget gate, danger, memory routing, skill gate) even when allowlisted in config.yaml — a silent security hole for hook-based guardrails. Mirror the gateway (gateway/run.py): register declarative shell hooks in cmd_dashboard before start_server with accept_hooks=False (non-TTY start registers only allowlisted hooks; consent prompts never fire). Failures are logged at debug level and never block startup. Tests: cmd_dashboard registers hooks exactly once; a failing register_from_config still lets the server start.
Contributor
Duplicate of #69832 — both implement the same cmd_dashboard shell-hook registration call with accept_hooks=False for the serve/dashboard startup gap. |
Contributor
fix(dashboard): register shell hooks on serve/dashboard startup Fills a real gap (desktop backend running without pre_tool_call hooks); the tests pin the contract well. Observations:
|
This was referenced Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
serve/dashboardare not in_AGENT_COMMANDS = {None, "chat", "acp", "rl"}, so the CLI-sideregister_from_configin_prepare_agent_startup(main.py) never runs for the desktop backend. The gateway path registers hooks explicitly (gateway/run.py), butcmd_dashboardhas no such call.Result: the desktop app silently runs WITHOUT any pre_tool_call hooks — even when hooks are configured and allowlisted in
cli-config.yaml. That kills every hook-based guardrail for desktop sessions: budget gates, command danger filters, memory routing, skill-creation gates. Hook failures are invisible (no error, no log) — the hooks just never fire.Fix
Mirror the gateway (gateway/run.py): register declarative shell hooks in
cmd_dashboardbeforestart_server, withaccept_hooks=False(non-TTY backend → only allowlisted hooks register; consent prompts never fire). Registration failures are logged at debug level and never block startup — same policy as the gateway.Tests
test_cmd_dashboard_registers_shell_hooks—cmd_dashboardcallsregister_from_configexactly once withaccept_hooks=Falsetest_cmd_dashboard_hook_registration_never_blocks_startup— a failing registration still reachesstart_serverBoth pass;
test_serve_command.py+test_dashboard_lifecycle_flags.py(10 tests) still pass.