fix(coding-agent): renamed project-context wrapper to <repo-rules>

- Renamed the system prompt's project-context section wrapper from `<context>` to `<repo-rules>` in `project-prompt.md`, so it no longer collides with the `task` tool's `context` parameter under in-band XML tool dialects.
- Updated `snapcompact-inline`'s context-section strip pattern to match `<repo-rules>`.
- Updated the `snapcompact-inline` test fixture to the new wrapper.
- Changelog entry for this rename rides with the fused device-migration commit (adjacent changelog lines).
This commit is contained in:
can1357
2026-07-15 15:15:46 +02:00
parent d50cc4e2d3
commit f75c97773d
3 changed files with 4 additions and 4 deletions
@@ -7,14 +7,14 @@ PROJECT
</workstation>
{{#if contextFiles.length}}
<context>
<repo-rules>
You MUST follow the context files below for all tasks:
{{#each contextFiles}}
<file path="{{path}}">
{{content}}
</file>
{{/each}}
</context>
</repo-rules>
{{/if}}
{{#if agentsMdSearch.files.length}}
@@ -85,7 +85,7 @@ interface SystemPromptImageTarget {
}
const CONTEXT_SECTION_PATTERNS = [
/<context>\n[\s\S]*?\n<\/context>/g,
/<repo-rules>\n[\s\S]*?\n<\/repo-rules>/g,
/## Context\n<instructions>\n[\s\S]*?\n<\/instructions>/g,
] as const;
@@ -273,7 +273,7 @@ describe("SnapcompactInlineTransformer", () => {
const longContext = denseText(3000);
const context: Context = {
systemPrompt: [
`Core instructions.\n\n<context>\nYou MUST follow the context files below for all tasks:\n<file path="AGENTS.md">\n${longContext}\n</file>\n</context>\n\nToday is 2026-06-12.`,
`Core instructions.\n\n<repo-rules>\nYou MUST follow the context files below for all tasks:\n<file path="AGENTS.md">\n${longContext}\n</file>\n</repo-rules>\n\nToday is 2026-06-12.`,
"Final system block.",
],
messages: [userMessage("do the thing")],