@openagents-org/agent-launcher 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/adapters/openclaw.js +17 -7
package/package.json
CHANGED
package/src/adapters/openclaw.js
CHANGED
|
@@ -281,13 +281,23 @@ class OpenClawAdapter extends BaseAdapter {
|
|
|
281
281
|
const url = new URL(this._directBaseUrl + '/chat/completions');
|
|
282
282
|
const transport = url.protocol === 'https:' ? https : http;
|
|
283
283
|
|
|
284
|
-
// Build system prompt
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
284
|
+
// Build system prompt
|
|
285
|
+
let systemPrompt;
|
|
286
|
+
try {
|
|
287
|
+
const { buildOpenclawSystemPrompt } = require('./workspace-prompt');
|
|
288
|
+
systemPrompt = buildOpenclawSystemPrompt({
|
|
289
|
+
agentName: this.agentName,
|
|
290
|
+
workspaceId: this.workspaceId,
|
|
291
|
+
channelName: channel,
|
|
292
|
+
endpoint: this.client?.endpoint || '',
|
|
293
|
+
token: this.token || '',
|
|
294
|
+
});
|
|
295
|
+
} catch (e) {
|
|
296
|
+
this._log(`System prompt build failed (using fallback): ${e.message}`);
|
|
297
|
+
}
|
|
298
|
+
if (!systemPrompt) {
|
|
299
|
+
systemPrompt = `You are a helpful AI assistant named ${this.agentName}. You are connected to an OpenAgents workspace. Answer questions concisely and helpfully.`;
|
|
300
|
+
}
|
|
291
301
|
|
|
292
302
|
// Simple conversation (no history for now)
|
|
293
303
|
const messages = [
|