@saadnvd1/agent-os 0.3.614 → 0.3.616
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -370,7 +370,7 @@ export function ChatPanel({
|
|
|
370
370
|
send(text);
|
|
371
371
|
};
|
|
372
372
|
// A chat past the compact threshold compacts before the next message
|
|
373
|
-
// unless the reader picks "
|
|
373
|
+
// unless the reader picks "Skip once", for that send only.
|
|
374
374
|
const compactTokens = useFreshStartQuery().data?.compactTokens ?? 0;
|
|
375
375
|
const [asIsFor, setAsIsFor] = useState<string | null>(null);
|
|
376
376
|
const asIs = asIsFor === sessionId;
|
|
@@ -692,6 +692,7 @@ export function ChatPanel({
|
|
|
692
692
|
}}
|
|
693
693
|
pending={{
|
|
694
694
|
status: p.status,
|
|
695
|
+
compacting: !!p.compact && !!compacting,
|
|
695
696
|
error: p.error,
|
|
696
697
|
onRetry: () => retrySend(p.id),
|
|
697
698
|
onEdit: () => {
|
|
@@ -50,12 +50,16 @@ describe("AssistantMessage quote action", () => {
|
|
|
50
50
|
|
|
51
51
|
describe("a sent message not in the chat yet", () => {
|
|
52
52
|
const user = { id: "user-c-1", kind: "user", text: "An article" } as never;
|
|
53
|
-
const render = (
|
|
53
|
+
const render = (
|
|
54
|
+
status: "sending" | "accepted" | "failed",
|
|
55
|
+
compacting?: boolean
|
|
56
|
+
) =>
|
|
54
57
|
renderToStaticMarkup(
|
|
55
58
|
createElement(UserMessage, {
|
|
56
59
|
item: user,
|
|
57
60
|
pending: {
|
|
58
61
|
status,
|
|
62
|
+
compacting,
|
|
59
63
|
error: "connection lost",
|
|
60
64
|
onRetry: vi.fn(),
|
|
61
65
|
onEdit: vi.fn(),
|
|
@@ -68,6 +72,9 @@ describe("a sent message not in the chat yet", () => {
|
|
|
68
72
|
expect(render("sending")).toContain("opacity-60");
|
|
69
73
|
expect(render("sending")).toContain("Sending");
|
|
70
74
|
expect(render("accepted")).toContain("Starting the agent");
|
|
75
|
+
expect(render("accepted", true)).toContain("Compacting first");
|
|
76
|
+
expect(render("accepted", true)).not.toContain("Starting the agent");
|
|
77
|
+
expect(render("sending", true)).toContain("Sending");
|
|
71
78
|
});
|
|
72
79
|
|
|
73
80
|
it("says a failed one wasn't sent, with Retry and Edit", () => {
|
|
@@ -98,6 +98,8 @@ const UserText = memo(function UserText({ text }: { text: string }) {
|
|
|
98
98
|
// A sent message not in the chat yet (lib/chat/pending).
|
|
99
99
|
export interface PendingStatus {
|
|
100
100
|
status: PendingSend["status"];
|
|
101
|
+
// The chat is compacting for this send (its real state, not a guess).
|
|
102
|
+
compacting?: boolean;
|
|
101
103
|
error?: string;
|
|
102
104
|
onRetry: () => void;
|
|
103
105
|
onEdit: () => void;
|
|
@@ -141,7 +143,11 @@ function SendStatus({ pending }: { pending: PendingStatus }) {
|
|
|
141
143
|
className="text-muted-foreground status-late flex items-center gap-1.5 font-mono text-[11px]"
|
|
142
144
|
>
|
|
143
145
|
<span className="status-live bg-muted-foreground h-1.5 w-1.5 rounded-full" />
|
|
144
|
-
{pending.status
|
|
146
|
+
{pending.status !== "accepted"
|
|
147
|
+
? "Sending"
|
|
148
|
+
: pending.compacting
|
|
149
|
+
? "Compacting first"
|
|
150
|
+
: "Starting the agent"}
|
|
145
151
|
</div>
|
|
146
152
|
);
|
|
147
153
|
}
|
|
@@ -9,7 +9,7 @@ import { useNow } from "./useNow";
|
|
|
9
9
|
// Above the composer while the chat is due a compaction (lib/chat/stale):
|
|
10
10
|
// its context is past the compact threshold, and maybe its prompt cache has
|
|
11
11
|
// expired too, so the next message would re-read all of it at full price.
|
|
12
|
-
// Send compacts first unless the reader picks "
|
|
12
|
+
// Send compacts first unless the reader picks "Skip once", for that one
|
|
13
13
|
// send only.
|
|
14
14
|
export function StaleChip({
|
|
15
15
|
context,
|
|
@@ -37,7 +37,7 @@ export function StaleChip({
|
|
|
37
37
|
<span className="text-muted-foreground min-w-0 flex-1 truncate">
|
|
38
38
|
{staleLabel(stale)} ·{" "}
|
|
39
39
|
<span className="text-foreground">
|
|
40
|
-
{asIs ? "
|
|
40
|
+
{asIs ? "Next send skips compacting" : "Compacts when you send"}
|
|
41
41
|
</span>
|
|
42
42
|
</span>
|
|
43
43
|
<button
|
|
@@ -49,7 +49,7 @@ export function StaleChip({
|
|
|
49
49
|
asIs && "text-primary"
|
|
50
50
|
)}
|
|
51
51
|
>
|
|
52
|
-
{asIs ? "
|
|
52
|
+
{asIs ? "Undo" : "Skip once"}
|
|
53
53
|
</button>
|
|
54
54
|
</div>
|
|
55
55
|
);
|
package/lib/chat/stale.ts
CHANGED
|
@@ -78,7 +78,7 @@ export function staleLabel(s: Staleness): string {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// Whether the composer's send compacts first: the chip was showing and the
|
|
81
|
-
// reader didn't pick "
|
|
81
|
+
// reader didn't pick "Skip once". A slash command goes as typed.
|
|
82
82
|
export function composerCompacts(
|
|
83
83
|
text: string,
|
|
84
84
|
context: ChatContext | null | undefined,
|