diff --git a/packages/pi-coding-agent/src/core/keybindings.ts b/packages/pi-coding-agent/src/core/keybindings.ts index 5367146be..0da23b72e 100644 --- a/packages/pi-coding-agent/src/core/keybindings.ts +++ b/packages/pi-coding-agent/src/core/keybindings.ts @@ -55,12 +55,12 @@ const DEFAULT_APP_KEYBINDINGS: Record = { clear: "ctrl+c", exit: "ctrl+d", suspend: "ctrl+z", - cycleThinkingLevel: "shift+tab", + cycleThinkingLevel: "ctrl+t", cycleModelForward: "ctrl+p", cycleModelBackward: "shift+ctrl+p", selectModel: "ctrl+l", expandTools: "ctrl+o", - toggleThinking: "ctrl+t", + toggleThinking: [], toggleSessionNamedFilter: "ctrl+n", externalEditor: "ctrl+g", followUp: ["alt+enter", "ctrl+enter"], diff --git a/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts b/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts index 27068a724..56bbe6cdd 100644 --- a/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +++ b/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts @@ -673,7 +673,6 @@ export class InteractiveMode { ), hint("selectModel", "to select model"), hint("expandTools", "to expand tools"), - hint("toggleThinking", "to expand thinking"), hint("externalEditor", "for external editor"), rawKeyHint("/", "for commands"), rawKeyHint("!", "to run bash"), diff --git a/src/resources/extensions/sf/steerable-autonomous-extension.js b/src/resources/extensions/sf/steerable-autonomous-extension.js index f744050fa..4938d0432 100644 --- a/src/resources/extensions/sf/steerable-autonomous-extension.js +++ b/src/resources/extensions/sf/steerable-autonomous-extension.js @@ -1,15 +1,20 @@ /** * Steerable Autonomous Extension - Copilot Auto-style controls * - * Provides Shift+Tab interface for steering and asking questions - * during autonomous execution, similar to Copilot Auto. - * Also integrates Ctrl+Y for YOLO mode (bypass git prompts). + * Purpose: provide Shift+Tab for run-control cycling (manual → assisted → + * autonomous) when the session is idle, and for steering/asking questions + * during autonomous execution (Copilot Auto style). Also integrates Ctrl+Y + * for YOLO mode (bypass git prompts). + * + * Consumer: index.js → steerableAutonomousExtension(pi) on every startup. */ import { handleSteerableModeKey, SteerableAutonomousPanel, } from "./steerable-autonomous-panel.js"; +import { WORK_MODES } from "./operating-model.js"; +import { getAutoSession } from "./auto/session.js"; export default function steerableAutonomousExtension(api) { let panel = null; @@ -26,22 +31,34 @@ export default function steerableAutonomousExtension(api) { // Handle key events - Shift+Tab and Ctrl+Y api.registerShortcut("shift+tab", { - description: "Open/close steerable autonomous panel", + description: + "Cycle work mode (chat → plan → build → review → repair → research) or open steerable panel during autonomous", handler: async (event, ctx) => { - if (!isAutonomousActive) { - ctx.ui.notify( - "Autonomous mode not active - use /autonomous to start", - "info", - ); + if (isAutonomousActive) { + // During autonomous execution: toggle steering panel + if (panel) { + panel.hide(); + panel = null; + } else { + panel = new SteerableAutonomousPanel(ctx); + await panel.show(); + } return; } - if (panel) { - panel.hide(); - panel = null; - } else { - panel = new SteerableAutonomousPanel(ctx); - await panel.show(); + // Outside autonomous: cycle work mode + try { + const s = getAutoSession(); + const current = s.getMode().workMode; + const idx = WORK_MODES.indexOf(current); + const next = WORK_MODES[(idx + 1) % WORK_MODES.length]; + s.setMode({ workMode: next }); + ctx.ui.notify(`Work mode: ${current} → ${next}`, "info"); + } catch { + ctx.ui.notify( + "Work mode: use /mode ", + "info", + ); } }, }); @@ -66,7 +83,7 @@ export default function steerableAutonomousExtension(api) { // Handle slash command for panel api.registerCommand("steer", { - description: "Open steerable autonomous panel (Shift+Tab)", + description: "Open steerable autonomous panel (Shift+Tab during autonomous)", handler: async (_, ctx) => { if (!isAutonomousActive) { ctx.ui.notify( @@ -89,7 +106,10 @@ export default function steerableAutonomousExtension(api) { // Listen for autonomous mode changes api.on("autonomous_start", async (_, ctx) => { isAutonomousActive = true; - ctx.ui.notify("🤖 Autonomous mode active - Shift+Tab to steer", "info"); + ctx.ui.notify( + "🤖 Autonomous mode active — Shift+Tab to steer", + "info", + ); }); api.on("autonomous_stop", async (_, ctx) => {