feat: inline user message editing

This commit is contained in:
cogwheel0
2025-09-07 22:37:52 +05:30
parent 679eac4dd6
commit a850a567a1
5 changed files with 224 additions and 119 deletions

View File

@@ -886,10 +886,21 @@ Future<void> regenerateMessage(
// Socket binding for background flows
final socketService = ref.read(socketServiceProvider);
final socketSessionId = socketService?.sessionId;
final bool wantSessionBinding =
String? socketSessionId = socketService?.sessionId;
bool wantSessionBinding =
(socketService?.isConnected == true) &&
(socketSessionId != null && socketSessionId.isNotEmpty);
// When regenerating with tools, make a best-effort to ensure a live socket.
if (!wantSessionBinding && socketService != null) {
try {
final ok = await socketService.ensureConnected();
if (ok) {
socketSessionId = socketService.sessionId;
wantSessionBinding =
socketSessionId != null && socketSessionId.isNotEmpty;
}
} catch (_) {}
}
// Resolve tool servers from user settings (if any)
List<Map<String, dynamic>>? toolServers;