force fresh session: ↻ new session button + /new-session
bus carries a one-shot AtomicBool armed by POST /api/new-session (or the /new-session slash command). next turn drops --continue, starting a fresh claude session; the flag clears automatically so subsequent turns resume normal behavior. /compact still always uses --continue — compacting a non-existent session is a no-op anyway. per-agent page grows an ↻ new session button next to the cancel-turn one (always visible, amber, confirms before posting since dropping --continue context isn't reversible). slash-command surface picks up /new-session for parity with the button. note row emitted on the live feed both at arm- time and again when the turn actually consumes the flag, so the operator can confirm it landed.
This commit is contained in:
parent
14aa7c7acc
commit
034b4fde10
6 changed files with 102 additions and 6 deletions
|
|
@ -228,6 +228,18 @@ async fn run_claude(
|
|||
mode: ClaudeMode,
|
||||
) -> Result<bool> {
|
||||
let model = bus.model();
|
||||
// /compact must always run against the existing session — otherwise
|
||||
// there's nothing to compact. Only normal turns honor the
|
||||
// operator's "new session" one-shot flag.
|
||||
let resume = match mode {
|
||||
ClaudeMode::Turn => !bus.take_skip_continue(),
|
||||
ClaudeMode::Compact => true,
|
||||
};
|
||||
if !resume {
|
||||
bus.emit(LiveEvent::Note(
|
||||
"fresh session (--continue suppressed for this turn)".into(),
|
||||
));
|
||||
}
|
||||
let mut cmd = Command::new("claude");
|
||||
cmd.arg("--print")
|
||||
.arg("--verbose")
|
||||
|
|
@ -235,9 +247,11 @@ async fn run_claude(
|
|||
.arg("stream-json")
|
||||
.arg("--model")
|
||||
.arg(&model)
|
||||
.arg("--continue")
|
||||
.arg("--settings")
|
||||
.arg(settings);
|
||||
if resume {
|
||||
cmd.arg("--continue");
|
||||
}
|
||||
if let Some(p) = system_prompt {
|
||||
cmd.arg("--system-prompt-file").arg(p);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue