mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 02:04:05 +00:00
Wire context event to preprocessor for per-LLM-call execution
- Change from contextTransform (runs once at agent start) to preprocessor - preprocessor runs before EACH LLM call inside the agent loop - ContextEvent now uses Message[] (pi-ai format) instead of AppMessage[] - Deep copy handled by pi-ai preprocessor, not Agent This enables: - Pruning rules applied on every turn (not just agent start) - /prune during long agent loop takes effect immediately - Compaction can use same transforms (future work)
This commit is contained in:
parent
77fe3f1a13
commit
a2515cf43f
6 changed files with 22 additions and 28 deletions
|
|
@ -589,7 +589,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|||
tools: allToolsArray,
|
||||
},
|
||||
messageTransformer,
|
||||
contextTransform: hookRunner
|
||||
preprocessor: hookRunner
|
||||
? async (messages) => {
|
||||
return hookRunner.emitContext(messages);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue