Let the clients edit a Slack channel's behavior options - #1170
Merged
Conversation
A Slack channel definition carries three options that decide how the bot behaves: `progress` (what the thread shows while a turn runs), `follow_up` (whether it answers untagged messages), and `thread_context` (how much of a thread it reads on joining). Two consecutive PRs added them, and neither gave any client a way to set them — the only way to change one was to hand-edit the service TOML and wait for the watcher. `put_channel` carried the three forward with a "not editable through this path yet" comment, and `channel_summary` never returned them, so a client could not even display the value it was about to preserve. They now round-trip over `service.channel.put`. The summary reports them for Slack channels, a put takes them, and an omitted option still preserves the stored value — the preserve-on-absent behavior clients rely on today is unchanged. Unknown values, a thread context past Slack's ceiling, and any of the three on an HTTP channel are rejected rather than silently defaulted. The TUI's Slack channel editor grows three rows before State: Progress and Follow-up cycle with Space/arrows, Thread context takes a typed number. The web client gets the same three. The canonical value lists live in the protocol crate so both clients and the daemon's validator agree on the ordering.
Contributor
Author
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.

Follow-up to #1166 and #1168.
Those two PRs added three options to a Slack channel definition —
progress(what the thread shows while a turn runs),
follow_up(whether the bot answersuntagged messages), and
thread_context(how much of a thread it reads onjoining) — and neither gave any client a way to set them. The only way to change
one was to hand-edit
<config>/services/<name>.tomland wait for the watcher.The gap was explicit in the code:
put_channelcarried the three forward under a"Not editable through this path yet" comment, with a test pinning that workaround
in place, and
channel_summarynever returned them — so a client could not evendisplay the value it was about to preserve.
What changed
Protocol.
ServiceChannelSummaryandServiceChannelPuteach gainprogress,follow_up, andthread_contextasOption, so an omitted optionstill means "keep the stored value" — the preserve-on-absent behavior every
client relies on today is unchanged. The canonical value lists and the thread
context ceiling live here, so both clients and the daemon's validator cycle and
check against one ordering. Three new
ServiceFields declarePropagationClass::Immediate, matching the supervisor, which already replaces aSlack task whose config differs.
Daemon.
channel_summaryreports the three for Slack channels only.put_channeltakes supplied → existing → default. An unknown value, a threadcontext past Slack's ceiling, and any of the three on an HTTP channel are
rejected rather than silently defaulted.
TUI. The Slack channel editor grows three rows before State: Progress and
Follow-up cycle with Space/→ forward and ← back, Thread context takes a typed
number clamped to the cap. HTTP channels are untouched.
Web client. The same three, as two selects and a number input.
Specs.
0173names the behavior options in its "applies immediately" row.New
0180records the rule this gap breaks — an option that exists in a channeldefinition has to be reachable from the clients that edit channels. Two
consecutive PRs introduced the same gap, which is what makes it worth writing
down rather than just fixing.
Tests
Daemon: an omitted option preserves the stored value; a put sets all three;
unknown values, an over-cap thread context, and the options on an HTTP channel
are each rejected; the published defaults match what a definition gets.
TUI: the editor renders the three rows, Space/arrows cycle through the canonical
order and wrap, and a typed thread context clamps.
cargo test --workspaceis green.Binaries
Spans
crates/protocol,crates/daemon,crates/cli→ the binary to run isconstruct: