Skip to content

fix(test): derive neutral history projection state - #139792

Closed
steipete wants to merge 1 commit into
mainfrom
codex/perf51-history-fixture
Closed

steipete wants to merge 1 commit into
mainfrom
codex/perf51-history-fixture

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The core test typecheck fails because one history-pagination fixture still constructs retired projection-state fields. #139715 added the fixture; #139753 later renamed those fields and migrated production callers but missed this test.

Why This Change Was Made

Build the fixture's neutral state through the existing public projectChatDisplayMessagesWithState([]) producer, then override only its deliberately interleaved messages. This removes copied state fields without adding a test helper or changing production code.

User Impact

Restores the test typecheck while retaining the same pagination regression. Runtime behavior does not change. The sequence [1,2,2,3,undefined,4,3,4], one-message limit, full page assertion, cursor and hasMore checks are unchanged. Net test delta is −1 line.

Evidence

The original before-fix gate reports TS2353 at session-history-state.test.ts:398 for streamErrorFallbackPending; that failure is retained. After the fixture repair:

  • The complete history-state test file passed 30/30 tests through the normal wrapper.
  • All 20 normal changed checks passed, including the formerly failing gateway-root test type graph. No checks were skipped.
  • Canonical managed P2 review completed one scoped-clean pass with no findings.
  • git diff --check passed.

This is a necessary main CI repair, not a measured runtime performance claim.

@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 05:35
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 1:38 AM ET / 05:38 UTC.

ClawSweeper review

What this changes

The PR repairs a session-history test fixture by deriving neutral display state from the existing projection function while preserving its pagination assertions.

Merge readiness

✅ Ready for maintainer review

The repair remains necessary on fetched main and preserves the pagination regression without weakening assertions. No actionable patch defects were found; the maintainer-authored, protected PR should remain in the normal landing workflow.

Priority: P3
Reviewed head: c01e73a2746e67f0f139ed3fd6cbbe4b7e1f2422

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable fixture repair with preserved behavioral assertions and reported passing targeted validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored test-only repair with no changed runtime behavior; reported typecheck and focused-test results address its scope.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored test-only repair with no changed runtime behavior; reported typecheck and focused-test results address its scope.
Evidence reviewed 6 items Verified introduced change: The pinned merge-base-to-head diff changes only fixture construction and its import; the message sequence, page limit, complete page assertion, cursor, and hasMore checks remain unchanged.
Fetched main still needs the repair: Fetched main retains streamErrorFallbackPending and streamErrorFallbackRepaired in this fixture, although its projection result contract requires assistantErrorPending and assistantErrorRecoveryObserved.
Canonical neutral-state producer: The public facade exports the existing projection function. Empty input leaves pending and recovery flags false; the fixture overrides only messages afterward. The projection and history production files are identical between fetched main and the reviewed head.
Findings None None.
Security None None.

How this fits together

The Gateway converts stored conversation messages into display history and pages that history using transcript sequence numbers. This test protects pagination when related display rows are interleaved.

flowchart LR
  A[Conversation messages] --> B[Display projection]
  B --> C[Projected rows and state]
  C --> D[History pagination]
  E[Page limit and cursor] --> D
  D --> F[Messages and next cursor]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -1. Total -1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 2 3 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 3 -1

Review metrics

None.

Technical review

Best possible solution:

Keep neutral fixture state tied to its production producer while retaining independent assertions for page contents and cursor behavior.

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

Yes, source inspection establishes that fetched main's fixture supplies retired fields to the current projection result type; the PR also reports the corresponding TS2353 failure. Tests were not rerun during this read-only review.

Is this the best way to solve the issue?

Yes. Reusing the existing neutral-state producer fixes the type mismatch without casts, new helpers, production changes, or weaker pagination assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4681f8d5fede.

Labels

Label changes:

  • add P3: This is a narrow test-fixture maintenance repair with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 supplied repository state identifies a maintainer-authored test-only repair with no changed runtime behavior; reported typecheck and focused-test results address its scope.

Label justifications:

  • P3: This is a narrow test-fixture maintenance repair with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool 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 supplied repository state identifies a maintainer-authored test-only repair with no changed runtime behavior; reported typecheck and focused-test results address its scope.

Evidence

What I checked:

Likely related people:

  • steipete: 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.

fuller-stack-dev added a commit that referenced this pull request Sep 6, 2026
Carry the existing #139792 repair and its merged #139715 test prerequisite.
The neutral projection state comes from the owning helper, so this fixture
works before and after the main-branch field rename in #139753.
No session-first implementation changes.

Co-authored-by: Peter Steinberger <[email protected]>
fuller-stack-dev added a commit that referenced this pull request Sep 6, 2026
Main now contains the fixture correction from #139794. Remove the carried
#139715/#139792 history changes so this branch returns to the previously
reviewed and tested session-first tree, plus the upstream proxy inventory pair.
@vincentkoc

Copy link
Copy Markdown
Member

Already fixed by #139794 in 8a8bfa4. Closing this conflicting alternative.

@vincentkoc vincentkoc closed this Sep 6, 2026
@RomneyDa
RomneyDa deleted the codex/perf51-history-fixture branch October 22, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants