mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 03:03:44 +00:00
Remove emitLastMessage from continue(), use prompt(AppMessage) instead
Cleans up the temporary emitLastMessage plumbing since we now use Agent.prompt(AppMessage) for hook messages instead of appendMessage+continue. - Remove emitLastMessage parameter from Agent.continue() - Remove from transport interface and implementations - Remove from agentLoopContinue()
This commit is contained in:
parent
a6322fda59
commit
c1b4d043a8
5 changed files with 10 additions and 27 deletions
|
|
@ -216,12 +216,7 @@ export class Agent {
|
|||
* Continue from the current context without adding a new user message.
|
||||
* Used for retry after overflow recovery when context already has user message or tool results.
|
||||
*/
|
||||
/**
|
||||
* Continue from the current context without adding a new user message.
|
||||
* Used for retry after overflow recovery when context already has user message or tool results.
|
||||
* @param emitLastMessage If true, emit message_start/message_end for the last message
|
||||
*/
|
||||
async continue(emitLastMessage?: boolean) {
|
||||
async continue() {
|
||||
const messages = this._state.messages;
|
||||
if (messages.length === 0) {
|
||||
throw new Error("No messages to continue from");
|
||||
|
|
@ -232,7 +227,7 @@ export class Agent {
|
|||
throw new Error(`Cannot continue from message role: ${lastMessage.role}`);
|
||||
}
|
||||
|
||||
await this._runAgentLoopContinue(emitLastMessage);
|
||||
await this._runAgentLoopContinue();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -249,10 +244,10 @@ export class Agent {
|
|||
/**
|
||||
* Internal: Continue the agent loop from current context.
|
||||
*/
|
||||
private async _runAgentLoopContinue(emitLastMessage?: boolean) {
|
||||
private async _runAgentLoopContinue() {
|
||||
const { llmMessages, cfg } = await this._prepareRun();
|
||||
|
||||
const events = this.transport.continue(llmMessages, cfg, this.abortController!.signal, emitLastMessage);
|
||||
const events = this.transport.continue(llmMessages, cfg, this.abortController!.signal);
|
||||
|
||||
await this._processEvents(events);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue