Add shell commands without context contribution (!! prefix)

Use !!command to execute bash commands that are shown in the TUI and
saved to session history but excluded from LLM context, compaction
summaries, and branch summaries.

- Add excludeFromContext field to BashExecutionMessage
- Filter excluded messages in convertToLlm()
- Parse !! prefix in interactive mode
- Use dim border color for excluded commands

fixes #414
This commit is contained in:
Mario Zechner 2026-01-03 04:14:35 +01:00
parent bc52509a42
commit 746ec9eb01
5 changed files with 40 additions and 17 deletions

View file

@ -35,6 +35,8 @@ export interface BashExecutionMessage {
truncated: boolean;
fullOutputPath?: string;
timestamp: number;
/** If true, this message is excluded from LLM context (!! prefix) */
excludeFromContext?: boolean;
}
/**
@ -148,6 +150,10 @@ export function convertToLlm(messages: AgentMessage[]): Message[] {
.map((m): Message | undefined => {
switch (m.role) {
case "bashExecution":
// Skip messages excluded from context (!! prefix)
if (m.excludeFromContext) {
return undefined;
}
return {
role: "user",
content: [{ type: "text", text: bashExecutionToText(m) }],