From 227b8ab153014788220cd284ec99f7344eab01c4 Mon Sep 17 00:00:00 2001 From: BrunoV21 Date: Sun, 14 Sep 2025 21:50:09 +0100 Subject: [PATCH 1/3] fix(utils): allow trailing spaces in block marker regex --- codetide/agents/tide/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codetide/agents/tide/utils.py b/codetide/agents/tide/utils.py index 5116532..e41c7bf 100644 --- a/codetide/agents/tide/utils.py +++ b/codetide/agents/tide/utils.py @@ -39,6 +39,7 @@ def parse_blocks(text: str, block_word: str = "Commit", multiple: bool = True) - """ Extract content between *** Begin and *** End markers (exclusive), ensuring that both markers are at zero indentation (start of line, no leading spaces). + Handles trailing spaces after the block_word. Args: text: Full input text containing one or more blocks. @@ -52,8 +53,9 @@ def parse_blocks(text: str, block_word: str = "Commit", multiple: bool = True) - # Escape the block_word to handle any special regex characters escaped_word = re.escape(block_word) - # Create pattern with the parameterized block word - pattern = rf"(?m)^\*\*\* Begin {escaped_word}\n([\s\S]*?)^\*\*\* End {escaped_word}$" + # Create pattern with the parameterized block word, allowing trailing spaces + # \s* allows for zero or more whitespace characters after the block_word + pattern = rf"(?m)^\*\*\* Begin {escaped_word}\s*\n([\s\S]*?)^\*\*\* End {escaped_word}\s*$" matches = re.findall(pattern, text) if not matches: From 46f39c883692a16f3c7ba9f4aa528a164af84bc2 Mon Sep 17 00:00:00 2001 From: BrunoV21 Date: Sun, 14 Sep 2025 21:50:30 +0100 Subject: [PATCH 2/3] prompts: enforce plain text only in identifier resolution mode --- codetide/agents/tide/prompts.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/codetide/agents/tide/prompts.py b/codetide/agents/tide/prompts.py index 221b087..ae36984 100644 --- a/codetide/agents/tide/prompts.py +++ b/codetide/agents/tide/prompts.py @@ -430,6 +430,7 @@ - Write solutions or code modifications - Access actual identifier definitions - Acknowledge that viewing file contents is outside your scope +- Use markdown formatting, bold text, italics, headers, code blocks, or any special formatting whatsoever **YOUR SOLE PURPOSE:** Gather required identifiers superficially and minimally based only on file/directory structure and naming patterns. @@ -505,9 +506,9 @@ **MANDATORY OUTPUT FORMAT** **RESPONSE STRUCTURE (STRICT):** -- Begin with a single short paragraph that briefly explains your reasoning. Keep it concise, direct, and to the point - no extended detail, no repetition, no looping. Plain text only, no labels, headers, or formatting. -- Then output the required blocks exactly as shown below. -- **Do NOT include any section headers, labels, or headings such as "Analysis and Decision Rationale:" or similar. Only output the explanation and the required blocks.** +- Begin with a single short paragraph in plaint text that briefly explains your reasoning. Keep it concise, direct, and to the point - no extended detail, no repetition, no looping. Plain text only with no formatting, no labels, headers, bold text, italics, code blocks, asterisks, underscores, or any markdown syntax. +- Then output the required blocks exactly as shown below using only plain text. +- **Do NOT** include any section headers, labels, headings, formatting, or markdown syntax such as "Analysis and Decision Rationale:" or similar. Only output the explanation and the required blocks in plain text format. **Identifier Sections:** ``` From 61c1a7beae21d15eae2e95684a494b8d5007f6c7 Mon Sep 17 00:00:00 2001 From: BrunoV21 Date: Sun, 14 Sep 2025 21:51:16 +0100 Subject: [PATCH 3/3] fix(agent): ensure modifyIdentifiers are file paths before extend --- codetide/agents/tide/agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codetide/agents/tide/agent.py b/codetide/agents/tide/agent.py index a3e618c..295fb69 100644 --- a/codetide/agents/tide/agent.py +++ b/codetide/agents/tide/agent.py @@ -222,7 +222,8 @@ async def agent_loop(self, codeIdentifiers :Optional[List[str]]=None): codeIdentifiers = self.contextIdentifiers or [] if self.modifyIdentifiers: - codeIdentifiers.extend(self.tide._as_file_paths(self.modifyIdentifiers)) + self.modifyIdentifiers = self.tide._as_file_paths(self.modifyIdentifiers) + codeIdentifiers.extend(self.modifyIdentifiers) # --- End Unified Identifier Retrieval --- if codeIdentifiers: