feat: /continue <session-id>: an AI analyzes that session and injects a concise summary message into the current session (does#397
Conversation
9ec323e to
e4a9423
Compare
|
Rebased onto What was broken / what changed on top of the original factory commit
No behavioral changes to the feature itself; diff stays scoped to Build gate — Blacksmith testbox
|
… a concise summary message into the current session (does
e4a9423 to
74a73ef
Compare
`record_session_continuation_if_idle` reserved a bare `ActiveTurn` and then awaited several times before writing to history, but it never re-checked that the reservation was still its own. `spawn_task` -> `abort_all_tasks` -> `take_active_turn` clears the active turn unconditionally, so a user submit landing in that window stole the reservation and the continuation still recorded its assistant recap into a thread with a live turn, returning `Ok(())`. Mirror the sibling helpers: extract the ownership probe both `try_start_turn_if_idle` and `try_start_user_input_turn_if_idle` already perform into `still_holds_reserved_idle_turn`, and call it in the continuation path before any history write. Add a regression test that parks the continuation on the session state lock, steals the reservation the way a concurrent submit does, and asserts the continuation is rejected with history untouched. Also harden the two secondary findings from review: - `session_recap` replays source history with its original roles, so source model output arrives as `assistant` items. Fence the replayed transcript between explicit untrusted-data markers (after truncation, so the markers cannot be dropped) and keep the destination session's recap task as the final instruction. Covered by an adversarial-source-history unit test. - The TUI continuation handler dropped both outcomes when the destination thread was no longer displayed, and logged nothing on failure. Log the outcome in both paths so a failed continuation is never silent.
74a73ef to
ac15909
Compare
|
Addressed the REQUEST_CHANGES review. Rebased onto BLOCKER — reservation theft during
Verified the test fails before the fix — with the re-check removed it fails on SECONDARY 1 — source history replayed at assistant trust
SECONDARY 2 — TUI dropped the continuation outcome
Gate: Blacksmith testbox run against this head, broadened past the previous 23-test filter to the full test set for the touched crates, and with the |
|
Gate: GREEN — Blacksmith testbox run 30147021979,
On the 63 excluded tests. A first full-set run on this head (30146468493) failed on 63 tests. I ran the identical command on Earlier run 30118433296 was against the old head |
Objective
/continue : an AI analyzes that session and injects a concise summary message into the current session (does not switch to it). — Start a goal plan for this task and drive it node by node (required). Investigate the current codewith implementation first and cite file:line. Build and test on remote Blacksmith ONLY (never compile locally). Keep cargo fmt, clippy -D warnings, and prettier clean. Land a PR into hasna/codewith main.
Verification
Run
run_0d95e4d41759· backendcodewith· taskinline🏭 Generated by @hasnaxyz/factory