Skip to content

[feat] Add autopilot input mode#123

Merged
PureWeen merged 2 commits intomainfrom
add-autopilo
Feb 17, 2026
Merged

[feat] Add autopilot input mode#123
PureWeen merged 2 commits intomainfrom
add-autopilo

Conversation

@rmarinho
Copy link
Collaborator

This pull request adds support for per-session input modes (chat, plan, autopilot) in the PolyPilot application. It updates the UI to allow users to select an input mode for each session, persists these modes across sessions, and ensures backward compatibility with previous UI state files. The changes affect both the frontend components and the backend persistence logic, and include comprehensive tests for the new functionality.

UI and UX Improvements:

  • Added an "Autopilot" button alongside "Chat" and "Plan" in the ExpandedSessionView component, allowing users to select the input mode for each session. The active mode is visually highlighted. (PolyPilot/Components/ExpandedSessionView.razor)
  • Changed the mode-handling parameters and event callbacks in ExpandedSessionView from PlanMode (bool) to InputMode (string) and from OnSetPlanMode to OnSetInputMode, supporting the new modes. (PolyPilot/Components/ExpandedSessionView.razor) [1] [2]

State Management and Persistence:

  • Replaced the planModeBySession dictionary with inputModeBySession in the Dashboard component, tracking the input mode for each session as a string. (PolyPilot/Components/Pages/Dashboard.razor)
  • Updated the UI state persistence logic to save and restore the InputModes dictionary, ensuring that input modes are preserved across sessions and application restarts. (PolyPilot/Services/CopilotService.Persistence.cs, PolyPilot/Services/CopilotService.cs) [1] [2] [3]
  • On loading UI state, restored per-session input modes if present, defaulting to "chat" if not specified or invalid. (PolyPilot/Components/Pages/Dashboard.razor)

Behavioral Changes:

  • When dispatching prompts, the prefix ([[PLAN]] or [[AUTOPILOT]]) is now determined by the current input mode for the session, supporting the new "autopilot" mode. (PolyPilot/Components/Pages/Dashboard.razor)
  • Added helper methods for validating and retrieving the current input mode for a session, and for updating the mode and persisting it. (PolyPilot/Components/Pages/Dashboard.razor)

Testing:

  • Added and updated unit tests in UiStatePersistenceTests.cs to verify default values, round-trip serialization/deserialization of InputModes, and correct handling of legacy UI state files without InputModes. (PolyPilot.Tests/UiStatePersistenceTests.cs) [1] [2] [3] [4]

@PureWeen PureWeen merged commit 85581b7 into main Feb 17, 2026
@PureWeen PureWeen deleted the add-autopilo branch February 22, 2026 00:18
PureWeen added a commit that referenced this pull request Feb 26, 2026
…input (#205)

## Summary

Streamlines the session + worktree creation flow, reducing it from a
7-step process to 1-2 clicks.

### Changes

**Foundation: Atomic \CreateSessionWithWorktreeAsync()\ API**
- New method in \CopilotService\ that combines worktree creation,
session creation, linking, group organization, and optional initial
prompt into a single atomic call
- Includes rollback: if session creation fails after worktree was
created, the worktree is cleaned up
- Auto-generates branch names (\session-YYYYMMDD-HHmmss\) when none
specified

**Foundation: \WorktreeId\ on \AgentSessionInfo\**
- Added first-class \WorktreeId\ property to \AgentSessionInfo\
(previously only tracked via path string in \SessionMeta\)
- Enables future features like session restore, branch badge display,
and worktree reattachment

**UX: ⚡ Quick Session button**
- One-click button in repo group context menu (…)
- Auto-generates branch name, creates worktree + session, switches to it
- Zero form interaction needed

**UX: ⑂ New Branch + Session inline input**
- Opens compact input bar below the group header
- Type a branch name (or \#123\ for a PR) → press Enter → done
- Collapses the previous 7-step flow to: click → type → Enter

### Before vs After

| Flow | Before | After |
|------|--------|-------|
| New session from repo | 7 steps (expand form → open worktree picker →
choose mode → enter branch → wait → fill name/model → create) | **1
click** (⚡ Quick Session) or **3 keystrokes** (⑂ → type → Enter) |
| Session-worktree link | Fragile path-string coupling | First-class
\WorktreeId\ on session |
| Failure handling | Orphaned worktrees on partial failure | Automatic
rollback |

### Testing

- Build succeeds ✅
- 1256/1261 tests pass (5 pre-existing failures unrelated to this PR)
- Looking for manual testing feedback on the new UX flows

cc @PureWeen

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants