(
State(state): State<Arc<ServerState>>,
Path(id): Path<String>,
Json(req): Json<SetSummaryRequest>,
)
| 624 | } |
| 625 | |
| 626 | async fn set_session_summary( |
| 627 | State(state): State<Arc<ServerState>>, |
| 628 | Path(id): Path<String>, |
| 629 | Json(req): Json<SetSummaryRequest>, |
| 630 | ) -> Result<Json<SessionInfo>> { |
| 631 | let mut sessions = state.sessions.lock().await; |
| 632 | let updated = sessions |
| 633 | .set_summary( |
| 634 | &id, |
| 635 | opencode_session::SessionSummary { |
| 636 | additions: req.additions.unwrap_or(0), |
| 637 | deletions: req.deletions.unwrap_or(0), |
| 638 | files: req.files.unwrap_or(0), |
| 639 | diffs: None, |
| 640 | }, |
| 641 | ) |
| 642 | .ok_or_else(|| ApiError::SessionNotFound(id.clone()))?; |
| 643 | let info = session_to_info(&updated); |
| 644 | drop(sessions); |
| 645 | persist_sessions_if_enabled(&state).await; |
| 646 | Ok(Json(info)) |
| 647 | } |
| 648 | |
| 649 | #[derive(Debug, Deserialize)] |
| 650 | pub struct RevertRequest { |
nothing calls this directly
no test coverage detected