96
* @param existing the per-model contributor's `tool_instructions` override, if any.
97
*/
98
>
function composeToolInstructions(existing: SectionOverride | undefined, content: string): SectionOverride {
toolInstructions.ts
99
>
// No per-model override: append after the SDK foundation section, led by a
100
>
// newline so it doesn't run on from the foundation content.
101
>
if (!existing) {
102
return { action: 'append', content: `\n${content}` };
103
}
104
// A `remove` or transform-function override is a deliberate, non-composable
105
// choice by the contributor; preserve it untouched rather than fight it.
106
>
if (existing.action === 'remove' || typeof existing.action === 'function') {
toolInstructions.ts
107
return existing;
108
}