gateway: dashboard /restart needs a cross-process restart RPC #1559

Closed
opened 2026-10-27 13:40:53 +00:00 by sam · 0 comments
Owner

/restart typed in the dashboard chat always answers "Chat adapter restart is not
configured." There is no process in which the capability can work.

EVIDENCE

  • The dashboard's chat router is the web router, built by boot.setupGatewayChat
    (internal/app/archied/gateway_runtime.go:55: gateway.NewRouter(b.stateStore,
    nil, "web")). Its Restart field is never assigned.
  • setupGatewayChat is called only by startGatewayRuntime (gateway.go:110), called
    only by RunGateway (gateway.go:84), called only by cmd/archie-gateway/main.go:32.
    It runs only in the archie-gateway process.
  • The Telegram adapter -- the only thing implementing a reload
    (Gateway.RequestRestart, internal/channels/telegram/telegram.go:190) -- is
    constructed and started only in the archied daemon (main.go Run -> setupGateways
    -> setupTelegramGateway, bootstrap.go:630).
  • gateway_runtime.go contains zero telegram.X references; its setup value is a
    telegramSetup config bag consumed only by makeChatLLMResponder and
    newChatTitleGenerator. It never constructs a *telegram.Gateway.
  • RequestRestart's own doc comment names the intended caller: "safe for callers
    outside Telegram (such as the local Web UI)".

So the intended caller lives in a different process from the callee, and no
gateway->daemon RPC for restart exists. The only existing gateway->daemon RPC
family is archie.gateway.task-action (internal/infrastructure/taskactions/rpc.go:23).

WHY THIS NEEDS A DESIGN FIRST (AGENTS.md scope discipline)
A new privileged "reload this service" verb needs its own auth (the task-action
client uses a bearer token), idempotency, and failure semantics -- notably what
happens if the daemon is mid-restart, and whether the caller learns the outcome.
There is no PRD and no entry in docs/architecture/migration-decisions.md.

NOT IN SCOPE
Email and webhook routers also leave Restart nil. They run in the SAME process as
the Telegram adapter, so in-process wiring is technically possible -- but they are
unauthenticated inbound channels, so wiring a restart verb there would expose an
unauthenticated restart. Leaving them unwired is the fail-closed choice.

DISCOVERED BY
The round-2 rework of PR #873, which removed an earlier attempt that wired
Router.Restart on the Telegram router (a path Telegram's own exact-match
restartHandler makes unreachable).

Close reason

Deleted the unassigned dashboard /restart command instead of building a restart RPC.


Imported from beads archie-core-ry4k · GitHub #940 · type task · priority P2 · created 2026-09-18 · closed 2026-10-10

/restart typed in the dashboard chat always answers "Chat adapter restart is not configured." There is no process in which the capability can work. EVIDENCE - The dashboard's chat router is the web router, built by boot.setupGatewayChat (internal/app/archied/gateway_runtime.go:55: gateway.NewRouter(b.stateStore, nil, "web")). Its Restart field is never assigned. - setupGatewayChat is called only by startGatewayRuntime (gateway.go:110), called only by RunGateway (gateway.go:84), called only by cmd/archie-gateway/main.go:32. It runs only in the archie-gateway process. - The Telegram adapter -- the only thing implementing a reload (Gateway.RequestRestart, internal/channels/telegram/telegram.go:190) -- is constructed and started only in the archied daemon (main.go Run -> setupGateways -> setupTelegramGateway, bootstrap.go:630). - gateway_runtime.go contains zero telegram.X references; its `setup` value is a telegramSetup config bag consumed only by makeChatLLMResponder and newChatTitleGenerator. It never constructs a *telegram.Gateway. - RequestRestart's own doc comment names the intended caller: "safe for callers outside Telegram (such as the local Web UI)". So the intended caller lives in a different process from the callee, and no gateway->daemon RPC for restart exists. The only existing gateway->daemon RPC family is archie.gateway.task-action (internal/infrastructure/taskactions/rpc.go:23). WHY THIS NEEDS A DESIGN FIRST (AGENTS.md scope discipline) A new privileged "reload this service" verb needs its own auth (the task-action client uses a bearer token), idempotency, and failure semantics -- notably what happens if the daemon is mid-restart, and whether the caller learns the outcome. There is no PRD and no entry in docs/architecture/migration-decisions.md. NOT IN SCOPE Email and webhook routers also leave Restart nil. They run in the SAME process as the Telegram adapter, so in-process wiring is technically possible -- but they are unauthenticated inbound channels, so wiring a restart verb there would expose an unauthenticated restart. Leaving them unwired is the fail-closed choice. DISCOVERED BY The round-2 rework of PR #873, which removed an earlier attempt that wired Router.Restart on the Telegram router (a path Telegram's own exact-match restartHandler makes unreachable). ### Close reason Deleted the unassigned dashboard /restart command instead of building a restart RPC. --- _Imported from beads `archie-core-ry4k` · GitHub #940 · type task · priority P2 · created 2026-09-18 · closed 2026-10-10_
sam added the mediumtask labels 2026-10-27 13:40:53 +00:00
sam self-assigned this 2026-10-27 13:40:53 +00:00
sam closed this issue 2026-10-27 13:40:53 +00:00
sam added a new dependency 2026-10-27 13:42:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1559