Skip to content

fix: preserve pending user turn on stream errors#1760

Merged
1 commit merged intonesquena:masterfrom
ai-ag2026:fix/persist-pending-turn-on-stream-error
May 6, 2026
Merged

fix: preserve pending user turn on stream errors#1760
1 commit merged intonesquena:masterfrom
ai-ag2026:fix/persist-pending-turn-on-stream-error

Conversation

@ai-ag2026
Copy link
Copy Markdown
Contributor

Summary

  • preserve the current pending user prompt before stream error paths clear runtime state
  • append the recovered user turn with timestamp/attachments so reload and session reconcile do not make the just-submitted prompt disappear
  • avoid duplicating eager-checkpointed user turns

Test Plan

  • python3 -m py_compile api/streaming.py tests/test_issue1361_cancel_data_loss.py
  • python3 -m pytest tests/test_issue1361_cancel_data_loss.py tests/test_regressions.py -q -> 58 passed, 1 skipped
  • git diff --check
  • added-lines static security scan -> clean

Notes

This covers stream error exits that occur before the normal agent-result merge. In deferred session-save mode, pending_user_message can be the only durable copy of the current user turn; clearing it before adding the error marker loses the prompt on reload/reconcile.

@nesquena-hermes nesquena-hermes closed this pull request by merging all changes into nesquena:master in 2106083 May 6, 2026
iosub pushed a commit to iosub/HERMES-hermes-webui2 that referenced this pull request May 6, 2026
iosub pushed a commit to iosub/HERMES-hermes-webui2 that referenced this pull request May 6, 2026
nesquena#1757, nesquena#1760, nesquena#1761)

Constituent PRs:
- nesquena#1760 (@ai-ag2026) preserve pending user turn on stream errors. Closes nesquena#1361.
- nesquena#1761 (@dso2ng) scope terminal stream cleanup to owner session. Refs nesquena#1694.
  AUTO-FIX applied: restored !INFLIGHT[S.session.session_id] disjunct in
  _setActivePaneIdleIfOwner (regression introduced by helper centralization).
- nesquena#1756 (@ng-technology-llc) isolate profile cookie per webui instance. Closes nesquena#803.
- nesquena#1757 (@skspade) tri-state gateway status (alive: True/False/None).

Tests: 4642 → 4662 collected (+20). 4649 passed, 9 skipped (test-isolation
prong-2 noise), 3 xpassed, 0 failed in 152s.

Pre-release verification:
- All 4 PRs CI-green or rebased clean (nesquena#1757 had stale base; CHANGELOG conflict
  auto-resolved by dropping the PR's redundant entry).
- node -c clean on static/messages.js + static/panels.js.
- 11/11 browser API endpoints PASS.
- Pre-stamp re-fetch: all PR heads match local rebases.
- Opus advisor: SHIP, all 5 verification questions clean, 0 MUST-FIX, 0 SHOULD-FIX.
- Two NICE-TO-HAVE coverage gaps absorbed in-release:
  (1) test_sprint36.py asserts !INFLIGHT[...] disjunct in helper body
  (2) test_issue1361_cancel_data_loss.py adds structural-grep test to pin
      _materialize_pending_user_turn_before_error call sites at error branches.

Closes nesquena#803, nesquena#1361, nesquena#1694.
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