Skip to content

fix(webui): cancel active turn before deleting sessions - #5357

Open
chengyongru wants to merge 2 commits into
HKUDS:mainfrom
chengyongru:codex/cancel-turn-before-session-delete
Open

fix(webui): cancel active turn before deleting sessions#5357
chengyongru wants to merge 2 commits into
HKUDS:mainfrom
chengyongru:codex/cancel-turn-before-session-delete

Conversation

@chengyongru

Copy link
Copy Markdown
Collaborator

Summary

  • await the existing AgentLoop.discard_session() lifecycle before deleting a WebUI session
  • prevent cancelled turns from restoring and re-saving a session after deletion
  • fail closed when session lifecycle control is unavailable
  • keep deletion token-free: no consolidation or archive runs, and unarchived messages are intentionally discarded

Verification

  • uv run --no-sync pytest tests/agent/test_loop_session_policy.py nanobot/channels/websocket/tests/test_websocket_http_routes.py tests/cli/test_gateway_runtime.py tests/webui/test_gateway_webui_smoke.py -q (112 passed)
  • uv run --no-sync basedpyright (0 errors)
  • focused ruff check (passed)
  • bun run test (1044 passed)
  • bun run build (passed)
  • real gateway + Playwright: create session, delete from sidebar, verify absence after refresh and clean console

@chengyongru chengyongru added bug Something isn't working fix priority: p2 Normal backlog: minor bug, enhancement, docs, cleanup, edge case, or unvalidated proposal. test webui labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working conflict fix priority: p2 Normal backlog: minor bug, enhancement, docs, cleanup, edge case, or unvalidated proposal. test webui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant