fix(webui): count every chat front-end in the published projection

GitHub #821 reported two dashboard behaviours degrading in the extracted UI
process because webui.Server.Cfg is nil there. Half of it was already closed:
03afd2e ("take configuration off the dashboard server", on main since
2026-09-12) moved the daemon's ConfigView renderer off webui.Server, gave
ConfigView a chat section carrying show_tool_calls, the operator name and a
channel flag, and pointed chatShowToolCalls and handleSetup at the projection.
The chat page and the checklist do read published values now.

The channel flag was still wrong. It was derived from telegram and the webhook
gateway only, while the daemon's own channel status manager lists three
front-ends and counts the inbound mail gateway as one. An email-only
deployment therefore read as configured on /api/channels and unconfigured on
the setup checklist at the same time, and the checklist told the operator to
connect a channel they already had.

Fix at the producer: config.ChatConfig gains FrontEnds, the single definition
of "this front-end is configured", enumerating telegram, email and the webhook
gateway. Both the published projection (ChannelConfigured) and the daemon's
channel descriptors (status.NewManager) now derive from it, so the two surfaces
cannot drift apart again. A front-end added to [chat] is counted by both or
neither. Whitespace-only values are not configured: an env var name of " "
resolves to nothing and " " cannot be listened on.

The setup checklist stays. It renders each step as a title, a detail and a done
mark with no control behind it, so it answers "what is this deployment
missing?" rather than promising to fix it; the process that cannot apply setup
never offered to. Removing it would delete the one surface that distinguishes a
fresh deployment from a finished one, and the values it reads already cross the
boundary in ConfigView at no cost to the daemon. The write path stays descoped
for Phase 3 (docs/prds/ui-service-boundary.md, /api/config (write) row): the
checklist reports configuration, it does not change it.

docs/prds/ui-service-boundary.md records that judgement and corrects the
"Real-process evidence" paragraph, which claimed the channel flag covered every
chat channel.
This commit is contained in:
sam committed 2026-09-14 10:53:16 +00:00
1 parent 166972b3a0
commit 73aa86181e
7 files changed
+400 -16

No files matched your search

+21 -2
View File
@@ -294,8 +294,27 @@ and the `/api/setup` checklist (the panel was omitted rather than rendered).
Both are closed by `archie-core-ml30`: `ConfigView` gained a `chat` section
carrying `show_tool_calls`, the operator name, and whether any chat channel is
configured, and both surfaces now read the projection rather than a live
holder. The end-to-end suite asserts the checklist renders from the published
snapshot.
holder. The end-to-end suite drives the real binary and streams a turn, so the
`show_tool_calls` assertion is made on the frames a browser receives.
The checklist stays. The question raised when it was republished -- is a
read-only setup report wanted in a process that cannot apply the setup it
reports? -- resolves in favour of keeping it, because the panel never promised
to apply anything. It renders each step as a title, a detail and a done mark
with no control behind it, so it answers "what is this deployment missing?"
rather than "fix it here", and the page that CAN act on it (the Configuration
page) is where an operator goes next, in the daemon's own words. Removing it
would delete the one surface that distinguishes a fresh deployment from a
finished one for no gain, since the values it reads already cross the boundary
in `ConfigView` and the read path costs the daemon nothing. The write path
remains descoped (see `/api/config` (write) in the route table): the checklist
reports configuration, it does not change it.
`archie-core-ml30` published the channel flag from two of the three chat
front-ends, so an email-only deployment read as configured on `/api/channels`
and unconfigured on the checklist at the same time (GitHub #821). Both now
derive from `config.ChatConfig.FrontEnds`, the single definition of a configured
front-end, and a test pins the two surfaces to the same answer.
## Non-goals and open work