ChatAgent: dead restart-loop breaker + reset_turn_state + partial preservation
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
Bắt đầu với các vị trí được nêu trong chat_agent.ex, initializer.ex và state_machine.ex, lần theo summary/resume_from_summary và đường dẫn compaction của auto_restart_context. Kiểm tra cách pending_messages được khôi phục, cách replacement CLI được theo dõi và dừng lại, cũng như cách các lỗi compaction cập nhật status và ETS. Được xem là hoàn tất khi các message đang chờ trong hàng đợi vẫn tồn tại sau respawn và các lỗi compaction để lại một lỗi đã được lưu persistent với status hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Three smaller ChatAgent correctness gaps.
pending_sends lost on crash-respawn. summary/1 exposes the queue as pending_messages (chat_agent.ex:1655) and it survives into ETS + the agent log, but Initializer.resume_from_summary (initializer.ex:188) never maps it back — struct(Loopyard.ChatAgent, saved) ignores :pending_messages, so pending_sends resets to []. Messages queued while :thinking (the UI promised they'd "send when the agent finishes") silently vanish on GenServer crash → RestartController respawn. Contradicts the "inbox is Loopyard state, a restart doesn't lose messages" durability contract.
auto_restart_context spawns a CLI without track_os_pid. chat_agent.ex:833 — unlike every other spawn site, compaction's start_session never calls SessionManager.track_os_pid/1. tracked_cli_os_pid keeps pointing at the old stopped CLI; the new CLI is untracked and leaks as an orphan if the agent is later brutal-killed. Same site uses a raw linked Task.async for the stop (chat_agent.ex:821) instead of SessionManager.stop_backend.
:compacting status not in the StateMachine. chat_agent.ex:858 — if start_session fails after the :compacting flip, status never resets → UI shows "Compacting" indefinitely; the appended error message is never written to ETS (no :ets.insert) so it vanishes on refresh. :compacting is absent from StateMachine.@states/@transitions (state_machine.ex:49), so removing an agent mid-compaction logs a spurious "invalid transition" warning.
Fix
- Map
pending_messagesback topending_sendsinresume_from_summary. - Call
track_os_pidafterauto_restart_context'sstart_session; useSessionManager.stop_backendfor the stop. - Add
:compactingto the StateMachine graph and reset status + persist the error message on the failure branch.
Acceptance
- Queued messages survive a crash-respawn.
- Compaction failure returns the agent to a real status and shows a persisted error.
- Ngôn ngữ chính
- Elixir
- Star
- 85
- Fork
- 11
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của loopyard/loopyard
-
tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
epic reliability
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
ux
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
epic feature ux
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
ux
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
Tất cả issue của loopyard/loopyard
Issue tương tự
-
Heavy legs 1.12–1.17: compiler corpus goldens not regenerated for #4770Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
intellij-elixir/intellij-elixir#4782 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
hexlet-codebattle/codebattle#2376 ·
-
level 2 wocs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
phravins/QuantumBilling#51 ·
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtimeCó thể đã có người làm @Goldziher đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
carverauto/serviceradar#6898 ·
Maintainer thường phản hồi trong vòng 1 ngày