mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 13:04:08 +00:00
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:
parent
bc52509a42
commit
746ec9eb01
5 changed files with 40 additions and 17 deletions
|
|
@ -1395,8 +1395,13 @@ export class AgentSession {
|
|||
* Adds result to agent context and session.
|
||||
* @param command The bash command to execute
|
||||
* @param onChunk Optional streaming callback for output
|
||||
* @param options.excludeFromContext If true, command output won't be sent to LLM (!! prefix)
|
||||
*/
|
||||
async executeBash(command: string, onChunk?: (chunk: string) => void): Promise<BashResult> {
|
||||
async executeBash(
|
||||
command: string,
|
||||
onChunk?: (chunk: string) => void,
|
||||
options?: { excludeFromContext?: boolean },
|
||||
): Promise<BashResult> {
|
||||
this._bashAbortController = new AbortController();
|
||||
|
||||
try {
|
||||
|
|
@ -1415,6 +1420,7 @@ export class AgentSession {
|
|||
truncated: result.truncated,
|
||||
fullOutputPath: result.fullOutputPath,
|
||||
timestamp: Date.now(),
|
||||
excludeFromContext: options?.excludeFromContext,
|
||||
};
|
||||
|
||||
// If agent is streaming, defer adding to avoid breaking tool_use/tool_result ordering
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue