feat(import): collapse+truncate imported session LastPrompt

main

Commit

computermode2mo ago

Addresses the PR review point that imported sessions stored an un-collapsed, un-truncated prompt in the LastPrompt display field (bloating state JSON and diverging from every other session kind). The full prompt remains in the transcript, which is unchanged and still stored complete per checkpoint.

Moves the shared formatter to session.TruncatePromptForStorage (colocated with State.LastPrompt) so imports and live sessions format it identically, avoiding an agentimport->strategy dependency. Simplifies the import session-state tests with shared helpers and readable session IDs.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com Entire-Checkpoint: 01KX4D9VZ10V46ER1P01XHNS0V

Checkpoints

Fix Imported Sessions Handling in CLI

Claude CodeOpus 4.8
View session
Checkpoint 1