Conversation
The desktop app and remote backends run agent turns through serve's in-process /api/ws gateway, but shell-hook registration lived only in _prepare_agent_startup, gated on _AGENT_COMMANDS = {None, chat, acp, rl} (+ cron/gateway/mcp subcommands). serve/dashboard are deliberately absent from that set, so lifecycle hooks (mnemon prime/remind/nudge) never registered on the headless path.
Extract a shared _register_shell_hooks() helper and call it from both _prepare_agent_startup (interactive entrypoints) and cmd_dashboard (serve + dashboard), so hooks fire regardless of how the agent turn is hosted.
Adds tests pinning that serve registers hooks and that the helper wires both shell and outbound webhooks.
Contributor
Chunk5 review — fix(serve): register shell hooks on dashboard/serve startupRight fix for a real gap: serve hosts agent turns via in-process
Non-blocking. Merge-ready. |
This was referenced Sep 3, 2026
Contributor
|
exact-head c1ae41e — void if moved CHECK / pick-one: serve-path registration via Recommend: close as duplicate of the #111315 consolidation, or fold the |
This was referenced Sep 15, 2026
This branch has not been deployed
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
The desktop app and remote backends run agent turns through
serve's in-process/api/wsgateway, but shell-hook registration lived only in_prepare_agent_startup, gated on_AGENT_COMMANDS = {None, "chat", "acp", "rl"}(+cron/gateway/mcpsubcommands).serve/dashboardare deliberately absent from that set, so lifecycle hooks (e.g. mnemonprime/remind/nudge) never registered on the headless path.Fix
Extract a shared
_register_shell_hooks()helper and call it from both:_prepare_agent_startup(interactive agent entrypoints), andcmd_dashboard(the headlessservebackend + dashboard)so hooks fire regardless of how the agent turn is hosted.
Tests
test_serve_registers_shell_hooks: serve registers hooks on startuptest_register_shell_hooks_wires_shell_and_outbound: the helper wires both shell and outbound webhooksContext
Follow-up to #92655, which added the shared registration path but left
serve/dashboardgated out.