Skip to content

Commit 8896aaa

Browse files
committed
cleanup: remove ToolFlags, simplify renderSystemPrompt
1 parent 7de0666 commit 8896aaa

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

lib/hooks.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,7 @@ export function createSystemPromptHandler(
8585
return
8686
}
8787

88-
output.system.push(
89-
renderSystemPrompt({
90-
manual: state.manualMode,
91-
}),
92-
)
88+
output.system.push(renderSystemPrompt(state.manualMode))
9389
}
9490
}
9591

lib/prompts/index.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import { SYSTEM as SYSTEM_PROMPT } from "./_codegen/system.generated"
33
import { NUDGE } from "./_codegen/nudge.generated"
44
import { COMPRESS as COMPRESS_TOOL_SPEC } from "./_codegen/compress.generated"
55

6-
export interface ToolFlags {
7-
manual: boolean
8-
}
9-
10-
function renderSystemPromptInternal(manual: boolean): string {
6+
export function renderSystemPrompt(manual?: boolean): string {
117
let result = SYSTEM_PROMPT
128
result = result.replace(/\/\/.*?\/\//g, "")
139

@@ -30,10 +26,6 @@ function extractInstruction(content: string, name: string): string {
3026
return match ? match[0] : content
3127
}
3228

33-
export function renderSystemPrompt(flags?: ToolFlags): string {
34-
return renderSystemPromptInternal(flags?.manual ?? false)
35-
}
36-
3729
export function renderNudge(mode: NudgeMode = "frequency"): string {
3830
if (mode === "context-limit") {
3931
return extractInstruction(NUDGE, "context_buildup_warning")

0 commit comments

Comments
 (0)