Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1109-task-driven-turns.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A Bot with unfinished conversation tasks keeps working without a new message. The host starts a continue turn for the next task, in that Bot's own chat or in the group session that owns the subtask, and stops when the work is done or waiting on an answer. In a group, members with their own subtasks are woken in the same pass ([#1109](https://github.com/ThinkFlowLab/FlyBot/issues/1109)).
3 changes: 2 additions & 1 deletion core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as authz from './src/host/authz.js'
import * as roomMembership from './src/host/room-membership.js'
import * as reach from './src/host/reach.js'
import * as tasks from './src/host/tasks.js'
import * as taskDrive from './src/host/task-drive.js'
import * as models from './src/host/models.js'
import * as permissions from './src/host/permissions.js'
import * as turns from './src/host/turns.js'
Expand Down Expand Up @@ -51,7 +52,7 @@ export const inject = ['llm', 'tools', 'systemPrompt', 'sessionController', 'ses
// the functions other modules call; they call them through `rt` at run time, never during
// install. Listeners run and tools are listed in registration order, so this order holds:
// usage meters model requests after every listener that rewrites them.
const MODULES = [diagnostics, store, harness, memberAuth, authz, models, permissions, turns, delivery, roster, folders, agents, prompt, timeContext, tools, decisions, chatIndex, groups, roomMembership, reach, tasks, approvals, resume, memory, parts, images, secrets, connectors, connectorAccess, capabilities, schedules, automationDefault, browser, usage, update, dshUpdate, hooks, remoteChat, channel]
const MODULES = [diagnostics, store, harness, memberAuth, authz, models, permissions, turns, delivery, roster, folders, agents, prompt, timeContext, tools, decisions, chatIndex, groups, roomMembership, reach, tasks, taskDrive, approvals, resume, memory, parts, images, secrets, connectors, connectorAccess, capabilities, schedules, automationDefault, browser, usage, update, dshUpdate, hooks, remoteChat, channel]

export function apply(ctx, config = {}) {
const rt = createRuntime(ctx, config)
Expand Down
1 change: 1 addition & 0 deletions core/src/host/delivery.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export function install(rt) {
if (role === 'room') return `[Group chat "${roomName}" · ${note}]`
if (role === 'report') return `[Group chat "${roomName}" · replies to your post]`
if (role === 'secret') return '[Secret card]'
if (role === 'task') return '[Continue task]'
if (audience === 'user') return `[Message from ${fromName} · the user sees your reply here]`
return `[Message from ${fromName}]`
}
Expand Down
11 changes: 11 additions & 0 deletions core/src/host/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,17 @@ export function install(rt) {
return { id: session.id, brief: session.created && briefAllowed(room, member) ? await rt.ownChatBrief(member) : undefined }
}

// The task driver opens a member Session the first time a subtask needs it.
// The one-time own-chat brief stays with the first round; this turn's text is
// the continue cue (#1109).
rt.memberSession = async (room, botId) => {
const member = rt.botOf(botId)
if (!room || !member || member.remote !== undefined) return undefined
if (!(room.members ?? []).includes(member.id)) return undefined
const session = await participant.open({ room, member })
return session.id
}

// A plain line in a face-to-face room (#299): the Bots decide who answers. The rule for such lines is
// in the room's standing section (routeRules); each routed turn carries this short note with what
// only this line can say, so one Bot answers a specific question, a follow-up goes to the Bot that
Expand Down
7 changes: 4 additions & 3 deletions core/src/host/prompt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading