Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(agentic-ide): repair prompt history integration

Ruben Lütkee04a0bce977f
diff --git a/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx b/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx
index 2fe187f07c..ebfd071fac 100644
--- a/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx
+++ b/jarvis/ui/web/frontend/src/components/agentic/AgenticTerminal.tsx
@@ -102,9 +102,9 @@ import {
type PromptDelivery,
} from "./paneSocket";
import { PromptReceipt } from "./PromptReceipt";
+import { PromptHistoryButton } from "./PromptHistoryButton";
/**
-import { PromptHistoryButton } from "./PromptHistoryButton";
* How old a delivery may be and still raise its receipt on a fresh connection.
*
* Only applies to the receipt recovered from the HANDSHAKE — a prompt arriving
@@ -205,8 +205,10 @@ interface AgenticTerminalProps {
* Which subscription this pane runs on ("Work seat"), when that is worth
* saying. Undefined for everyone with a single login — the header must not
* grow a badge that answers a question the user does not have.
- */
+ */
accountLabel?: string | null;
+ /** Number shown beside the pane header's prompt-history icon. */
+ promptCount?: number;
appearance: TerminalAppearance;
fontSize: number;
/** Highlight this pane as the prompt target. */
@@ -216,8 +218,6 @@ interface AgenticTerminalProps {
/** True while this pane fills the whole grid. */
maximized?: boolean;
onToggleMaximize?: () => void;
- /** Number shown beside the pane header's prompt-history icon. */
- promptCount?: number;
/**
* Open another terminal beside or below this one.
*
@@ -281,6 +281,7 @@ export function AgenticTerminal({
recap,
recapDetail,
accountLabel,
+ promptCount = 0,
appearance,
fontSize,
focused = false,
@@ -301,7 +302,6 @@ export function AgenticTerminal({
}: AgenticTerminalProps) {
const containerRef = useRef<HTMLDivElement | null>(null);
// The padded box around the xterm host — the pane's visible inset, kept off
- promptCount = 0,
// the host itself because FitAddon reads the host's border-box. The pane's
// scrollbar overlays this box and measures hover against it.
const scrollRegionRef = useRef<HTMLDivElement | null>(null);
@@ -1113,6 +1113,7 @@ export function AgenticTerminal({
data-testid={`agentic-pane-${name}`}
>
<PaneHeader
+ workspaceId={workspaceId}
dead={visibleStatus === "exited" || visibleStatus === "error"}
onRestart={onRestart}
onArrangeStart={onArrangeStart}
@@ -1122,6 +1123,7 @@ export function AgenticTerminal({
recap={recap}
recapDetail={recapDetail}
accountLabel={accountLabel}
+ promptCount={promptCount}
appearance={appearance}
focused={focused}
maximized={maximized}
@@ -1134,7 +1136,6 @@ export function AgenticTerminal({
{/*
Keep the visual inset OUTSIDE xterm's measured host. FitAddon reads the
host's border-box but does not subtract padding on that host, so putting
- workspaceId={workspaceId}
the inset there made it report one row more than the pane could show.
The last terminal line was consequently clipped after a vertical resize.
@@ -1146,7 +1147,6 @@ export function AgenticTerminal({
className="relative min-h-0 flex-1 overflow-hidden px-1.5 pb-0.5 pt-0.5"
>
<div
- promptCount={promptCount}
ref={containerRef}
data-testid={`agentic-terminal-host-${name}`}
// Read by ./index.css, which anchors the contents to the bottom for
@@ -1238,6 +1238,7 @@ export function AgenticTerminal({
}
function PaneHeader({
+ workspaceId,
name,
displayName,
recap,
@@ -1245,6 +1246,7 @@ function PaneHeader({
recapMeta,
recapActions,
accountLabel,
+ promptCount,
appearance,
focused,
maximized,
@@ -1258,19 +1260,19 @@ function PaneHeader({
onArrangeStart,
arranging = false,
}: {
+ workspaceId?: string;
name: string;
displayName: string;
recap?: string;
recapDetail?: string;
- workspaceId,
recapMeta?: PaneRecapMeta;
recapActions?: PaneRecapActions;
accountLabel?: string | null;
+ promptCount: number;
appearance: TerminalAppearance;
focused: boolean;
maximized: boolean;
onToggleMaximize?: () => void;
- promptCount,
onSplit?: (direction: SplitDirection, agent?: string) => void;
agents?: SplitAgentChoice[];
onClose?: () => void;
@@ -1285,7 +1287,6 @@ function PaneHeader({
const light = appearance === "light";
// Which split button opened the CLI picker, if any.
const [picking, setPicking] = useState<SplitDirection | null>(null);
- workspaceId?: string;
// With one installed CLI there is nothing to pick, so the button splits
// straight away — a menu with a single entry is a click tax, not a choice.
@@ -1293,7 +1294,6 @@ function PaneHeader({
const offersChoice = choices.filter((a) => a.installed).length > 1;
const startSplit = (direction: SplitDirection) => {
- promptCount: number;
if (offersChoice)
setPicking((current) => (current === direction ? null : direction));
else onSplit?.(direction);
@@ -1411,6 +1411,12 @@ function PaneHeader({
Restart
</button>
)}
+ <PromptHistoryButton
+ terminal={name}
+ workspaceId={workspaceId}
+ count={promptCount}
+ light={light}
+ />
<PaneAction
label={maximized ? `Restore ${name}` : `Maximize ${name}`}
testId={`pane-maximize-${name}`}
@@ -1548,12 +1554,6 @@ function SplitAgentMenu({
<span className="shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground">
{agent.kind === "shell" ? "no shell here" : "not installed"}
</span>
- <PromptHistoryButton
- terminal={name}
- workspaceId={workspaceId}
- count={promptCount}
- light={light}
- />
)}
</button>
))}