Improve OpenCode identity removal accuracy (#87)
This pull request improves the accuracy of OpenCode identity removal from system prompts. The key changes include: - Changed `OPENCODE_IDENTITY` constant from a full sentence to `OPENCODE_IDENTITY_PREFIX` containing just "You are OpenCode" for more precise matching - Updated `sanitizeSystemText()` to remove entire paragraphs containing the OpenCode identity prefix rather than attempting inline removal - Refactored `prefixToolNames()` to accept a parsed object instead of a JSON string, eliminating redundant parsing logic in `rewriteRequestBody()` - Added IDE configuration files for Biome formatting and a project dictionary - Updated all related tests to use the new prefix-based approach The changeset indicates this is a patch-level change focused on more accurate OpenCode identity removal. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes request-body rewriting and system-prompt sanitization logic, which could affect how prompts/tools are sent to Anthropic and potentially alter downstream behavior if the new matching is too broad or too narrow. > > **Overview** > Improves system-prompt debranding by replacing the exact `OPENCODE_IDENTITY` match with an `OPENCODE_IDENTITY_PREFIX` check and updating `sanitizeSystemText()` to drop *any paragraph* containing that prefix (instead of trying inline removal). > > Refactors `prefixToolNames()` to operate on an already-parsed request object (removing its internal JSON parse/invalid-JSON fallback) and updates `rewriteRequestBody()` to reuse it; tests are adjusted accordingly. Adds a patch changeset and some IDE config files. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ebc03d9e8d07dc17b1346356cf537735482e0166. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
J
Julian Coy committed
e3e1be4aace9d34bda53a99d43b9c72afbf6d6a4
Parent: 16c8b2e
Committed by GitHub <noreply@github.com>
on 4/14/2026, 6:31:19 AM