fix(coding-agent): chain system prompt in before_agent_start closes #3539
This commit is contained in:
@@ -877,9 +877,16 @@ export class ExtensionRunner {
|
||||
systemPrompt: string,
|
||||
systemPromptOptions: BuildSystemPromptOptions,
|
||||
): Promise<BeforeAgentStartCombinedResult | undefined> {
|
||||
const ctx = this.createContext();
|
||||
const messages: NonNullable<BeforeAgentStartEventResult["message"]>[] = [];
|
||||
let currentSystemPrompt = systemPrompt;
|
||||
const ctx = Object.defineProperties(
|
||||
{},
|
||||
Object.getOwnPropertyDescriptors(this.createContext()),
|
||||
) as ExtensionContext;
|
||||
ctx.getSystemPrompt = () => {
|
||||
this.assertActive();
|
||||
return currentSystemPrompt;
|
||||
};
|
||||
const messages: NonNullable<BeforeAgentStartEventResult["message"]>[] = [];
|
||||
let systemPromptModified = false;
|
||||
|
||||
for (const ext of this.extensions) {
|
||||
|
||||
Reference in New Issue
Block a user