Skip to content

fix(ci): recover interrupted Security Review response bodies - #157651

Merged
joshavant merged 1 commit into
mainfrom
fix/security-review-response-body-recovery
Sep 25, 2026
Merged

joshavant merged 1 commit into
mainfrom
fix/security-review-response-body-recovery

Conversation

@joshavant

@joshavant joshavant commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes Security Review failing immediately when a GitHub API connection ends while its response body is being read. A production review exited with only terminated.

User Impact

Security Review can recover from recognized transient read failures without requiring a manual rerun. Failed body reads also identify the request method and endpoint.

Why This Change Was Made

Response-body reads now participate in the existing GET/HEAD transport retry loop. They share its retry count and original request deadline. Direct writes, cancellation, malformed JSON, oversized responses, and unknown errors remain non-retryable. Permissions and approval policy are unchanged.

Evidence

  • Interrupted-body regression cases fail on the original code and pass with this change.
  • All 80 dependency-guard/API tests pass, covering mixed-failure retry limits, cancellation, write safety, and deadlines. The file completed in 4.49 seconds locally.
  • Another 273 shared-guard tests pass. Repository changed-file checks, typechecking, formatting, and lint pass.
  • Independent review found no actionable issues.
  • The production log does not identify the interrupted endpoint; the reproducible gap was confirmed through the real API request owner with synthetic response streams.

CI results

The main CI run completed. Changed-code tests and both dependency and sensitive-code review statuses passed. No observed CI failure is caused by this PR.

The type-check, lint, and extension package-boundary failures come from an unrelated import in package-update-npm-pack.ts: it imports the unexported type UpdateStepResult from update-runner-types.ts. This is present in the main revision used for the CI merge; this PR does not change either file. The CI gate is red because those checks failed. Example failure.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@joshavant
joshavant marked this pull request as ready for review September 24, 2026 22:47
@joshavant
joshavant requested a review from a team as a code owner September 24, 2026 22:47
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 24, 2026, 6:55 PM ET / 22:55 UTC.

ClawSweeper review

What this changes

Security Review retries recognized interruptions while reading successful GitHub GET or HEAD response bodies and adds regression coverage for retry limits, cancellation, and write safety.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Current main still lets interrupted successful response bodies escape the Security Review read retry. The focused patch addresses that gap, and this review found no concrete correctness defect.

Priority: P2
Reviewed head: 168e3389a50001e8007aa06d211d1811c82efe83

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused and tests the reported boundary and its write-safety limits; independent SecOps review remains required.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The collaborator proof gate does not apply. Synthetic response streams exercise the changed Security Review API helper and show after-fix retry behavior, but the PR supplies no after-fix real-transport trace; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The collaborator proof gate does not apply. Synthetic response streams exercise the changed Security Review API helper and show after-fix retry behavior, but the PR supplies no after-fix real-transport trace; no stored-data contract changes.
Evidence reviewed 8 items Current-main gap: At the fetched main revision, successful response-body parsing remains outside the transport retry catch, so a stream failure does not enter that retry loop.
Introduced repair: The PR moves successful body consumption into the existing request retry catch while retaining the method check, abort check, retry count, and original timeout.
Boundary regression coverage: Synthetic interrupted response streams exercise the API request entry point; added cases cover recovery, the shared retry budget, and non-replay of a write.
Findings None None.
Security None None.

How this fits together

Security Review reads pull request and CI data through a shared GitHub API helper. Parsed responses feed its approval checks and required commit status.

flowchart LR
A[PR and CI events] --> B[Security Review]
B --> C[GitHub API helper]
C --> D{Response read}
D -->|Transient read failure| C
D -->|Parsed data| E[Approval checks]
E --> F[Required commit status]
Loading

Before merge

  • Complete next step (P2) - Obtain the already-requested independent SecOps code-owner approval before merge.
Agent review details

Security

None.

PR surface

Tests +68, Docs +1, Other +2. Total +71 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 108 40 +68
Docs 1 6 5 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 11 9 +2
Total 3 125 54 +71

Review metrics

Metric Value Why it matters
Focused test cost 80 tests in 4.49 seconds locally, author-reported The reported file time is within the repository's five-second target for changed tests.

Technical review

Best possible solution:

Keep the shared GitHub request helper as the retry owner, with bounded read-only replay and fresh authorization checks before status publication.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main reads a successful body outside the retry catch, so an interrupted body escapes it. This read-only review did not execute the failure.

Is this the best way to solve the issue?

Yes. Moving body consumption into the existing request retry loop repairs the owning path without adding another retry mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f06a74363bfd.

Labels

Label changes:

  • add P2: An intermittent Security Review failure can interrupt PR evaluation, with a bounded fix in the existing request helper.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The collaborator proof gate does not apply. Synthetic response streams exercise the changed Security Review API helper and show after-fix retry behavior, but the PR supplies no after-fix real-transport trace; no stored-data contract changes.

Label justifications:

  • P2: An intermittent Security Review failure can interrupt PR evaluation, with a bounded fix in the existing request helper.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The collaborator proof gate does not apply. Synthetic response streams exercise the changed Security Review API helper and show after-fix retry behavior, but the PR supplies no after-fix real-transport trace; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • joshavant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S labels Sep 24, 2026
@joshavant
joshavant merged commit bf6de07 into main Sep 25, 2026
151 of 169 checks passed
@joshavant
joshavant deleted the fix/security-review-response-body-recovery branch September 25, 2026 01:11
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit '05edd36e124dc376f63475256f45e82ec437412c': (30 commits)
  refactor(matrix): reuse bounded direct-room cache insertion (#157775)
  fix: preserve channel-owner revocation across recovery (#157709)
  fix(ci): stop blocking CI during release validation (#157757)
  refactor(tlon): remove unreachable DM summary branches (#157789)
  chore: speed up worktree recovery tests with Bun (#157674)
  fix(sessions): release PR caches when pending viewers leave (#157776)
  refactor(twitch): reuse setup account selection (#157787)
  test: skip empty task ledger resets in cron fixtures (#157767)
  perf: reduce gateway and state test startup (#157711)
  fix: preserve maintenance leases during slow heartbeat renewal (#157696)
  fix(channels): match non-TTY setup advice to registered flags (#157551)
  fix: keep failed update report uploads in the CLI (#156633)
  fix: preserve rejected settings reason when opening config (#157731)
  test(update): load real filesystem dependencies in swap fixture
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* fix(ui): keep Stop available while drafts cannot send

* chore: integrate main fixes for Stop UI validation

* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
* fix(ui): keep Stop available while drafts cannot send

* chore: integrate main fixes for Stop UI validation

* commit '5dae23c843013fce2e0bb80037d232bbabfc70e5': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (openclaw#157652)
  fix(ci): recover interrupted Security Review response bodies (openclaw#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (openclaw#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131)
  refactor(msteams): share stored service URL validation (openclaw#157706)
  fix(codex): honor configured tool PATH in native commands (openclaw#157290)
  refactor(msteams): share approval kind labels (openclaw#157705)
  fix(sessions): keep session results current during cold reads (openclaw#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535)
  refactor(i18n): reuse native branch candidate extraction (openclaw#157636)
  fix(update): preserve recovery files after ownership refusal (openclaw#148890)
  fix(test): prevent late announcements from contaminating registry tests (openclaw#157681)
  fix(e2e): scan full onboarding logs for prompts (openclaw#157624)
  refactor(session-tools): derive contracts from schemas (openclaw#156365)
  refactor(channels): derive config contracts from schemas (openclaw#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689)
  refactor: reuse prepared fixtures in slow core tests (openclaw#157685)
  refactor(codex): reuse marketplace reference selection (openclaw#157621)
  chore(ui): refresh control ui locales (openclaw#157710)
  ...

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant