Compare commits

..

2 Commits

Author SHA1 Message Date
zhi
18b0180429 feat: discussion guide file path + initiator speaks first
1. create-discussion-channel now accepts optional discussionGuidePath
   parameter as alternative to inline discussionGuide text. Either
   one is required; file path is read at tool execution time.

2. Discussion channel speaker list now places the initiator first,
   ensuring they set context before other participants respond.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 17:29:55 +00:00
ca7b47e683 fix: avoid clobbering sensitive config fields in install/uninstall
openclaw config get returns redacted values for sensitive fields (apiKey,
token, etc). Reading a parent object and writing it back overwrites real
secrets with the __OPENCLAW_REDACTED__ sentinel.

- install step 5: set only the dirigent provider instead of all providers
- uninstall step 2: set only plugins.load.paths instead of entire plugins tree
2026-04-16 14:33:01 +00:00
3 changed files with 30 additions and 13 deletions

View File

@@ -252,8 +252,13 @@ export default {
await sendModeratorMessage(live.moderatorBotToken, channelId, discussionGuide, api.logger)
.catch(() => undefined);
// Initialize speaker list
// Initialize speaker list (initiator first)
const agentIds = await fetchVisibleChannelBotAccountIds(api, channelId, identityRegistry);
const initiatorIdx = agentIds.indexOf(initiatorAgentId);
if (initiatorIdx > 0) {
agentIds.splice(initiatorIdx, 1);
agentIds.unshift(initiatorAgentId);
}
const speakers = agentIds
.map((aid) => {
const entry = identityRegistry.findByAgentId(aid);

View File

@@ -224,19 +224,35 @@ export function registerDirigentTools(deps: ToolDeps): void {
callbackGuildId: { type: "string", description: "Guild ID of your current channel (for callback after discussion)" },
callbackChannelId: { type: "string", description: "Channel ID to post the summary to after discussion completes" },
name: { type: "string", description: "Discussion channel name" },
discussionGuide: { type: "string", description: "Topic, goals, and completion criteria for the discussion" },
discussionGuide: { type: "string", description: "Topic, goals, and completion criteria for the discussion (inline text)" },
discussionGuidePath: { type: "string", description: "Path to a file containing the discussion guide (alternative to inline discussionGuide)" },
participants: { type: "array", items: { type: "string" }, description: "Discord user IDs of participating agents" },
},
required: ["callbackGuildId", "callbackChannelId", "name", "discussionGuide", "participants"],
required: ["callbackGuildId", "callbackChannelId", "name", "participants"],
},
execute: async (_toolCallId: string, params: unknown) => {
const p = params as {
callbackGuildId: string;
callbackChannelId: string;
name: string;
discussionGuide: string;
discussionGuide?: string;
discussionGuidePath?: string;
participants: string[];
};
// Resolve discussion guide: inline text or file path
let resolvedGuide = p.discussionGuide || "";
if (!resolvedGuide && p.discussionGuidePath) {
try {
const { readFileSync } = await import("node:fs");
resolvedGuide = readFileSync(p.discussionGuidePath, "utf8").trim();
} catch (err) {
return errorResult(`Failed to read discussion guide file: ${String(err)}`);
}
}
if (!resolvedGuide) {
return errorResult("Either discussionGuide or discussionGuidePath is required");
}
const initiatorAgentId = ctx?.agentId;
if (!initiatorAgentId) {
return errorResult("Cannot resolve initiator agentId from session");
@@ -291,7 +307,7 @@ export function registerDirigentTools(deps: ToolDeps): void {
initiatorAgentId,
callbackGuildId: p.callbackGuildId,
callbackChannelId: p.callbackChannelId,
discussionGuide: p.discussionGuide,
discussionGuide: resolvedGuide,
participants: p.participants,
});

View File

@@ -197,12 +197,10 @@ if (mode === "install") {
ok("plugin configured");
step(5, 7, "configure no-reply provider");
const providers = getJson("models.providers") || {};
providers[NO_REPLY_PROVIDER_ID] = {
setJson(`models.providers.${NO_REPLY_PROVIDER_ID}`, {
baseUrl: NO_REPLY_BASE_URL, apiKey: NO_REPLY_API_KEY, api: "openai-completions",
models: [{ id: NO_REPLY_MODEL_ID, name: `${NO_REPLY_MODEL_ID} (Custom Provider)`, reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 200000, maxTokens: 8192 }],
};
setJson("models.providers", providers);
});
ok("provider configured");
step(6, 7, "add no-reply model to allowlist");
@@ -229,10 +227,8 @@ if (mode === "uninstall") {
ok("removed plugin entry");
step(2, 4, "remove plugin load path");
const plugins = getJson("plugins") || {};
const paths = Array.isArray(plugins?.load?.paths) ? plugins.load.paths : [];
plugins.load = plugins.load || {}; plugins.load.paths = paths.filter((p) => p !== PLUGIN_INSTALL_DIR);
setJson("plugins", plugins);
const paths = getJson("plugins.load.paths") || [];
setJson("plugins.load.paths", paths.filter((p) => p !== PLUGIN_INSTALL_DIR));
ok("removed load path");
step(3, 4, "remove installed files");