opencode-gitlab-duo-agentic 0.1.18 → 0.1.19
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/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -838,11 +838,19 @@ function extractGoal(prompt) {
|
|
|
838
838
|
const message = prompt[i];
|
|
839
839
|
if (message.role !== "user") continue;
|
|
840
840
|
const content = Array.isArray(message.content) ? message.content : [];
|
|
841
|
-
const text2 = content.filter((part) => part.type === "text").map((part) => part.text).join("\n").trim();
|
|
841
|
+
const text2 = content.filter((part) => part.type === "text").map((part) => stripSystemReminders(part.text)).filter(Boolean).join("\n").trim();
|
|
842
842
|
if (text2) return text2;
|
|
843
843
|
}
|
|
844
844
|
return "";
|
|
845
845
|
}
|
|
846
|
+
var SYSTEM_REMINDER_RE = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
|
|
847
|
+
var WRAPPED_USER_RE = /^<system-reminder>\s*The user sent the following message:\s*\n([\s\S]*?)\n\s*Please address this message and continue with your tasks\.\s*<\/system-reminder>$/;
|
|
848
|
+
function stripSystemReminders(value) {
|
|
849
|
+
return value.replace(SYSTEM_REMINDER_RE, (block) => {
|
|
850
|
+
const wrapped = WRAPPED_USER_RE.exec(block);
|
|
851
|
+
return wrapped?.[1]?.trim() ?? "";
|
|
852
|
+
}).trim();
|
|
853
|
+
}
|
|
846
854
|
function readSessionID(options) {
|
|
847
855
|
const providerBlock = readProviderBlock(options);
|
|
848
856
|
if (typeof providerBlock?.workflowSessionID === "string" && providerBlock.workflowSessionID.trim()) {
|