summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Troisi <[email protected]>2025-06-23 15:41:33 -0700
committerGitHub <[email protected]>2025-06-23 22:41:33 +0000
commit8c6545bf9d7e51012b44e4adbacfd24147b2a386 (patch)
tree482b21a890af04d0c4adf067f479228a32e64f1f
parente21dbed8c8550ef3e742f4718f369e12960dbb70 (diff)
Include all chat messages (#1354)
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts24
1 files changed, 13 insertions, 11 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index 397c6e3c..73bfc5f0 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -727,6 +727,7 @@ Add any other context about the problem here.
model: MessageType.GEMINI,
};
let i = 0;
+ let hasSystemPrompt = false;
for (const item of conversation) {
i += 1;
const text =
@@ -734,22 +735,23 @@ Add any other context about the problem here.
?.filter((m) => !!m.text)
.map((m) => m.text)
.join('') || '';
- if (i <= 2) {
- // Skip system prompt back and forth.
- continue;
- }
if (!text) {
// Parsing Part[] back to various non-text output not yet implemented.
continue;
}
- addItem(
- {
- type: (item.role && rolemap[item.role]) || MessageType.GEMINI,
- text,
- } as HistoryItemWithoutId,
- i,
- );
chat.addHistory(item);
+ if (i === 1 && text.match(/context for our chat/)) {
+ hasSystemPrompt = true;
+ }
+ if (i > 2 || !hasSystemPrompt) {
+ addItem(
+ {
+ type: (item.role && rolemap[item.role]) || MessageType.GEMINI,
+ text,
+ } as HistoryItemWithoutId,
+ i,
+ );
+ }
}
console.clear();
refreshStatic();