Преглед изворни кода

fix(code-runtime-python): drop the now-dead per-line cap check again

The pre-join counter (single unframed line) and the first-frame check
(newline-bearing chunk) reject any frame past FRAME_PARSE_CAP_BYTES before the
join, so every line reaching this loop is within the cap by construction — the
per-line check was dead code and its continue branch could never fire, failing
the per-file 100% coverage gate.
Chinesezjc пре 2 недеља
родитељ
комит
4c3e453080
1 измењених фајлова са 5 додато и 4 уклоњено
  1. 5 4
      packages/code-runtime/code-runtime-python/src/index.ts

+ 5 - 4
packages/code-runtime/code-runtime-python/src/index.ts

@@ -1402,10 +1402,11 @@ export class PythonCodeRuntime extends CodeRuntime {
             buffered = buffered.subarray(newline + 1)
             /* v8 ignore next -- an empty line comes only from a forged `\n\n` write. */
             if (line.length === 0) continue
-            // A later frame in this buffer may still exceed the cap; drop that
-            // single line like any junk frame (the first frame was already
-            // bounded by the check above).
-            if (line.length > FRAME_PARSE_CAP_BYTES) continue
+            // No per-line cap check here: the pre-join counter (single unframed
+            // line) and the first-frame check (newline-bearing chunk) above
+            // reject any frame past FRAME_PARSE_CAP_BYTES before this join, so
+            // every line in this loop is within the cap by construction — a
+            // per-line check would be dead code.
             const text = line.toString('utf8')
             // JSON.parse would silently ROUND an integer token outside the
             // safe range before validation could see it, so a forged frame