What do you want to change?
Add promptGuidelines to ToolInfo so extensions can read per-tool guideline ownership at runtime.
Two small changes in packages/coding-agent:
// src/core/extensions/types.ts (around line 1426)
export type ToolInfo = Pick<
ToolDefinition,
"name" | "description" | "parameters" | "promptGuidelines"
> & {
sourceInfo: SourceInfo;
};
// src/core/agent-session.ts (around line 805)
return Array.from(this._toolDefinitions.values()).map(({ definition, sourceInfo }) => ({
name: definition.name,
description: definition.description,
parameters: definition.parameters,
promptGuidelines: definition.promptGuidelines,
sourceInfo,
}));
By my read this is purely additive.
Why?
buildSystemPrompt flattens every active tool's promptGuidelines into one bulleted Guidelines: block, dropping per-tool ownership. Extensions can read the rendered block via ctx.getSystemPrompt() but cannot recover which tool owns each bullet — getAllTools() returns ToolInfo, which omits promptGuidelines.
This blocks any extension operating on guidelines per-tool. My case is an extension that rewrites the flat list into <tool name="..."> blocks for clearer model attribution. I wanted to build this because many extension builders don't realize that their guidelines have no attribution in the system prompt, resulting in contradictory or confusing instructions.
How? (optional)
The change outlined above. I'd be happy to implement it myself if approved.
What do you want to change?
Add
promptGuidelinestoToolInfoso extensions can read per-tool guideline ownership at runtime.Two small changes in
packages/coding-agent:By my read this is purely additive.
Why?
buildSystemPromptflattens every active tool'spromptGuidelinesinto one bulletedGuidelines:block, dropping per-tool ownership. Extensions can read the rendered block viactx.getSystemPrompt()but cannot recover which tool owns each bullet —getAllTools()returnsToolInfo, which omitspromptGuidelines.This blocks any extension operating on guidelines per-tool. My case is an extension that rewrites the flat list into
<tool name="...">blocks for clearer model attribution. I wanted to build this because many extension builders don't realize that their guidelines have no attribution in the system prompt, resulting in contradictory or confusing instructions.How? (optional)
The change outlined above. I'd be happy to implement it myself if approved.