fix(session): prevented stale /btw branch promotion
- Passed the authorized leaf through the branch executor and revalidated it before rewriting history. - Refused promotion during active turns and bounded post-prompt drains. - Consumed unavailable branch keys while showing pending and refusal state in the panel. Fixes #7474
This commit is contained in:
@@ -250,7 +250,7 @@ export class InputController {
|
||||
this.#btwBranchListenerInstalled = true;
|
||||
this.ctx.ui.addInputListener(data => {
|
||||
if (!matchesKey(data, "b")) return undefined;
|
||||
if (!this.ctx.canBranchBtw()) return undefined;
|
||||
if (!this.ctx.hasActiveBtw()) return undefined;
|
||||
if (this.ctx.ui.getFocused() !== this.ctx.editor) return undefined;
|
||||
if (this.ctx.editor.getText().trim()) return undefined;
|
||||
void this.ctx.handleBtwBranchKey();
|
||||
|
||||
Reference in New Issue
Block a user