mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 22:03:45 +00:00
Show pending bash executions in pending area, move to chat on user submit
This commit is contained in:
parent
2c014c1b95
commit
803d4b65ee
2 changed files with 33 additions and 6 deletions
|
|
@ -142,11 +142,6 @@ export class AgentSession {
|
|||
await this.checkAutoCompaction();
|
||||
}
|
||||
}
|
||||
|
||||
// Flush pending bash messages after agent turn completes
|
||||
if (event.type === "agent_end") {
|
||||
this._flushPendingBashMessages();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -266,6 +261,9 @@ export class AgentSession {
|
|||
* @throws Error if no model selected or no API key available
|
||||
*/
|
||||
async prompt(text: string, options?: PromptOptions): Promise<void> {
|
||||
// Flush any pending bash messages before the new prompt
|
||||
this._flushPendingBashMessages();
|
||||
|
||||
const expandCommands = options?.expandSlashCommands ?? true;
|
||||
|
||||
// Validate model
|
||||
|
|
@ -699,6 +697,11 @@ export class AgentSession {
|
|||
return this._bashAbortController !== null;
|
||||
}
|
||||
|
||||
/** Whether there are pending bash messages waiting to be flushed */
|
||||
get hasPendingBashMessages(): boolean {
|
||||
return this._pendingBashMessages.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush pending bash messages to agent state and session.
|
||||
* Called after agent turn completes to maintain proper message ordering.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue