Skip to content

fix(reefine): recover E2B disconnects and surface failed proposals - #565

Merged
BobbyZhouZijian merged 1 commit into
mainfrom
codex/fix-e2b-disconnect
Sep 21, 2026
Merged

BobbyZhouZijian merged 1 commit into
mainfrom
codex/fix-e2b-disconnect

Conversation

@BobbyZhouZijian

@BobbyZhouZijian BobbyZhouZijian commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

An E2B command stream disconnect currently aborts an already running Reefine proposer, while a failed tunnel transfer can make an incomplete model response look complete. These failures then appear as No changes. Preserve the running command across transient disconnects and show an explicit failure when recovery is exhausted.

Related implementation: #538 and #556. Searched existing E2B issues and PRs; no open duplicate found.

Changes

  • Reconnect to the same E2B process at most twice within its original deadline, without replaying the command; stop an unfinished process before copying its files back.
  • Retry tunnel reply transfers with sequence numbers to prevent duplicate chunks. Use chunk framing so an interrupted response remains an error, including when repeated acknowledgements are lost.
  • Reject partial proposals when pi records a final model-response error even if its process exits successfully.
  • Show Failed and the recorded error on request/release pages and progress responses. Preserve the previously published head and suppress installation instructions for failed steps.

Compatibility and operational impact

No persisted record migration is needed; existing failure records receive the corrected display. The progress API can now report state: failed for a skipped step with a recorded error. The private tunnel protocol is updated on both ends together. E2B remains optional with its existing >=2.46 requirement; its connectrpc dependency is now declared explicitly. Restart the service to load the fix and resubmit failed requests.

Verification

  • 168 related tests passed across E2B, Reefine, release/request pages, harness wrapper, and Cordis floor selection; a final 26-test boundary/page run also passed, covering two additional cases (170 distinct tests total).
  • Full pre-commit run --all-files and python -m mypy passed (321 source files).
  • In the isolated PR checkout, 25 E2B/Reefine tests also passed with the originally locked E2B 2.46.0 SDK, and full pre-commit checks passed again.
  • Full python -m pytest tests/ attempted: collection blocked by missing torch, ray, and slime (13 collection errors, 12 skipped).
  • No live E2B/OpenRouter end-to-end run performed. Transport failures are injected in local HTTP/SDK tests.

AI assistance

OpenAI Codex implemented the fix, regression tests, documentation, and this PR description. The human contributor remains responsible for reviewing and understanding the change.

Checklist

  • The change is focused and contains no unrelated cleanup.
  • Tests cover behavior changes, or this pull request does not change behavior.
  • Public interface changes include contract tests, or no public interface changes are present.
  • Affected user and developer documentation is updated, or no documentation update is required.
  • Root README changes update both languages and README.i18n.yaml, or do not affect README content.
  • An accepted RFC is linked, or this change does not require an RFC.
  • Relevant pre-commit and test checks pass. Focused tests and static checks pass; the full suite needs the training environment noted above.
  • Non-trivial AI assistance is disclosed above, or none was used.

Review and merge

Draft pending review and CI in the supported training environment. Follow the repository's Merge Oncall workflow.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@github-actions github-actions Bot added area: docs User and developer documentation area: harness Harness integration, recipes, and evolution surfaces area: packaging Packages, containers, deployment, and vendored integrations area: service Service APIs, deployment, and command-line interfaces dependencies Dependency and toolchain updates labels Sep 21, 2026
@github-actions

Copy link
Copy Markdown

Merge Oncall: @BobbyZhouZijian

The merge oncall will route reviews and keep this pull request moving toward a clear decision.

@BobbyZhouZijian
BobbyZhouZijian marked this pull request as ready for review September 21, 2026 11:31
@BobbyZhouZijian
BobbyZhouZijian enabled auto-merge (squash) September 21, 2026 11:31
@BobbyZhouZijian
BobbyZhouZijian merged commit 878ad32 into main Sep 21, 2026
30 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs User and developer documentation area: harness Harness integration, recipes, and evolution surfaces area: packaging Packages, containers, deployment, and vendored integrations area: service Service APIs, deployment, and command-line interfaces dependencies Dependency and toolchain updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant