Skip to content

feat(agents): claude xml task_guidance prompt residual - #1137

Merged
TheGreatAxios merged 13 commits into
mainfrom
cl-8309-0330-promptresidual-claude-xml-task_guidance-after-grok-row
Sep 21, 2026
Merged

TheGreatAxios merged 13 commits into
mainfrom
cl-8309-0330-promptresidual-claude-xml-task_guidance-after-grok-row

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Claude-family leaf workers append one balanced <task_guidance> XML block once at the tail of the system prompt via the ModelFamilyPolicy promptResidual seam (isClaudeLeafProvider + detectModelFamily claude row + CLAUDE_POLICY + buildClaudeTaskGuidanceNote + run.ts wiring).
  • Balanced tags; leaf-only (orchestrators resolve to the permissive default, no residual); never applied to grok/gpt rows; never a full-prompt XML renderer; no director fork.
  • Overlap flag: blocked-lane CL-8297 (parallel promptResidual lane, NOT merged) was assumed absent, so this unit adds the minimal local promptResidual hook in buildSubAgentSystemPrompt. If CL-8297 lands a generic seam first, this field should be subsumed by it on rebase.

Verification

  • RED then GREEN on the same branch: 875689f (failing tests) then 11fd819 (implementation).
  • bun test src/subagent/provider-family.test.ts src/agent/model-family-policy.test.ts src/agent/prompts.test.ts: 53 pass, 0 fail.
  • bun test src/agent src/subagent: 1356 pass, 0 fail.
  • bun run lint (oxfmt + oxlint): clean.
  • bun run typecheck: 1 error, pre-existing and unrelated (vendor/intx-types semver @types, file untouched by this change).

Fixes CL-8309

@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

CL-8309

Claude-family leaf workers get one <task_guidance> XML block appended
once at the tail of the system prompt via the ModelFamilyPolicy
promptResidual seam. A prose residual did nothing; one XML block cut
Sonnet tokens. Balanced tags, leaf-only, never applied to grok/gpt —
and never a full-prompt XML renderer.
Rebuild the Claude XML residual end to end from Anthropic's prompting docs while keeping CL-7775's measured shape: rationale first, numbered approach, named output contract, one wrapper, leaf-only tail placement. Every line is positively framed and scope-explicit for Sonnet's literal instruction-following; per-line provenance in the PR body.
@TheGreatAxios
TheGreatAxios force-pushed the cl-8309-0330-promptresidual-claude-xml-task_guidance-after-grok-row branch from cbbe707 to 72efaaa Compare September 21, 2026 03:06
The anthropic/claude-sonnet-4 fixture now resolves to the claude family,
so the default column silently measured the task_guidance block. Probe
openai/gpt-4.1 instead (default family until the CL-8310 gpt row lands)
and assert the default column carries no family residual.
@TheGreatAxios
TheGreatAxios merged commit 1a69ead into main Sep 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant