Skip to content

fix(e2e): include Codex thread project id - #130086

Merged
RomneyDa merged 1 commit into
mainfrom
fix/codex-fake-thread-project-id
Aug 26, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/codex-fake-thread-project-id

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Summary

  • return the protocol-required nullable projectId from the shared fake Codex thread/start response
  • preserve a requested project assignment and otherwise emit explicit null
  • cover both mappings at the fixture owner boundary

Root cause

Codex app-server 0.149.1 made Thread.projectId a required nullable response field. OpenClaw's generated schema was refreshed in b68c136, but scripts/e2e/lib/codex-app-server-fixture.mjs kept emitting the prior fake Thread shape. Runtime validation therefore rejected the fake thread/start response before repo-E2E Codex auth and approval scenarios could reach turn/start.

Upstream contract inspected directly:

  • ../codex/codex-rs/app-server-protocol/src/protocol/v2/thread_data.rs:196 defines the Thread; its project_id uses a required nullable schema.
  • ../codex/codex-rs/app-server-protocol/src/protocol/v2/thread.rs:59 defines optional ThreadStartParams.project_id, so the response must preserve a supplied value or explicitly return null.

The sibling fake app servers all consume this shared builder; no duplicate Thread response builder required a parallel repair.

Proof

Pre-fix validator reproduction:

Error: Invalid Codex app-server thread/start response: /thread must have required properties projectId

Passing:

node scripts/run-vitest.mjs --config test/vitest/vitest.tooling.config.ts test/scripts/codex-app-server-fixture.test.ts
Test Files  1 passed (1)
Tests  2 passed (2)

check-changed passed all focused formatting, dependency, conflict-marker, coercion, and script guards before reaching the existing checkout-wide type drift in unrelated Matrix, QA Lab, Google provider, Markdown, TUI, and UI dependencies.

Autoreview: clean, no accepted/actionable findings.

Test audit

The new test protects the independently generated app-server response contract and fails on the exact pre-fix omission. Existing protocol-validator tests build their own canonical response and therefore could not catch drift in this shared repo-E2E fixture. The test needs no production-only seam and covers both nullable and supplied project assignments in one table.

Scope / LOC

  • tooling production: +1 / -0
  • tests: +18 / -0
  • no protocol, generated schema, timeout, retry, model, or mock-boundary changes

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Aug 26, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 8:05 AM ET / 12:05 UTC.

ClawSweeper review

What this changes

The PR makes the shared fake Codex app-server return a nullable thread project ID and adds coverage for null and supplied request values.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for maintainer verification. Current main requires thread.projectId while the shared fake omits it, and the patch repairs that owner boundary; however, the required direct sibling-Codex contract check is blocked because ../codex is absent and GitHub DNS is unavailable. The maintainer label also prevents automated cleanup.

Priority: P2
Reviewed head: b8e0df699ba0a77dfc78a2b24ad0ff84d50a3327

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is small and locally source-backed, but direct verification of the upstream Codex contract remains unavailable.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its focused terminal test transcript remains useful supplemental evidence.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its focused terminal test transcript remains useful supplemental evidence.
Evidence reviewed 6 items Current-main mismatch: Current main’s shared fake thread/start response omits projectId, so the reported missing-field behavior remains unfixed on main.
Pinned protocol contract: Current main declares projectId optional on thread-start input but required and nullable on the returned Thread; the generated schema’s required list also includes projectId.
Validation boundary: The Codex lifecycle validates the raw thread/start response through the generated schema before using the thread, so a missing required field stops the scenario at the correct boundary.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs --config test/vitest/vitest.tooling.config.ts test/scripts/codex-app-server-fixture.test.ts

Result: FAIL (failed) — step 1 run node scripts/run-vitest.mjs --config test/vitest/vitest.tooling.config.ts test/scripts/codex-app-server-fixture.test.ts: previous terminal command was still running after 30 seconds: "node scripts/run-vitest.mjs --config test/vitest/vitest.tooling.config.ts test/scripts/codex-app-server-fixture.test.ts"

RUN  v4.1.10 /tmp/clawsweeper-live-proof-130086-P6Zcyt/target

No test files found, exiting with code 1

