Skip to content

fix(openshell): verify released preview readiness over authenticated WebSocket - #3345

Open
russellb wants to merge 4 commits into
mainfrom
fix/openshell-preview-harness-readiness
Open

russellb wants to merge 4 commits into
mainfrom
fix/openshell-preview-harness-readiness

Conversation

@russellb

@russellb russellb commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

An OpenShell observed-hook GitHub installation preview could release its Codex Harness and serve authenticated WebSocket requests while its revision remained incomplete. Native Codex returns HTTP 400 for ordinary HTTP requests after the held-launch endpoint closes; the readiness checks expected 404.

Both observeHeldRepositoryGitPreview and enrollHarness now require the recorded release acknowledgment and a successful authenticated WebSocket handshake. A receipt alone or a serving socket alone does not admit the Harness. Enrollment does not repeat an acknowledged release.

The regression uses a real loopback HTTP/WebSocket server and the production transport client, with controlled gateway metadata and release state. It covers both refusal cases and successful enrollment. The owning provisioning flow is updated.

Verification

Final source head: bed2f33b6adef58b58d7fdf501388086023882ef, merged with main at 6678e567282a09d2f0fa79046e7aae821c22ee20. The conflict resolution preserves the October 24 ServiceAccount and October 23 readiness changelog entries, along with the readiness paragraph.

  • Focused regression: 1 passed, 0 failed, 0 skipped. It failed against the original readiness implementation before the fix.
  • At the refreshed head, the installed ESLint, full-workspace Prettier check, TypeScript build with test types, workspace-boundary check, flow-document validator, and git diff --check passed. The checks used installed executables directly because pnpm tried to reconcile the stale dependency graph; no dependencies were installed or reconciled.
  • Before the base refresh, fix commit 45023eaf3109f4c8dd2914cc4e09f00a8546b25f was exercised through the regular Agent workflow on disposable local Kubernetes with OpenShell 0.1.5 and a real model. The Agent became ready, completed a model turn, cloned a disposable repository, and pushed an empty commit. Independent GitHub ref readback confirmed the commit; durable audit recorded the receive-pack.

Outstanding validation

Local validation gaps are recorded below; hosted CI is still running:

  • Before the October 26 merge refresh, the full startup integration file reported 111 passed, 4 failed, 1 skipped. The failures are two wrapper-refusal exit-status assertions and their parent tests. These assertion failures were also reproduced on unmodified main at 725e2371e before the base refresh. The skipped native-initializer runtime case requires OCC_TEST_RUNTIME_IMAGE.
  • Documentation checks cannot start because the installed docs dependency graph lacks @sindresorhus/slugify. No dependencies were reconciled during verification. The provisioning flow remains one coherent workflow; its conservative whitespace count is 2,482 words, below the 2,500-word limit, and its dedicated validator passes.

The live result proves the explicitly selected request-hook-observed / github-installation preview. It does not qualify protected git-write or exact-dispatch/response custody.

@clawsweeper

clawsweeper Bot commented Oct 23, 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.

@russellb
russellb marked this pull request as ready for review October 23, 2026 18:59
@russellb
russellb requested a review from a team as a code owner October 23, 2026 18:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-23T19:03:09.522097Z bbce40a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR verifies released OpenShell preview readiness through the existing authenticated WebSocket client instead of requiring HTTP 404.

Example: An acknowledged Codex preview on OpenShell 0.1.5 returns HTTP 400 for ordinary requests and accepts its authenticated WebSocket handshake.

  • Before: The revision remains incomplete because both readiness paths require HTTP 404.
  • After: Both paths recognize the released Harness without sending another release.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, source-supported repair with useful transport-backed coverage and passing head checks; directly inspectable shipped-workflow evidence remains limited.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its real-transport regression supports the changed readiness conditions, while the reported Kubernetes model-turn and Git-push run is narrative evidence without attached live output.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A released, serving Codex preview remains incomplete because ordinary HTTP requests return 400.
Reason: The maintainer-authored repair restores the intended preview lifecycle through existing owners without adding configuration, public APIs, or broader sender guarantees.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: current main still rejects a released preview that returns HTTP 400, and the focused fix preserves acknowledgment and authentication checks without introducing an actionable defect.

Priority: P2
Reviewed head: bbce40a53afd6910f0f1b0409b9a0b76fd86d41c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The body reports a Kubernetes Agent workflow at the earlier fix commit, but supplies no linked live output establishing that workflow at the final head.
Agent review details

How this fits together

Kubernetes Compute uses the OpenShell Sandbox Driver to observe and enroll a dedicated Harness, combining its revision-bound release acknowledgment with service observations before completing preparation.

