mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-11 02:31:38 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7b9c694f7 |
No files matched your search
@@ -1546,12 +1546,6 @@
|
||||
.planCurrent {
|
||||
color: var(--fg);
|
||||
}
|
||||
.trayActivity {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
/* A one-button toolbar, not a round bubble: the popup's large arc would turn it into a circle. */
|
||||
.quotePopup {
|
||||
display: flex;
|
||||
|
||||
@@ -75,7 +75,7 @@ import { ConfigPickers } from "./ConfigPickers";
|
||||
import { findRanges, formatDuration, formatSentAt } from "./conversation";
|
||||
import { ImagePreview, imageSrc } from "./ImagePreview";
|
||||
import { useAgentSettings } from "./agentSettings";
|
||||
import { currentTool, foldedTurns, summarizeWork, workParts, type FoldedTurn, type WorkSummary } from "./timeline";
|
||||
import { foldedTurns, summarizeWork, workParts, type FoldedTurn, type WorkSummary } from "./timeline";
|
||||
import { useRevealedText } from "./reveal";
|
||||
import { AgentReply, MessageActions, ReplyActions } from "./AgentReply";
|
||||
import {
|
||||
@@ -2388,7 +2388,6 @@ function Tray({
|
||||
const added = changes?.reduce((n, c) => n + c.added, 0) ?? 0;
|
||||
const removed = changes?.reduce((n, c) => n + c.removed, 0) ?? 0;
|
||||
const busy = task.status === "running" || task.status === "starting";
|
||||
const tool = entries && busy ? currentTool(entries) : null;
|
||||
const lastUser = entries?.findLast((e): e is UserEntry => e.type === "user");
|
||||
return (
|
||||
<div className={styles.tray}>
|
||||
@@ -2445,10 +2444,6 @@ function Tray({
|
||||
<Spinner size={12} />
|
||||
{task.retry ? (
|
||||
<Retrying retry={task.retry} />
|
||||
) : tool ? (
|
||||
<span className={styles.trayActivity} title={tool.title}>
|
||||
{shortTitle(task, tool.title || tool.kind)}
|
||||
</span>
|
||||
) : (
|
||||
<T>{task.status === "starting" ? "Starting the agent…" : "Working…"}</T>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { AgentEntry } from "@/bindings";
|
||||
import { currentTool, foldedTurns, summarizeWork, workParts } from "./timeline";
|
||||
import { foldedTurns, summarizeWork, workParts } from "./timeline";
|
||||
|
||||
const user = (text: string, extra: Partial<Extract<AgentEntry, { type: "user" }>> = {}): AgentEntry => ({
|
||||
type: "user",
|
||||
@@ -45,11 +45,6 @@ describe("summarizeWork", () => {
|
||||
{ text: "1 other tool call", count: 1 },
|
||||
]);
|
||||
});
|
||||
|
||||
it("finds the call in progress", () => {
|
||||
expect(currentTool([tool("read", { status: "running" }), tool("search")])?.kind).toBe("read");
|
||||
expect(currentTool([tool("read")])).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("foldedTurns", () => {
|
||||
|
||||
@@ -91,15 +91,6 @@ export function workParts(s: WorkSummary): Array<{ text: string; count: number }
|
||||
return parts.filter(([, , n]) => n > 0).map(([one, many, count]) => ({ text: count === 1 ? one : many, count }));
|
||||
}
|
||||
|
||||
/** The running tool call of a run, if any: what the agent is doing right now. */
|
||||
export function currentTool(entries: readonly AgentEntry[]): ToolEntry | null {
|
||||
for (let i = entries.length - 1; i >= 0; i--) {
|
||||
const e = entries[i]!;
|
||||
if (e.type === "tool" && (e.status === "running" || e.status === "pending")) return e;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** A finished turn: the message that asked it at `user`, its work in `[user + 1, reply)`. */
|
||||
export interface FoldedTurn {
|
||||
user: number;
|
||||
|
||||
Reference in new issue
Block a user