mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-24 20:28:16 +02:00
fix(copilot): make Copilot aware of native Slack and query selected channels (#627)
When Slack is connected natively (desktop/cURL auth, not Composio), the Copilot now routes Slack requests to the native slack skill instead of composio-integration, surfaces the user's selected channels in the system prompt, and steers catch-up queries to 'agent-slack message list --oldest' rather than unreads/search (which return empty under desktop-imported auth). Instruction cache is invalidated on slack:setConfig and knowledgeSources:upsert so changes take effect.
This commit is contained in:
parent
c38ddef93f
commit
2f926f8dc0
3 changed files with 88 additions and 10 deletions
|
|
@ -1054,6 +1054,9 @@ export function setupIpcHandlers() {
|
|||
'slack:setConfig': async (_event, args) => {
|
||||
const repo = container.resolve<ISlackConfigRepo>('slackConfigRepo');
|
||||
await repo.setConfig({ enabled: args.enabled, workspaces: args.workspaces });
|
||||
// Connecting/disconnecting Slack changes the Copilot's routing (native
|
||||
// `slack` skill vs. Composio), so rebuild its cached instructions.
|
||||
invalidateCopilotInstructionsCache();
|
||||
return { success: true };
|
||||
},
|
||||
'slack:cliStatus': async () => {
|
||||
|
|
@ -1227,6 +1230,9 @@ export function setupIpcHandlers() {
|
|||
'knowledgeSources:upsert': async (_event, args) => {
|
||||
const config = knowledgeSourcesRepo.upsertSource(args);
|
||||
if (args.provider === 'slack') {
|
||||
// The Copilot prompt lists the selected Slack channels, so refresh it
|
||||
// whenever the channel selection changes.
|
||||
invalidateCopilotInstructionsCache();
|
||||
triggerSlackKnowledgeSync();
|
||||
void syncSlackKnowledgeSources().catch(error => {
|
||||
console.error('[SlackKnowledge] Immediate sync after settings update failed:', error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue