Repository navigation
feat(cli): detach a running turn to background with Ctrl-B - #500
Merged
Merged
Conversation
Detach stops waiting without aborting: the running tool settles, the turn ends Detached (durable entry, pc=Final, resumable). Serve and MCP faces added; job_start jobs nudge the session on exit. Refs #217
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What (description of the change)
Background detach for
tole chat(#217): press Ctrl-B during a running turn to detach it into a background job.jobs.rsjob polls the detached pid (one polling thread per job) and appends the final answer into the session file, sotole resume(or anotherchaton the same session) shows the answer plus abackground job <id> finishednote./jobslists running/finished background jobs;/jobs <id>shows a finished job's output; Ctrl-B prints the job id at detach time.chatturn);missionandrununchanged. The busy spinner is replaced by a plain "working (Ctrl-B to detach)" hint line so the keypress is discoverable.Why (the problem you're solving)
Closes #217 — a slow turn blocked the whole REPL; there was no way to keep chatting while it finished.
Testing (how you verified this works)
detach_e2efailed to compile on the missing API (detach_current_turn). GREEN after implementation with a pty-based fixture (script drives a realtole chatwith a slow echo server, sends Ctrl-B, asserts the prompt returns and the answer lands in the session file).chaton the same session during a detached turn is rejected with a clear error (session writer lock).cargo fmt --all -- --checkclean;cargo clippy --workspace --all-targets -- -D warningsclean;cargo test --workspace --no-fail-fast989 passed / 0 failed;cargo test -p tole-core --no-default-features388/0;cargo build -p tole-cli --no-default-featuresok.