Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ› fix(chat): scope restore-to-input to heterogeneous (CC/Codex) agents (#16854)

Arvin Xu7ae9cd37cf37
diff --git a/src/features/Conversation/Messages/User/Actions/index.tsx b/src/features/Conversation/Messages/User/Actions/index.tsx
index 691bb7fdf59..5b8fa86278e 100644
--- a/src/features/Conversation/Messages/User/Actions/index.tsx
+++ b/src/features/Conversation/Messages/User/Actions/index.tsx
@@ -17,7 +17,6 @@ import MessageBranch from '../../components/MessageBranch';
const DEFAULT_BAR: MessageActionSlot[] = ['regenerate', 'edit', 'copy'];
const DEFAULT_MENU: MessageActionSlot[] = [
'edit',
- 'restoreToInput',
'copy',
'branching',
'divider',
diff --git a/src/routes/(main)/agent/features/Conversation/useActionsBarConfig.ts b/src/routes/(main)/agent/features/Conversation/useActionsBarConfig.ts
index 4a7a6025f13..ffbac07c0e8 100644
--- a/src/routes/(main)/agent/features/Conversation/useActionsBarConfig.ts
+++ b/src/routes/(main)/agent/features/Conversation/useActionsBarConfig.ts
@@ -7,13 +7,18 @@ import { useAgentStore } from '@/store/agent';
import { agentSelectors } from '@/store/agent/selectors';
/**
- * Hetero-agent sessions only support copy + delete β€” edit / regenerate /
- * branching / translate / tts / share don't apply because the external
- * runtime owns message lifecycle.
+ * Hetero-agent (Claude Code / Codex) sessions keep the menu minimal β€” copy +
+ * delete β€” because the external runtime owns the assistant message lifecycle
+ * (edit / regenerate / branching / translate / tts / share don't apply).
+ *
+ * The one user-message action that DOES belong here is `restoreToInput`: a long
+ * CLI run that errors out or loses context is exactly when you want to pull the
+ * original prompt (text + attachments) back into the composer to retry. So it
+ * is scoped to the hetero user menu instead of the native-agent default.
*/
const HETERO_USER: { bar: MessageActionSlot[]; menu: MessageActionSlot[] } = {
bar: ['copy'],
- menu: ['copy', 'divider', 'del'],
+ menu: ['restoreToInput', 'copy', 'divider', 'del'],
};
const HETERO_ASSISTANT: { bar: MessageActionSlot[]; menu: MessageActionSlot[] } = {