Skip to content

[codex] fix: ignore stale shell reducer events#15

Merged
StiensWout merged 1 commit into
staging/guard-shell-reducer-stale-sequencefrom
codex/fix/guard-shell-reducer-stale-sequence
Jun 22, 2026
Merged

[codex] fix: ignore stale shell reducer events#15
StiensWout merged 1 commit into
staging/guard-shell-reducer-stale-sequencefrom
codex/fix/guard-shell-reducer-stale-sequence

Conversation

@StiensWout

@StiensWout StiensWout commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Guard applyShellStreamEvent against stale or equal sequence events before applying shell deltas.
  • Add a focused reducer regression test for stale/equal project upsert events.

Root cause

The reducer accepted any recognized shell stream event and wrote snapshotSequence: event.sequence. Direct reducer callers could therefore apply replayed or out-of-order events, mutate projects or threads, and lower the snapshot sequence.

Impact

Shared shell state now preserves the existing snapshot when an event sequence is not newer than the current snapshot, keeping replay protection inside the reducer invariant.

Validation

  • PATH="$HOME/.vite-plus/bin:$PATH" vp test packages/client-runtime/src/state/shellReducer.test.ts
  • PATH="$HOME/.vite-plus/bin:$PATH" vp check
  • PATH="$HOME/.vite-plus/bin:$PATH" vp run typecheck

vp check reports the repository existing 20 unrelated lint warnings and no errors.

Co-authored-by: Codex <codex@openai.com>
@StiensWout
StiensWout merged commit 48c3ad4 into staging/guard-shell-reducer-stale-sequence Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant