mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-11 04:00:38 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user