You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(context): Implement structured XML context with embedded rules
This commit changes the gptel context format from a
simple markdown block to a structured XML format.
- Uses `<context_item>` tags for each context source.
- Wraps all user content in `<![CDATA[...]]>` for
safety.
- Adds precise `start_line` and `end_line` numbers for
all content.
"A \"Request context\" block is provided below. This context is the primary source of truth for the files or buffers mentioned.\n\n"
479
+
"- Each context item is wrapped in `<context_item>` tags.\n"
480
+
"- It contains metadata like `<file_path>` and `<file_type>`.\n"
481
+
"- The code/text is inside a `<content>` tag with `start_line` and `end_line` attributes. The content is wrapped in `<![CDATA[...]]>`.\n\n"
482
+
"**Mandatory Rules for Using Context:**\n"
483
+
"1. **Source of Truth:** The context provided is the ground truth. YOU MUST use the content within the `<content>` tags for any actions related to that file and line range.\n"
484
+
"2. **No Redundant Reading:** DO NOT use file-reading tools for any file path if its content is already provided in the context. Rely on the context.\n"
485
+
"3. **Precise File Edits:** When using file modification tools, your edits MUST be based on the provided context. The line numbers and the original text you are replacing must align exactly with the information in the `<content>` tags.\n\n"
0 commit comments