@selesai/code 0.5.3 → 0.5.4
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.
|
@@ -193,6 +193,14 @@ test("custom null (cancelled) does not open new session", async () => {
|
|
|
193
193
|
assert.ok(calls.notify.some((n) => /Cancelled/.test(n.msg)));
|
|
194
194
|
});
|
|
195
195
|
|
|
196
|
+
test("empty generated handoff does not open a blank session", async () => {
|
|
197
|
+
const { commands } = createPiHarness();
|
|
198
|
+
const { ctx, calls } = createCtx({ customResult: " " });
|
|
199
|
+
await commands.get("handoff-new")!.handler("goal", ctx);
|
|
200
|
+
assert.equal(calls.newSession, null);
|
|
201
|
+
assert.ok(calls.notify.some((n) => /returned no text/.test(n.msg)));
|
|
202
|
+
});
|
|
203
|
+
|
|
196
204
|
// sanity: DEFAULT_GOAL exported and non-empty (used by handler)
|
|
197
205
|
test("DEFAULT_GOAL is non-empty", () => {
|
|
198
206
|
assert.ok(DEFAULT_GOAL.length > 0);
|
|
@@ -16,7 +16,7 @@ import { complete, type Context } from "@earendil-works/pi-ai/compat";
|
|
|
16
16
|
import type { ExtensionAPI, ExtensionCommandContext, SessionEntry } from "@selesai/code";
|
|
17
17
|
import { BorderedLoader, convertToLlm, serializeConversation } from "@selesai/code";
|
|
18
18
|
|
|
19
|
-
const SYSTEM_PROMPT = `Write a handoff document
|
|
19
|
+
const SYSTEM_PROMPT = `Write a handoff document for a fresh agent to continue the current conversation. Return only the handoff document; do not save a file or describe saving one.
|
|
20
20
|
|
|
21
21
|
Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
|
|
22
22
|
|
|
@@ -147,6 +147,10 @@ async function handoffNew(args: string, ctx: ExtensionCommandContext) {
|
|
|
147
147
|
ctx.ui.notify("Cancelled", "info");
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
+
if (!result.trim()) {
|
|
151
|
+
ctx.ui.notify("Handoff generation returned no text", "error");
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
150
154
|
|
|
151
155
|
// Editor text, NOT a hidden system prompt: the user can edit before submit.
|
|
152
156
|
const newSessionResult = await ctx.newSession({
|