Give bots skills: runbooks they load when a job matches
A skill is a runbook: a name, a unique slug, a one-line description of when it applies, and the markdown body. A run only ever sees the slug and description (one load_skill tool carries them), and reads the whole body only when it calls the tool, so a long runbook costs nothing until needed. Skills are the third extension kind beside MCP servers and custom tools, on the same botExtensionsSql path, so per-bot, per-workspace and all-bots grants work the same way, and attachDefaultExtensions hands an every-bot skill to new bots. load_skill is a reserved tool name, so a custom tool cannot shadow it, and a built-in wins a clash. Managed on Settings > Skills; ExtensionRow links each kind to its own page and a skill never reports a failure, since nothing connects or runs.
This commit is contained in:
@@ -18,6 +18,7 @@ import runTextLoop from "@/src/harness/text/run-text-loop";
|
||||
import grabBotChatTools from "@/src/harness/tools/bot/grab-bot-chat-tools";
|
||||
import grabBotFileTools from "@/src/harness/tools/storage/grab-bot-file-tools";
|
||||
import openBotExtensions from "@/src/harness/tools/extensions/open-bot-extensions";
|
||||
import openBotSkills from "@/src/harness/tools/skills/open-bot-skills";
|
||||
import botMessagesToHarness from "./bot-messages-to-harness";
|
||||
import composeComputersNote from "./compose-computers-note";
|
||||
import grabSessionCarryOver from "./grab-session-carry-over";
|
||||
@@ -112,6 +113,14 @@ export default async function runBotReply({
|
||||
signal,
|
||||
});
|
||||
|
||||
/**
|
||||
* The run's skills: one `load_skill` tool and the lines that name them.
|
||||
*/
|
||||
const skills = openBotSkills({
|
||||
skills: extensions.skills,
|
||||
taken: [...tools, ...extensions.tools].map((tool) => tool.name),
|
||||
});
|
||||
|
||||
/**
|
||||
* delegate_task is only there while the coordinator has workers.
|
||||
*/
|
||||
@@ -140,6 +149,7 @@ export default async function runBotReply({
|
||||
in_workspace: Boolean(workspace_id),
|
||||
}),
|
||||
crew_note,
|
||||
skills.note,
|
||||
extensions.note,
|
||||
`Now: ${new Date().toUTCString()}.`,
|
||||
]
|
||||
@@ -153,7 +163,7 @@ export default async function runBotReply({
|
||||
user_id,
|
||||
}),
|
||||
}),
|
||||
tools: [...tools, ...file_tools, ...extensions.tools],
|
||||
tools: [...tools, ...file_tools, ...extensions.tools, ...skills.tools],
|
||||
max_steps: AppData.BotReplyMaxToolSteps,
|
||||
bot_id: bot.id,
|
||||
workspace_id,
|
||||
|
||||
Reference in New Issue
Block a user