Skip to content

fix(chat): preserve unsent new-session drafts - #720

Merged
agegr merged 3 commits into
agegr:mainfrom
Zhangs-11:fix/preserve-new-session-draft
Sep 5, 2026
Merged

fix(chat): preserve unsent new-session drafts#720
agegr merged 3 commits into
agegr:mainfrom
Zhangs-11:fix/preserve-new-session-draft

Conversation

@Zhangs-11

@Zhangs-11 Zhangs-11 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve an unsent new-session draft when navigating to an existing session
  • restore that draft when New is opened again for the same working directory
  • keep fresh active draft keys unique so stale session creation cannot replace the current composer

Drafts continue to use the existing in-memory store. Reloading or reopening Pi Web still clears them.

Demo

An unsent new-session draft survives switching to an existing session

Recorded from commit d4cb9d5dca1878d95c7ac8eb4943a0d2506b93f7 on the PR branch, served from that tree at http://127.0.0.1:30152 with next dev because this repository prohibits running next build during development. The run used a fresh isolated Pi agent directory, workspace, and browser profile with the normal application transport. A real GPT-6-Astra model round created the demonstrated existing session; no fixtures, mock transports, synthetic events, or test-only hooks were used.

Validation

  • npm test — 846 tests passed
  • tsc --noEmit
  • npm run lint
  • git diff --check
  • real browser QA: type an unsent draft, open an existing session, then click New and verify the exact draft is restored

Zhangs-11 and others added 3 commits September 5, 2026 11:33
Park the temporary composer draft before restoring a remembered session, using the selected cwd even when that session belongs to another worktree. Replace draft source assertions with an executable navigation and cleanup regression check for text and images.

Validation: 847 tests pass; tsc --noEmit --incremental false, npm run lint, and git diff --check pass.
Resolve the session-selection dependency conflict while preserving draft parking, project identity updates, search navigation, and terminal panel behavior. Update the navigation regression context for the current panel state.

Validation: 934 tests pass; tsc --noEmit --incremental false, npm run lint, and git diff --cached --check pass.
@agegr
agegr merged commit 77ffe3c into agegr:main Sep 5, 2026
2 checks passed
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