flowchart TB
  Compute[Kubernetes Compute] --> Driver[OpenShell Sandbox Driver]
  Receipt[Recorded release acknowledgment] --> Driver
  Driver --> Client[Existing authenticated transport]
  Client --> Harness[Codex Harness]
  Harness --> Client
  Driver --> Readiness[Preview readiness]
Loading

Technical review

Best possible solution:

Use the existing authenticated WebSocket check alongside the recorded release acknowledgment in both preview readiness paths.

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

Current-main source deterministically rejects HTTP 400 despite an acknowledged release; the PR reports a failing-before/passing-after regression, but no target code was run during this review.

Is this the best way to solve the issue?

The repair is appropriately scoped: it reuses the same authenticated readiness mechanism already used by harnessStatus and retains the release acknowledgment rather than treating an HTTP status as readiness.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 98785b43abf9.

Provenance checked

  • Preview observation and enrollment keeps the original intent (3115679: The original implementation required a recorded authenticated release acknowledgment so disappearance or refusal of the launch endpoint could not authorize release.)
  • Provisioning flow overview and readiness documentation keeps the original intent (docs: clarify Agent revisions, versions, and limits #2958: The documentation cleanup preserved support limits while clarifying deployment terminology and staying within the length budget; the current edit retains the removed overview boundaries in the execution trace and adds the changed readiness behavior.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Review metrics

Metric Value Why it matters
Focused implementation and regression coverage Production +14/-4 lines; tests +115/-0 lines The production change reuses an existing transport; the larger test covers two independent refusal conditions and successful observation and enrollment.

Labels

Label changes:

  • add P2: A specifically selected OpenShell observed-hook preview can remain incomplete despite a serving Harness; the affected scope is limited.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A specifically selected OpenShell observed-hook preview can remain incomplete despite a serving Harness; the affected scope is limited.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 23, 2026, 3:15 PM ET / 19:15 UTC.

@freeqaz

freeqaz commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Free's clanker here (an AI agent working on Free's behalf). I reviewed this against current main (98785b43a; head bbce40a53, merges cleanly).

Verdict: correct and safe to land as written. No blocking issues. One pre-existing gap next to this change is worth a follow-up, plus three nits.

What I checked

Follow-up (pre-existing, not introduced here)

  • openshell.ts:3338 / :3407: a released preview whose Harness then holds a startup failure never reports it. The launcher runs before login and the first model probe (harness-egress-enrollment.ts:3). If the probe fails after the release, the held-failure server answers both the enrollment GET and the upgrade with 503 (runtime-entrypoints.ts:198). So observeHeldRepositoryGitPreview returns undefined and enroll returns false. incomplete() then reads no failure either, because privateStatusReadback skips provider-fenced OpenShell Harnesses (kubernetes/index.ts:10435), and harnessStatus (which does read the held failure) is never reached. The revision waits until its readiness deadline and fails without the held code (for example MODEL_PROBE_FAILED). Main does the same today (503 !== 404). Possible fix: when previewReleased is true and the handshake fails, read the runtime status path (or reuse harnessStatus) and let a held runtimeFailure through to the normal status read. That could be done here or in a separate PR.

Nits

  1. openshell.ts:3644 says the Driver handshakes first "so a serving app-server never receives a plain request". After a release, both preview paths now send a plain GET to the serving Codex on every pass before they handshake. When previewReleased is already true, consider handshaking first and skipping the GET.
  2. In one pass, enroll handshakes in observeHeldRepositoryGitPreview and again in enrollHarness. If only the second one fails (a Codex blip in between), the pass throws a configuration failure instead of staying pending. This is low-probability, and a pending result would be a little gentler.
  3. Docs: the new sentence says "even when HTTP returns 400", but the code accepts any non-200 answer, so "any non-200 answer (native Codex returns 400)" would match it. The Overview trim also drops facts that don't appear elsewhere in this flow ("without Agent Secret permission", the development workspace-node scoped token). Unless they are covered in another doc, consider keeping one short clause.

This is harness-admission logic in the Sandbox driver, so I'm leaving the merge to a maintainer.

@freeqaz-openai flagging this one for your review.

@freeqaz-openai freeqaz-openai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

GitHub now reports a conflict in this branch. When updating it against main, please keep both changelog entries in docs/flows/openshell-sandbox-provisioning.md (the October 24 ServiceAccount entry and the October 23 readiness entry), along with the readiness paragraph.

The loopback regression also caught the opposite failure from the HTTP 400 case. With an acknowledged release on main at 893ff2a, the unpatched driver reported installed after an HTTP 404 even though the authenticated WebSocket handshake was refused. With this PR’s readiness change applied to that same revision, the 404 case stayed pending and enrollment was refused. The HTTP 400 case with an accepted handshake reported installed and enrolled successfully.

@russellb

Copy link
Copy Markdown
Member Author

@freeqaz-openai ready for another review

This branch has not been deployed

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

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

3 participants