Skip to content

Flora131/feature/update readme ralph#11

Merged
lavaman131 merged 5 commits intomainfrom
flora131/feature/update-readme-ralph
Nov 12, 2025
Merged

Flora131/feature/update readme ralph#11
lavaman131 merged 5 commits intomainfrom
flora131/feature/update-readme-ralph

Conversation

@flora131
Copy link
Owner

No description provided.

@lavaman131 lavaman131 merged commit 97a8741 into main Nov 12, 2025
lavaman131 pushed a commit that referenced this pull request Feb 15, 2026
- Add 29 tests covering all reducer functions and utilities
- Test all built-in reducers: replace, concat, merge, mergeById, max, min, sum, or, and, ifDefined
- Cover annotation factory, getDefaultValue, applyReducer
- Test state initialization and updates with reducers
- Include edge cases: empty arrays, null/undefined, factory functions
- Verify state independence and partial updates
- Fix TypeScript type errors with proper type annotations
- All tests pass with 64% function coverage

Related to Task #11
lavaman131 pushed a commit that referenced this pull request Feb 18, 2026
When ESC or Ctrl+C interrupts a streaming workflow, set workflowCleaningUpRef
to true before setting wasInterruptedRef. This prevents user messages from
racing with Ralph's async cleanup.

Changes:
- Added workflowState.workflowActive guard in 4 interrupt handlers:
  1. Ctrl+C during streaming (line 3982)
  2. Ctrl+C with running agents (line 4062)
  3. ESC during streaming (line 4225)
  4. ESC with running agents (line 4299)

The cleanup ref will be cleared when stateUpdate with workflowActive=false
is processed (handled by task #11).

Completes task #9 from workflow d700a82c
Related to #219
lavaman131 pushed a commit that referenced this pull request Feb 18, 2026
Implements task #16 - queue drain unit tests per spec §8.2

Added comprehensive unit tests for queue drain logic that triggers when
Ralph's workflow completes:

Test Coverage:
- Drain triggers on workflow transition from active to inactive
- Queue must have pending messages for drain to occur
- cleaningUp flag is cleared when drain occurs
- Messages are drained in FIFO order
- Various edge cases (empty queue, never active, etc.)

Implementation:
- Created src/ui/chat.queue-drain.test.ts following existing patterns
- Extracted queue drain decision logic into testable function
- 12 comprehensive test cases covering all scenarios
- All tests pass (1345 total, 0 failures)

Related Implementation:
- Queue drain logic in chat.tsx lines 3651-3659
- Triggered by stateUpdate.workflowActive === false
- Works with workflowCleaningUpRef from tasks #9 and #11
lavaman131 pushed a commit that referenced this pull request Feb 18, 2026
…y (task #11)

Added 15 new unit tests across 3 test files to fill gaps in coverage for:

1. Background message linkage preservation (Task #8):
   - 5 tests in chat.completion-parity.test.ts
   - Verifies backgroundAgentMessageIdRef preservation when background agents remain
   - Verifies clearing when no background agents remain
   - Tests interaction with streamingMessageIdRef clearing

2. Lifecycle counter persistence across resets (Tasks #5 + #10):
   - 4 tests in reset-clearing.test.ts
   - Verifies counters persist while maps/refs are cleared
   - Tests reset counter increments correctly
   - Verifies counter independence

3. Terminal gating edge cases (Task #2):
   - 6 tests in parallel-agent-background-lifecycle.test.ts
   - Tests idempotent completion handling
   - Tests rapid successive events
   - Tests validation for unknown/interrupted agents

Test results:
- chat.completion-parity.test.ts: 15 → 20 tests (+5)
- reset-clearing.test.ts: 23 → 27 tests (+4)
- parallel-agent-background-lifecycle.test.ts: 34 → 40 tests (+6)
- All 87 tests passing
- All type checks passing

All tests are deterministic, focused, and fast (~23ms total).
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.

2 participants

Comments