@@ -38,6 +38,14 @@ export interface ModelFamilyPolicy {
3838 * at the tail so it cannot disturb the cached prompt prefix.
3939 */
4040 toolDisciplineRules ?: string ;
41+ /**
42+ * Provider-family residual appended once to the assembled leaf system
43+ * prompt (CL-8297). Generic tool-budget text today (grok only); the
44+ * ceremony / Claude / GPT seams stay unfilled in sibling lanes. Withheld
45+ * from orchestrators and appended at the tail so it cannot disturb the
46+ * cached prompt prefix. Undefined for families that need none.
47+ */
48+ promptResidual ?: string | undefined ;
4149}
4250
4351const DEFAULT_WRAP_UP_NUDGE_TEXT =
@@ -66,6 +74,16 @@ const DEFAULT_POLICY: Omit<ModelFamilyPolicy, "family"> = {
6674 advertisedToolDeny : [ ] ,
6775} ;
6876
77+ // Generic 4-line tool-budget residual (CL-8297). Grok leaves get this via
78+ // promptResidual today; other families leave the seam unfilled until their
79+ // own lanes land. Deliberately free of ceremony lines and family-specific
80+ // routing — pure tool-loop budget.
81+ export const GROK_TOOL_BUDGET_RESIDUAL =
82+ "Tool budget:\n" +
83+ "- Batch independent tool calls into a single turn.\n" +
84+ "- Never re-issue a tool call whose result you already have.\n" +
85+ "- When the next call would only repeat prior work, write the report instead." ;
86+
6987// A directly observed 14-turn pure-tool-call session for this family
7088// previously motivated a tightened nudge/pause pair here (6/10). That pair
7189// was miscalibrated: it fired on a session that was making real progress
@@ -83,6 +101,8 @@ const GROK_POLICY: Omit<ModelFamilyPolicy, "family"> = {
83101 applyGrokFinishBias : true ,
84102 // Leaf value; the resolver clears it for orchestrators below.
85103 advertisedToolDeny : [ "skill_search" ] ,
104+ // Leaf value; the resolver clears it for orchestrators below.
105+ promptResidual : GROK_TOOL_BUDGET_RESIDUAL ,
86106} ;
87107
88108// Kimi (Moonshot) detection ships now so callers can branch on family, but
@@ -126,6 +146,7 @@ export function resolveModelFamilyPolicy(input: {
126146 ...policy ,
127147 applyGrokFinishBias : policy . applyGrokFinishBias && ! orchestrator ,
128148 advertisedToolDeny : orchestrator ? [ ] : policy . advertisedToolDeny ,
149+ promptResidual : orchestrator ? undefined : policy . promptResidual ,
129150 } ;
130151 }
131152 case "kimi" :
0 commit comments