From f75c97773d17a5276c8e336bf4d8ad2708ab6a5a Mon Sep 17 00:00:00 2001 From: can1357 Date: Wed, 15 Jul 2026 15:15:46 +0200 Subject: [PATCH] fix(coding-agent): renamed project-context wrapper to - Renamed the system prompt's project-context section wrapper from `` to `` 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 ``. - 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). --- packages/coding-agent/src/prompts/system/project-prompt.md | 4 ++-- packages/coding-agent/src/session/snapcompact-inline.ts | 2 +- packages/coding-agent/test/snapcompact-inline.test.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/coding-agent/src/prompts/system/project-prompt.md b/packages/coding-agent/src/prompts/system/project-prompt.md index a08d45783..f5033d137 100644 --- a/packages/coding-agent/src/prompts/system/project-prompt.md +++ b/packages/coding-agent/src/prompts/system/project-prompt.md @@ -7,14 +7,14 @@ PROJECT {{#if contextFiles.length}} - + You MUST follow the context files below for all tasks: {{#each contextFiles}} {{content}} {{/each}} - + {{/if}} {{#if agentsMdSearch.files.length}} diff --git a/packages/coding-agent/src/session/snapcompact-inline.ts b/packages/coding-agent/src/session/snapcompact-inline.ts index 7345053c1..0ecac2a60 100644 --- a/packages/coding-agent/src/session/snapcompact-inline.ts +++ b/packages/coding-agent/src/session/snapcompact-inline.ts @@ -85,7 +85,7 @@ interface SystemPromptImageTarget { } const CONTEXT_SECTION_PATTERNS = [ - /\n[\s\S]*?\n<\/context>/g, + /\n[\s\S]*?\n<\/repo-rules>/g, /## Context\n\n[\s\S]*?\n<\/instructions>/g, ] as const; diff --git a/packages/coding-agent/test/snapcompact-inline.test.ts b/packages/coding-agent/test/snapcompact-inline.test.ts index 0a30d61d4..c6ed34c3e 100644 --- a/packages/coding-agent/test/snapcompact-inline.test.ts +++ b/packages/coding-agent/test/snapcompact-inline.test.ts @@ -273,7 +273,7 @@ describe("SnapcompactInlineTransformer", () => { const longContext = denseText(3000); const context: Context = { systemPrompt: [ - `Core instructions.\n\n\nYou MUST follow the context files below for all tasks:\n\n${longContext}\n\n\n\nToday is 2026-06-12.`, + `Core instructions.\n\n\nYou MUST follow the context files below for all tasks:\n\n${longContext}\n\n\n\nToday is 2026-06-12.`, "Final system block.", ], messages: [userMessage("do the thing")],