Support clear SessionStart source (#17073)

## Motivation

The `SessionStart` hook already receives `startup` and `resume` sources,
but sessions created from `/clear` previously looked like normal startup
sessions. This makes it impossible for hook authors to distinguish
between these with the matcher.

## Summary

- Add `InitialHistory::Cleared` so `/clear`-created sessions can be
distinguished from ordinary startup sessions.
- Add `SessionStartSource::Clear` and wire it through core, app-server
thread start params, and TUI clear-session flow.
- Update app-server protocol schemas, generated TypeScript, docs, and
related tests.


https://github.com/user-attachments/assets/9cae3cb4-41c7-4d06-b34f-966252442e5c
This commit is contained in:
Abhinav
2026-04-10 16:05:21 -07:00
committed by GitHub
parent 87b9275fff
commit 7999b0f60f
17 changed files with 167 additions and 22 deletions

View File

@@ -241,6 +241,7 @@ async fn skills_changed_notification_is_emitted_after_skill_change() -> Result<(
developer_instructions: None,
personality: None,
ephemeral: None,
session_start_source: None,
dynamic_tools: None,
mock_experimental_field: None,
experimental_raw_events: false,