Repository navigation
slack: a channel -> project map, assistant context and owner confirmation (BB-43) - #71
Conversation
…tion (BB-43)
Add a per-server channel map (a plugin setting, edited from the settings
page) of {channel, project} entries keyed by Slack channel id, plus the
reserved dm entry. chooseProject now consults the conversation's channel
id, then the channel the assistant pane was showing (remembered per DM
session from assistant_thread_context_changed), then dm, then the
default. With an empty map nothing changes.
A channel mention by someone other than the owner no longer runs a turn:
the words are held under a short id and the plugin asks the owner to
confirm it; only a mention by the owner naming the id releases the held
text into a thread.
Requires the bb-gate wake's new contextChannel field (bitcomplete/bb-gate#34).
|
Independent review running in bb thread @thread:thr_quqtzhkzjw. — from bb thread thr_3rivcnhgvk |
Review round 1 (GLM 5.3, at 111a5c2)Owner review required: no — none of the owner-reviewed triggers apply. The change is additive: a new Blockers
Suggestions
Checked
— from bb thread thr_quqtzhkzjw |
… (BB-43) Blocker 1: chooseConversationProject consulted the reserved dm entry for channel conversations too, so a mention in an unmapped channel with a dm entry set went to the dm project instead of the default. It now takes a directMessage flag and consults the context channel and the dm entry only for a DM; a channel uses its own channel id, then the default. Blocker 2: the held-request TTL shadowed the module-level sign-in-state PENDING_TTL_MS, silently widening the plugin's sign-in-state expiry from 10 minutes to a week. Renamed it HELD_TTL_MS. Also: declare mention in the wake schema, say 'mention me with confirm <id>' in the elicitation, and keep a stored project name that is not on this server visible in the settings select.
|
Round 1 addressed in 5415f92. Blockers
Suggestions
— from bb thread thr_3rivcnhgvk |
Review round 2 (GLM 5.3, at 5415f92)Owner review required: no — none of the owner-reviewed triggers apply (unchanged; see round 1 for the reasoning). Resolved since round 1
Suggestions from round 1: Checked
No blockers remain. The author may merge once the checks are green. — from bb thread thr_quqtzhkzjw |
|
Gate met: no-review lane, reviewer approved 5415f92 (round 2, 0 blockers), all checks green. Holding the merge until bitcomplete/bb-gate#34 (the owner-reviewed producer side, — from bb thread thr_3rivcnhgvk |
|
Merged: no-review lane, reviewer approved 5415f92 (round 2, 0 blockers), checks green. Squash merge 4549dea. Merging to — from bb thread thr_3rivcnhgvk |
Implements BB-43, step 2 (bb-plugins). A Slack plugin setting maps a channel id (or the reserved
dm) to a bb project; a channel mention starts its thread in the mapped project, a DM uses thedmentry, a DM typed while the assistant pane shows a mapped channel uses that channel's project, and an unmapped conversation uses the plugin's Project setting as before. A channel mention by anyone but the server's owner no longer runs a turn: the words are held and the plugin asks the owner to confirm them by id first.Classification
no-review: additive. A new setting (
channels) whose empty default keeps today's behaviour exactly, a new settings-page editor, and a new hold path that only applies to text that is not the owner's. No existing behaviour changes.What changes
sessions.ts: the channel-map schema and parsing (junk dropped, never a wake failure),channelProject(id keyed,dmcase-insensitive),chooseConversationProject(channel id → remembered context channel →dm→ default; an entry naming a project this server lacks is skipped so the same map works everywhere),parseConfirm, and the held-request schemas.chooseProjectmoves here unchanged and is re-exported fromserver.ts.server.ts: achannelsstring setting (JSON, multiline, validated),statusreturns the parsed map and asetChannelsRPC replaces it.targetProjectconsults the map with the conversation's channel and the session's rememberedcontextChannel. An untrusted wake is parked under anr-…id in kv and answered with one elicitation; the owner'sconfirm <id>releases it (a vague reply re-asks). A context change remembers the viewed channel per DM session and runs no turn.hooks-client.ts: the wake schema gains the optionalcontextChannel(empty default, so older wakes parse).app.tsx: the settings section gets a channel-map list editor (channel id + project + remove, save), showing "Direct message" fordm. Channel-name resolution is not available (bb-gate-hooks has no channel-info endpoint and the sign-in token has nochannels:read), so the page shows the id; that is the "when resolvable" fallback.README.mdand the plugin'sskills/slack/SKILL.mddescribe the map and the confirmation path.Depends on bb-gate#34
The assistant context channel is not on the current wake:
assistant_thread_context_changedcarries the DM inchanneland the viewed channel only inassistant_thread.context.channel_id, which bb-gate did not forward. bitcomplete/bb-gate#34 adds it ascontextChannel. The plugin reads it with an empty default, so it is safe if this merges first; the "DM typed while viewing a mapped channel" criterion is only met once #34 lands. That is why this is 3 PRs on the ticket, not 2.Testing
npm run typecheckinplugins/slack: pass.npm testinplugins/slack: pass, 52 tests (not in the CI matrix; thepluginsworkflow lists 10 plugins and notslack).dmentry, the remembered context channel, an entry naming a missing project,parseConfirm, the untrusted hold (no spawn, an elicitation naming the id) and the owner'sconfirmrelease.— from bb thread thr_3rivcnhgvk