Files
oh-my-pi/packages/coding-agent/test/core
can1357 848388c1a3 refactor(coding-agent): remove edit-mode autocorrects and unsafe partial JSON unescape
Drop three pieces of well-intentioned-but-fragile string mangling that
were quietly mutating model edit content:

- `maybeAutocorrectEscapedTabIndentation` in both hashline and atom edit
  modes (plus the `PI_HASHLINE_AUTOCORRECT_ESCAPED_TABS` env toggle and
  `isEscapedTabAutocorrectEnabled` helper). Literal `\\t` in edit content
  is now preserved verbatim.

- `maybeWarnSuspiciousUnicodeEscapePlaceholder` and the
  `runHashlinePreflightSanitizers` wrapper. The warning was misleading:
  it flagged `\\uDDDD` as suspicious without distinguishing intentional
  literal text from a likely-malformed escape, and it was the only
  remaining caller.

- The hand-rolled JSON-unescape fallback in
  `decodePartialJsonStringFragment` (renderer.ts). The fallback used
  `String.fromCharCode` (mishandling lone surrogates) and only covered a
  subset of JSON escapes, so the same fragment decoded one way mid-stream
  and a different way after `JSON.parse` succeeded. Now we trim a
  trailing partial `\\u`/odd-backslash escape and surface the raw
  fragment if `JSON.parse` still fails.
2026-04-26 13:05:19 +02:00
..