fix: remove systemPrompt from llm_input result type (not yet plumbed)
Address greptile review: systemPrompt was declared in PluginHookLlmInputResult and merged in the hook runner, but never applied in attempt.ts. Since the system prompt is finalised before the llm_input hook runs, applying it requires restructuring that's out of scope for this PR. Removes the misleading field to avoid a silent no-op for plugin authors. Will be re-added when late-stage system prompt overrides are supported.
This commit is contained in:
parent
6bfd447fc9
commit
32720e044f
@ -1015,7 +1015,7 @@ export async function runEmbeddedAttempt(
|
||||
);
|
||||
}
|
||||
|
||||
// Run llm_input hook — plugins may modify prompt/systemPrompt
|
||||
// Run llm_input hook — plugins may modify the user prompt
|
||||
if (hookRunner?.hasHooks("llm_input")) {
|
||||
try {
|
||||
const llmInputResult = await hookRunner.runLlmInput(
|
||||
|
||||
@ -283,7 +283,7 @@ export function createHookRunner(registry: PluginRegistry, options: HookRunnerOp
|
||||
/**
|
||||
* Run llm_input hook.
|
||||
* Allows plugins to observe or modify the input payload sent to the LLM.
|
||||
* Plugins can return `{ prompt, systemPrompt }` to transform the input,
|
||||
* Plugins can return `{ prompt }` to transform the input,
|
||||
* or return void/undefined for observation-only (backward compatible).
|
||||
*/
|
||||
async function runLlmInput(
|
||||
@ -296,7 +296,6 @@ export function createHookRunner(registry: PluginRegistry, options: HookRunnerOp
|
||||
ctx,
|
||||
(acc, next) => ({
|
||||
prompt: next.prompt ?? acc?.prompt,
|
||||
systemPrompt: next.systemPrompt ?? acc?.systemPrompt,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -377,8 +377,9 @@ export type PluginHookLlmInputEvent = {
|
||||
export type PluginHookLlmInputResult = {
|
||||
/** Modified prompt text. If set, replaces the original prompt. */
|
||||
prompt?: string;
|
||||
/** Modified system prompt. If set, replaces the original system prompt. */
|
||||
systemPrompt?: string;
|
||||
// Note: systemPrompt modification is not yet supported — the system prompt
|
||||
// is finalised earlier in the pipeline. Will be added when late-stage
|
||||
// system prompt overrides are plumbed through.
|
||||
};
|
||||
|
||||
// llm_output hook
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user