Commit dafa8ea
Restore agent sessions with the persisted window layout
Windows Terminal already brings a window's tabs back after the window
closes, after Terminal exits, and after Terminal crashes. That restore
stopped at the shell: a pane that was running an agent CLI came back as a
bare prompt, and the tab's agent pane came back empty.
Carry the agent identity in the layout Terminal already persists, so both
come back with it.
* Stamp each tab's shell-pane agent bindings and its agent pane's ACP
session, agent, custom command, view, open state, position and split
size onto the actions GetWindowLayout serializes. Every existing writer
picks them up, including the five-minute WindowEmperor timer that is
what makes a crash recoverable at all.
* Resume a shell pane's agent CLI on startup, gated on PersistedBufferPath
so an agent session id arriving from a `wt` commandline still starts a
normal shell. A resumed pane skips buffer restore because the CLI
replays its own transcript.
* Rebuild the agent pane and replay its conversation through a boot-time
ACP session/load rather than from saved terminal output.
* Record a WSL pane's directory, which is a Linux path and so never passed
IsValidDirectory, through the new IsUsableStartingDirectory.
* Never persist a pre-warmed helper that has no conversation: wta only
projects a session id through TabSession::resumable_session_id once the
conversation is meaningful.
No new storage: this rides state.json and the existing buffer_{guid}.txt
files. Design notes in doc/specs/agent-session-restore.md.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 63377204-36d8-4662-8114-584648f0bcd81 parent fa707a7 commit dafa8ea
47 files changed
Lines changed: 3087 additions & 191 deletions
File tree
- doc/specs
- src
- cascadia
- LocalTests_TerminalApp
- TerminalApp
- TerminalProtocol
- TerminalSettingsModel
- UnitTests_SettingsModel
- WindowsTerminal
- types
- inc
- ut_types
- tools/wta/src
- app_contracts
- app
- cli
- helper
- master
- protocol/acp
- ui
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
0 commit comments