Skip to content

feat(desktop): mid-turn steer injection and tool-call details in history#3263

Open
JesonChou wants to merge 1 commit into
esengine:main-v2from
JesonChou:fix/session-steer
Open

feat(desktop): mid-turn steer injection and tool-call details in history#3263
JesonChou wants to merge 1 commit into
esengine:main-v2from
JesonChou:fix/session-steer

Conversation

@JesonChou
Copy link
Copy Markdown

Fix two core desktop features:

  1. Model dialogue mid-turn steer: when the model is running, user input is now injected as mid-turn guidance via a steer queue instead of being silently dropped by runGuarded. A runningRef replaces the stale state.running closure in handleSend, and the steer flows through App.Steer -> Controller.Steer -> Agent.Steer into a FIFO queue consumed each iteration of the agent loop, persisted to the session so it remains visible for subsequent API calls. A Steer event confirms delivery to the frontend.

  2. History tool-call details: HistoryMessage now carries ToolName, ToolArgs, ToolOutput, ToolID, and ToolTruncated fields mapped from the provider's tool-call records. The history reducer and HistoryPanel's previewMessagesToItems render tool messages as ToolCard items, so switching between saved sessions shows full tool invocation details.

Changes:

  • internal/event/event.go: add Steer event kind
  • internal/agent/agent.go: add steerQueue, Steer/consumeSteer/ SteerConsumed/clearSteerQueue/steerQueueLen, midTurnSteerPrefix, and steer consumption/peristence in Run loop
  • internal/control/controller.go: add Steer/SteerConsumed methods
  • desktop/app.go: add App.Steer, expand HistoryMessage struct with tool fields, map tool messages in historyMessages via toolCallByID
  • desktop/frontend/src/lib/bridge.ts: add Steer to AppBindings and mock
  • desktop/frontend/src/lib/types.ts: add steer event kind, tool fields to HistoryMessage
  • desktop/frontend/src/lib/useController.ts: add steer callback, update history reducer for tool messages
  • desktop/frontend/src/App.tsx: add runningRef + steer in handleSend
  • desktop/frontend/src/components/HistoryPanel.tsx: update previewMessagesToItems for tool messages

Fix two core desktop features:
1. Model dialogue mid-turn steer: when the model is running, user input
   is now injected as mid-turn guidance via a steer queue instead of
   being silently dropped by runGuarded. A runningRef replaces the stale
   state.running closure in handleSend, and the steer flows through
   App.Steer -> Controller.Steer -> Agent.Steer into a FIFO queue
   consumed each iteration of the agent loop, persisted to the session
   so it remains visible for subsequent API calls. A Steer event
   confirms delivery to the frontend.

2. History tool-call details: HistoryMessage now carries ToolName,
   ToolArgs, ToolOutput, ToolID, and ToolTruncated fields mapped from
   the provider's tool-call records. The history reducer and
   HistoryPanel's previewMessagesToItems render tool messages as
   ToolCard items, so switching between saved sessions shows full
   tool invocation details.

Changes:
- internal/event/event.go: add Steer event kind
- internal/agent/agent.go: add steerQueue, Steer/consumeSteer/
  SteerConsumed/clearSteerQueue/steerQueueLen, midTurnSteerPrefix,
  and steer consumption/peristence in Run loop
- internal/control/controller.go: add Steer/SteerConsumed methods
- desktop/app.go: add App.Steer, expand HistoryMessage struct with
  tool fields, map tool messages in historyMessages via toolCallByID
- desktop/frontend/src/lib/bridge.ts: add Steer to AppBindings and mock
- desktop/frontend/src/lib/types.ts: add steer event kind, tool fields
  to HistoryMessage
- desktop/frontend/src/lib/useController.ts: add steer callback,
  update history reducer for tool messages
- desktop/frontend/src/App.tsx: add runningRef + steer in handleSend
- desktop/frontend/src/components/HistoryPanel.tsx: update
  previewMessagesToItems for tool messages
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 5, 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