Commit 00ad31d
committed
v0.56.0 — Eliminate post-response hang: run learn loop and episode extraction asynchronously
After the agent delivers its response, the process was making blocking
LLM calls for skill learning (ExtractSkillsFromConversation +
GenerateSkillWithLLM) and episode extraction (OnSessionEnd), causing
a 2-5 second hang before the process terminated.
Fix: wrap all four post-response LLM operations in goroutines so the
process can exit immediately after delivering the response. These are
best-effort operations — skill auto-save and episode summarization
still happen, but they no longer block termination.
Locations changed:
- cmd/odek/main.go (run): learn loop + session end → goroutines
- cmd/odek/main.go (continueCmd): session end → goroutine
- cmd/odek/repl.go: session end → goroutine
- cmd/odek/main_test.go: sync learn loop tests to async behavior1 parent 22cc8f9 commit 00ad31d
3 files changed
Lines changed: 45 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1071 | 1071 | | |
1072 | 1072 | | |
1073 | 1073 | | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
1074 | 1077 | | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
1078 | 1082 | | |
1079 | 1083 | | |
1080 | 1084 | | |
| 1085 | + | |
1081 | 1086 | | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
| 1087 | + | |
| 1088 | + | |
1086 | 1089 | | |
1087 | | - | |
1088 | | - | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1089 | 1095 | | |
1090 | | - | |
| 1096 | + | |
1091 | 1097 | | |
1092 | 1098 | | |
1093 | 1099 | | |
| |||
2017 | 2023 | | |
2018 | 2024 | | |
2019 | 2025 | | |
| 2026 | + | |
2020 | 2027 | | |
2021 | | - | |
2022 | | - | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
2023 | 2032 | | |
2024 | 2033 | | |
2025 | 2034 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
1394 | 1395 | | |
1395 | 1396 | | |
1396 | 1397 | | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
1397 | 1402 | | |
1398 | 1403 | | |
1399 | 1404 | | |
| |||
1412 | 1417 | | |
1413 | 1418 | | |
1414 | 1419 | | |
1415 | | - | |
| 1420 | + | |
1416 | 1421 | | |
1417 | 1422 | | |
1418 | | - | |
1419 | | - | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1420 | 1428 | | |
| 1429 | + | |
1421 | 1430 | | |
1422 | 1431 | | |
1423 | 1432 | | |
| |||
1459 | 1468 | | |
1460 | 1469 | | |
1461 | 1470 | | |
| 1471 | + | |
| 1472 | + | |
1462 | 1473 | | |
1463 | 1474 | | |
1464 | 1475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
| 274 | + | |
274 | 275 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
| |||
0 commit comments