filter: test/scripts/codex-app-server-fixture.test.ts
include: test/scripts/codex-app-server-fixture.test.ts
exclude:  dist/**, test/fixtures/**, apps/macos/**, apps/macos/.build/**, **/node_modules/**, **/vendor/**, dist/OpenClaw.app/**, **/._*, **/*.live.test.ts, **/
*.e2e.test.ts, test/scripts/codex-app-server-fixture.test.ts, src/infra/boundary-path.test.ts, src/infra/git-root.test.ts, src/infra/home-dir.test.ts, src/infra
/openclaw-exec-env.test.ts, src/infra/openclaw-root.test.ts, src/infra/package-json.test.ts, src/infra/path-env.test.ts, src/infra/stable-node-path.test.ts, tes
t/extension-import-boundaries.test.ts, test/extension-test-boundary.test.ts, test/plugin-extension-import-boundary.test.ts, test/scripts/docker-build-helper.tes
t.ts, test/scripts/docker-e2e-update-suppression.test.ts, test/plugins/bundled-provider-auth-literal-parity.test.ts, test/plugins/bundled-provider-auth-literal-
parity.2.test.ts, test/plugins/bundled-provider-auth-literal-parity.3.test.ts, test/scripts/check-extension-package-tsc-boundary.test.ts, test/scripts/check-plu
gin-sdk-wildcard-reexports.test.ts, test/scripts/control-ui-i18n.test.ts, test/scripts/openclaw-e2e-instance.test.ts

[vitest] FAILED (exit 1)
[test] FAILED (exit 1)

Assertions:

  • FAIL expect_output: Tests 2 passed

How this fits together

OpenClaw’s Codex integration starts a thread through the Codex app-server, then validates the returned JSON against its pinned protocol schema before starting a turn. QA auth, native approval, and media-path E2E fixtures reuse one fake thread-response builder.

flowchart LR
  A[QA and media E2E scenarios] --> B[Shared fake Codex server]
  B --> C[thread/start request]
  C --> D[Fake thread response builder]
  D --> E[Codex response validator]
  E --> F[Thread start]
  F --> G[Auth approval or media scenario]
Loading

Before merge

  • Resolve merge risk (P1) - The local generated schema supports the repair, but the exact upstream Codex 0.149.1 source contract could not be directly inspected in this environment; verify that a supplied project assignment is the intended response mapping before merge.
  • Complete next step (P2) - A direct upstream Codex source read is required before merge, but the sibling checkout and network path are unavailable; no code repair beyond this PR is identified.
Agent review details

Security

None.

PR surface

Tests +18, Other +1. Total +19 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 18 0 +18
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 2 19 0 +19

Review metrics

Metric Value Why it matters
Production versus test LOC tooling +1, tests +18 The only production growth is the schema-required response field; the test protects null and supplied mappings at the shared fixture boundary.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Read the exact upstream Codex Thread and ThreadStartParams definitions, then land this shared-builder repair unchanged if they confirm the required nullable response mapping.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Read the exact upstream Codex Thread and ThreadStartParams definitions, then land this shared-builder repair unchanged if they confirm the required nullable response mapping.

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

Yes, source-reproducible: current main requires nullable thread.projectId in the generated schema while its shared fake response omits it. This read-only review did not execute the failing scenario.

Is this the best way to solve the issue?

Unclear pending direct upstream verification: the change is at the correct shared fixture boundary and matches OpenClaw’s generated contract, but the exact Codex source contract could not be inspected.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The mismatch blocks bounded Codex E2E flows but is limited to shared test infrastructure.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its focused terminal test transcript remains useful supplemental evidence.

Label justifications:

  • P2: The mismatch blocks bounded Codex E2E flows but is limited to shared test infrastructure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its focused terminal test transcript remains useful supplemental evidence.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: History records the generated Codex protocol-schema refactor that owns the validator contract this fixture must satisfy. (role: Codex protocol refactor contributor; confidence: high; commits: 8738fe135461, cb16d739cfda; files: extensions/codex/src/app-server/protocol-validators.ts, extensions/codex/src/app-server/protocol-generated/json/v2/CodexAppServerProtocolDefinitions.json)
  • Dallin Romney: A prior merged Codex QA product-proof commit connects this author to the reused QA fixture surface beyond this PR. (role: prior Codex QA fixture contributor; confidence: high; commits: a9dc393f7eb8; files: test/e2e/qa-lab/runtime/codex-auth-app-server.fixture.mjs, scripts/e2e/lib/codex-app-server-fixture.mjs)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Verify the exact upstream Codex Thread and ThreadStartParams definitions before merge.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-26T11:21:44.412Z sha b8e0df6 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority 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. labels Aug 26, 2026
@RomneyDa
RomneyDa merged commit 8ce8085 into main Aug 26, 2026
131 checks passed
@RomneyDa
RomneyDa deleted the fix/codex-fake-thread-project-id branch August 26, 2026 16:59
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XS 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