refactor(packages/coding-agent): reorganized atom LID parsing rules
- Centralized `line-hash.ts` hash regex sources and resolved `atom.lark` via `resolveLarkLidPlaceholders`.
- Expanded `computeLineHash` to emit `>[a-z]` and `[a-z]<` hashes for brace-context anchors.
- Replaced atom/hashline parsers' hard-coded lid regex with shared `HASHLINE_HASH_RE_SRC` and lax counterparts.
- Removed `\\TEXT` continuation handling in atom rewrites and switched multi-line replacements to `+TEXT`.
- Added brace-body insertion warning when `@Lid` on `{`-ending lines inserts at non-body-safe indent.
- Suppressed duplicate auto-rebase warnings and kept unmatched `-`/`+` ranges separate in compact previews.
This commit is contained in:
@@ -225,7 +225,11 @@ export type EditFailureCategory = (typeof EDIT_FAILURE_CATEGORIES)[number];
|
||||
function categorizeEditFailure(error: string, args: unknown): EditFailureCategory {
|
||||
const payload = getEditPayloadFromArgs(args);
|
||||
const hasRangeReplacePayload = /^[1-9]\d*[a-z]{2}\.\.[1-9]\d*[a-z]{2}[ \t]*=/m.test(payload);
|
||||
if (/\\TEXT continuation|range[- ]replacement continuation|LidA\.\.LidB=FIRST_LINE/i.test(error)) {
|
||||
if (
|
||||
/\\TEXT.* (?:continuation|has been removed)|range[- ]replacement continuation|LidA\.\.LidB=FIRST_LINE/i.test(
|
||||
error,
|
||||
)
|
||||
) {
|
||||
return "range-continuation";
|
||||
}
|
||||
if (/unified-diff syntax|\+Lid[=|]|\+[1-9]\d*[a-z]{2}[=|]/i.test(error)) {
|
||||
@@ -1010,7 +1014,6 @@ async function runSingleTask(
|
||||
if (config.editFuzzyThreshold !== undefined)
|
||||
process.env.PI_EDIT_FUZZY_THRESHOLD =
|
||||
config.editFuzzyThreshold === "auto" ? "auto" : String(config.editFuzzyThreshold);
|
||||
process.env.PI_STRICT_EDIT_MODE = "1";
|
||||
process.env.PI_NO_TITLE = "1";
|
||||
|
||||
const useInProcess = config.inProcess !== false;
|
||||
|
||||
Reference in New Issue
Block a user