Skip to content

Commit 56101ac

Browse files
style: biome formatting for files committed without it this cycle
Three files landed in earlier commits without biome formatting (import added via tooling that skips the formatter; hand-written test blocks): ctx-recomp.ts, pi-todo-inject.test.ts, embedding-openai.test.ts. Format-only — no behavior change. Fixes the CI Check (plugin/pi-plugin) lint failure. Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>
1 parent f6efe7b commit 56101ac

3 files changed

Lines changed: 46 additions & 14 deletions

File tree

packages/pi-plugin/src/commands/ctx-recomp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
22
import { getCompartments } from "@magic-context/core/features/magic-context/compartment-storage";
33
import type { ContextDatabase } from "@magic-context/core/features/magic-context/storage";
4-
import { clearEmergencyRecovery } from '@magic-context/core/features/magic-context/storage-meta-persisted';
4+
import { clearEmergencyRecovery } from "@magic-context/core/features/magic-context/storage-meta-persisted";
55
import { COMPARTMENT_AGENT_SYSTEM_PROMPT } from "@magic-context/core/hooks/magic-context/compartment-prompt";
66
import { executeContextRecompWithResult } from "@magic-context/core/hooks/magic-context/compartment-runner";
77
import {

packages/pi-plugin/src/pi-todo-inject.test.ts

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ function findOrphanedFunctionCallOutputs(messages: unknown[]): string[] {
3333
const producesOutput = blocks.some(
3434
(b) =>
3535
b?.type === "toolCall" ||
36-
(b?.type === "text" && typeof b.text === "string" && b.text.length > 0),
36+
(b?.type === "text" &&
37+
typeof b.text === "string" &&
38+
b.text.length > 0),
3739
);
3840
if (!producesOutput) continue;
3941
for (const b of blocks) {
@@ -60,15 +62,27 @@ function thinkingToolCall(
6062
return {
6163
role: "assistant",
6264
content: [
63-
{ type: "thinking", thinking: "...", thinkingSignature: `{"id":"rs_${callId}"}` },
64-
{ type: "toolCall", id: `${callId}|fc_${callId}`, name: "read", arguments: {} },
65+
{
66+
type: "thinking",
67+
thinking: "...",
68+
thinkingSignature: `{"id":"rs_${callId}"}`,
69+
},
70+
{
71+
type: "toolCall",
72+
id: `${callId}|fc_${callId}`,
73+
name: "read",
74+
arguments: {},
75+
},
6576
],
6677
responseId,
6778
timestamp,
6879
};
6980
}
7081

71-
function toolResultMsg(callId: string, timestamp: number): Record<string, unknown> {
82+
function toolResultMsg(
83+
callId: string,
84+
timestamp: number,
85+
): Record<string, unknown> {
7286
return {
7387
role: "toolResult",
7488
toolCallId: `${callId}|fc_${callId}`,
@@ -137,22 +151,38 @@ describe("injectSyntheticTodowriteForPi", () => {
137151
try {
138152
const sessionId = "ses-pi-todo-shared-responseid";
139153
const stateJson = JSON.stringify([
140-
{ content: "Refresh PR metadata", status: "in_progress", priority: "high" },
154+
{
155+
content: "Refresh PR metadata",
156+
status: "in_progress",
157+
priority: "high",
158+
},
141159
]);
142160
const callId = computeSyntheticCallId(stateJson);
143-
const sharedResponseId = "resp_040c5c13bbb6f3bc016a2d8705d29c819181a2638024c55a80";
161+
const sharedResponseId =
162+
"resp_040c5c13bbb6f3bc016a2d8705d29c819181a2638024c55a80";
144163

145164
// The latest-assistant inject path anchored to the LAST message
146165
// carrying the shared responseId (the empty reasoning-only segment).
147-
setPersistedTodoSyntheticAnchor(db, sessionId, callId, sharedResponseId, stateJson);
166+
setPersistedTodoSyntheticAnchor(
167+
db,
168+
sessionId,
169+
callId,
170+
sharedResponseId,
171+
stateJson,
172+
);
148173

149174
const messages = [
150175
thinkingToolCall(sharedResponseId, "a1", 1),
151176
toolResultMsg("a1", 1),
152177
thinkingToolCall(sharedResponseId, "a2", 2),
153178
toolResultMsg("a2", 2),
154179
// Trailing reasoning-only segment of the SAME response: empty content.
155-
{ role: "assistant", content: [], responseId: sharedResponseId, timestamp: 3 },
180+
{
181+
role: "assistant",
182+
content: [],
183+
responseId: sharedResponseId,
184+
timestamp: 3,
185+
},
156186
] as Parameters<typeof injectSyntheticTodowriteForPi>[0]["messages"];
157187

158188
injectSyntheticTodowriteForPi({

packages/plugin/src/features/magic-context/memory/embedding-openai.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,13 @@ describe("OpenAICompatibleEmbeddingProvider model-substitution guard", () => {
337337
});
338338

339339
test("accepts when the endpoint omits the model field (cannot compare)", async () => {
340-
fetchSpy.mockImplementation((async () =>
341-
new Response(JSON.stringify({ data: [{ embedding: [0.1, 0.2, 0.3] }] }), {
342-
status: 200,
343-
headers: { "content-type": "application/json" },
344-
})) as FetchLike);
340+
fetchSpy.mockImplementation(
341+
(async () =>
342+
new Response(JSON.stringify({ data: [{ embedding: [0.1, 0.2, 0.3] }] }), {
343+
status: 200,
344+
headers: { "content-type": "application/json" },
345+
})) as FetchLike,
346+
);
345347
const provider = new OpenAICompatibleEmbeddingProvider({
346348
endpoint: "http://127.0.0.1:65535",
347349
model: "any-model",

0 commit comments

Comments
 (0)