Skip to content

feat(desktop): mid-turn steer, session memory, mode persistence, and desktop UX improvements#3145

Open
JesonChou wants to merge 3 commits into
esengine:main-v2from
JesonChou:feat/desktop
Open

feat(desktop): mid-turn steer, session memory, mode persistence, and desktop UX improvements#3145
JesonChou wants to merge 3 commits into
esengine:main-v2from
JesonChou:feat/desktop

Conversation

@JesonChou
Copy link
Copy Markdown

Summary

Adds mid-turn steer (inject guidance while agent is running), session-scoped
model/mode memory, preview caching, and several desktop UX fixes.

Mid-turn steer

  • Agent FIFO steer queue consumed at iteration boundaries, persisted to session
  • New Steer event kind for frontend confirmation
  • CLI: Enter during running steers (slash/bang/memory commands still rejected)
  • Desktop: wired through bridge → useController → App.tsx with runningRef
  • 8 steer tests covering FIFO, gating, persistence, event emission

Session memory & mode persistence

  • BranchMeta gains PlanMode/Bypass/Model/Preview/Turns fields
  • SaveBranchMetaFlags persists without touching UpdatedAt
  • previewSession reads from .meta cache (O(1) sidebar)
  • SetPlanMode/SetBypass persist to session meta
  • ResumeSession restores saved model and plan/bypass modes
  • Lazy session-path creation (no throwaway empty files on boot)
  • History tool-call cards visible in sidebar and history panel

MCP tools in slash menu

  • plugin.ToolRef type + Host.Tools() method for MCP tool discovery
  • CLI autocomplete lists MCP tools alongside prompts

Desktop UX improvements

Area Change
Sidebar session time shows seconds; grid width auto; blue theme palette
Sessions dedup by display key, async cleanup, 500ms list cache
Pin current session auto-sorts to top
Resume async model switch (UI never blocks)
Theme full color overhaul: 8 theme-style blocks with complete palette
Windows CREATE_NEW_PROCESS_GROUP suppresses child console flashes
Steer runningRef fixes stale closure in handleSend

Verification

Check Status
go build ./internal/...
go test ./internal/agent/... ✅ (8 steer tests)
wails build

JesonChou added 3 commits June 4, 2026 22:25
…ew caching

BranchMeta gains PlanMode/Bypass/Model/Preview/Turns fields;
SaveBranchMetaFlags persists without touching UpdatedAt,
keeping mode/model switches from reordering the session list.
previewSession reads from .meta cache (O(1) sidebar loads).

Agent gains FIFO steer queue consumed at iteration boundaries;
each steer is appended to session, preserving the prefix cache.
New Steer event kind fires on consumption. Controller.Steer/
SteerConsumed delegate to executor.

Controller: SetPlanMode/SetBypass persist to session meta;
lazy session path creation on first turn; gated SessionEnd;
Resume restores saved PlanMode/Bypass from meta; Run path
includes Compose(input) for memory injection.

Includes 8 steer tests (FIFO, gating, persistence, events).
…ion quality

CLI: Enter during running steers instead of ignoring input;
slash/bang/memory commands are rejected; staged indicator
shown above composer. Steer events render as confirm lines.
mcpTools/isMCPToolName/isMCPPromptName for MCP discovery.

Plugin: ToolRef type and Host.Tools() expose MCP tools
from connected servers for slash-menu integration.

Desktop Go: ListSessions 500ms TTL cache + dedup by display key,
async cleanup; ResumeSession checks saved model and switches via
switchToModel, then auto-pins via Current sort; lazy session-path
creation in buildController; HistoryMessage tool-call fields
with toolCallByID mapping; Meta.Plan for frontend mode sync;
SetModel persists model to meta; App.Steer wired to controller.

bridge.ts: Steer(text) binding in AppBindings + mock.
…esume, and steer

Frontend: useController history reducer and HistoryPanel
previewMessagesToItems now render tool messages as ToolCards;
types.ts adds toolName/toolArgs/toolOutput/toolId/toolTruncated
to HistoryMessage. sessionTime shows full date+time with seconds.

Theme: root dark/light mode + 8 theme-style blocks receive full
color palette overhaul (blue accent #7dd3fc, deep-blue surfaces,
clean light neutrals); swatch colors and sidebar grid updated.

Session: ResumeSession auto-pins current session via Current sort;
list cache invalidated on resume and async model switch.

Steer: runningRef (useRef) replaces stale state.running in
handleSend closure, fixing mid-turn steer delivery.

Windows: HideWindow adds CREATE_NEW_PROCESS_GROUP to suppress
child console flashes from MCP/LSP/codegraph subprocesses.
@JesonChou JesonChou requested a review from SivanCola as a code owner June 4, 2026 17:49
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
@JesonChou JesonChou changed the title Feat: mid-turn steer, session memory, mode persistence, and desktop UX improvements feat(desktop): mid-turn steer, session memory, mode persistence, and desktop UX improvements Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant