Skip to content

Stream local check output into a bounded diagnostic tail - #1343

Closed
eowca wants to merge 3 commits into
mainfrom
lean178/1194-bounded-check-output-v2
Closed

eowca wants to merge 3 commits into
mainfrom
lean178/1194-bounded-check-output-v2

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #1409, which preserves bounded local stage capture and the raw review-diff behavior from #1353. The replacement received an independent Claude approval. This PR’s final head passed the full local gate before main advanced and introduced a conflict in the subprocess helper.

Refs #1194

Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero primary review by claude on a5e28eeee49201eefc965ca236b88735aa86edbc, 41.7s: approve (0 critical, 0 important, 2 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread tests/test_sandbox.py Outdated
result = sandbox._run_one(make_config(), git_repo, [], command, 1)
assert result.exit_code == sandbox.TIMEOUT_EXIT
assert result.tail.endswith("\nlast available diagnostic\n\n[loopzero] timed out after 1s")
assert len(result.tail.encode()) == 16 * 1024

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Timeout test's 1 s budget could be flaky on a loaded CI host

test_local_stage_timeout_retains_drained_output gives the check 1 s. In that second, prlimit, bash and a fresh sys.executable interpreter all have to start, and the child has to finish both os.write calls before the deadline. On a slow or heavily loaded runner, Python startup alone can take a large share of that second. If the deadline arrives first, the tail has only the timeout marker and the endswith assertion fails, even though production behaviour is correct. Smallest fix: have the child signal readiness, or raise the timeout to a few seconds. signal.pause() keeps the child alive anyway, so a longer timeout only costs wall time.

Comment thread src/loopzero/_proc.py
newlines = min(limit, newlines + len(chunk) - len(content))

try:
with selectors.DefaultSelector() as selector:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Bounded-tail path depends on POSIX pipe selection

_read_output_tail registers a pipe with selectors.DefaultSelector. On Windows that is SelectSelector, which only accepts sockets. Meanwhile run still has a non-POSIX branch (proc.kill()). Today the only caller is the sandbox check runner, which is POSIX-only (bwrap/prlimit), so nothing breaks now. If tail_chars is meant to stay POSIX-only, a short note in the docstring, or an explicit os.name guard next to the existing ValueError, would stop a future caller from hitting an opaque OSError.

Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero delta review by claude on e56e2661d1ff293557c58906f95494718da69f5c, 21.8s: approve (0 critical, 0 important, 0 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant