feat(core): Thread AgentLoopContext through core. (#21944)

This commit is contained in:
joshualitt
2026-03-10 18:12:59 -07:00
committed by GitHub
parent daf3701194
commit 20a226a5ab
30 changed files with 272 additions and 125 deletions
@@ -16,6 +16,7 @@
import { randomUUID } from 'node:crypto';
import type { Config } from '../../config/config.js';
import { type AgentLoopContext } from '../../config/agent-loop-context.js';
import { LocalAgentExecutor } from '../local-executor.js';
import { safeJsonToMarkdown } from '../../utils/markdownUtils.js';
import {
@@ -179,7 +180,7 @@ export class BrowserAgentInvocation extends BaseToolInvocation<
ToolResult
> {
constructor(
private readonly config: Config,
private readonly context: AgentLoopContext,
params: AgentInputs,
messageBus: MessageBus,
_toolName?: string,
@@ -194,6 +195,10 @@ export class BrowserAgentInvocation extends BaseToolInvocation<
);
}
private get config(): Config {
return this.context.config;
}
/**
* Returns a concise, human-readable description of the invocation.
*/
@@ -409,7 +414,7 @@ export class BrowserAgentInvocation extends BaseToolInvocation<
// Create and run executor with the configured definition
const executor = await LocalAgentExecutor.create(
definition,
this.config,
this.context,
onActivity,
);