style: applied biome formatting to merged sources
This commit is contained in:
@@ -944,7 +944,8 @@ async function runLoopBody(
|
||||
// only the matching call is blamed and siblings stay neutral.
|
||||
const scopedAbort = toolScopedAbortReason(signal);
|
||||
const toolCallAbortMessages =
|
||||
message.toolCallAbortMessages ?? (scopedAbort ? buildToolCallAbortMessages(message, scopedAbort) : undefined);
|
||||
message.toolCallAbortMessages ??
|
||||
(scopedAbort ? buildToolCallAbortMessages(message, scopedAbort) : undefined);
|
||||
const toolResults: ToolResultMessage[] = [];
|
||||
for (const toolCall of toolCalls) {
|
||||
const errorMessage = toolCallAbortMessages?.[toolCall.id] ?? message.errorMessage;
|
||||
@@ -1683,7 +1684,6 @@ export function abortReasonText(signal: AbortSignal | undefined): string {
|
||||
return "Request was aborted";
|
||||
}
|
||||
|
||||
|
||||
function emitAbortedAssistantMessage(
|
||||
partialMessage: AssistantMessage | null,
|
||||
addedPartial: boolean,
|
||||
|
||||
@@ -1242,7 +1242,11 @@ const CODEX_STALE_PREVIOUS_RESPONSE_CODES: Record<string, true> = {
|
||||
|
||||
function isCodexStalePreviousResponseError(error: unknown): boolean {
|
||||
if (!(error instanceof Error)) return false;
|
||||
if ("code" in error && typeof error.code === "string" && Object.hasOwn(CODEX_STALE_PREVIOUS_RESPONSE_CODES, error.code)) {
|
||||
if (
|
||||
"code" in error &&
|
||||
typeof error.code === "string" &&
|
||||
Object.hasOwn(CODEX_STALE_PREVIOUS_RESPONSE_CODES, error.code)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
// Message-based fallback for providers/proxies that report the condition
|
||||
|
||||
@@ -2415,7 +2415,9 @@ export class AgentSession {
|
||||
#advisorRuntimeSignature(config: AdvisorConfig, slug: string, model: Model, thinkingLevel: ThinkingLevel): string {
|
||||
const tools = config.tools?.length ? config.tools.join("\u001e") : "";
|
||||
const instructions = config.instructions?.trim() ?? "";
|
||||
return [config.name, slug, formatModelStringWithRouting(model), thinkingLevel, tools, instructions].join("\u001f");
|
||||
return [config.name, slug, formatModelStringWithRouting(model), thinkingLevel, tools, instructions].join(
|
||||
"\u001f",
|
||||
);
|
||||
}
|
||||
|
||||
#advisorRuntimeMatchesCurrentConfig(): boolean {
|
||||
@@ -7397,7 +7399,11 @@ export class AgentSession {
|
||||
timestamp,
|
||||
});
|
||||
}
|
||||
if (this.#magicKeywordEnabled("workflow") && containsWorkflow(text) && this.getActiveToolNames().includes("task")) {
|
||||
if (
|
||||
this.#magicKeywordEnabled("workflow") &&
|
||||
containsWorkflow(text) &&
|
||||
this.getActiveToolNames().includes("task")
|
||||
) {
|
||||
keywordNotices.push({
|
||||
role: "custom",
|
||||
customType: "workflow-notice",
|
||||
|
||||
@@ -389,7 +389,10 @@ export class BashTool implements AgentTool<typeof bashSchemaBase | typeof bashSc
|
||||
hasGrep: isToolActive("grep", this.session.settings.get("grep.enabled")),
|
||||
hasGlob: isToolActive("glob", this.session.settings.get("glob.enabled")),
|
||||
hasRead: isToolActive("read", true),
|
||||
hasEval: isToolActive("eval", evalBackends.python || evalBackends.js || evalBackends.ruby || evalBackends.julia),
|
||||
hasEval: isToolActive(
|
||||
"eval",
|
||||
evalBackends.python || evalBackends.js || evalBackends.ruby || evalBackends.julia,
|
||||
),
|
||||
});
|
||||
}
|
||||
readonly parameters: BashToolSchema;
|
||||
|
||||
@@ -1355,7 +1355,6 @@ describe("AgentSession TTSR resume gate", () => {
|
||||
expect(toolResultText(matchedToolCallContent.id)).toBe("");
|
||||
});
|
||||
|
||||
|
||||
it("relativizes the rule file path in the TTSR interrupt injection (no absolute leak)", async () => {
|
||||
collapseSchedulerSettleDelays();
|
||||
const model = getBundledModel("anthropic", "claude-sonnet-4-5")!;
|
||||
|
||||
@@ -12,8 +12,8 @@ import { AgentSession } from "@oh-my-pi/pi-coding-agent/session/agent-session";
|
||||
import { AuthStorage } from "@oh-my-pi/pi-coding-agent/session/auth-storage";
|
||||
import { SessionManager } from "@oh-my-pi/pi-coding-agent/session/session-manager";
|
||||
import { AUTO_THINKING } from "@oh-my-pi/pi-coding-agent/thinking";
|
||||
import { type } from "arktype";
|
||||
import { removeWithRetries } from "@oh-my-pi/pi-utils";
|
||||
import { type } from "arktype";
|
||||
|
||||
const mockTaskTool: AgentTool = {
|
||||
name: "task",
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { beforeAll, describe, expect, it } from "bun:test";
|
||||
import { initTheme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
||||
import { containsWorkflow, highlightWorkflow, renderWorkflowNotice, WORKFLOW_NOTICE } from "@oh-my-pi/pi-coding-agent/modes/workflow";
|
||||
import {
|
||||
containsWorkflow,
|
||||
highlightWorkflow,
|
||||
renderWorkflowNotice,
|
||||
WORKFLOW_NOTICE,
|
||||
} from "@oh-my-pi/pi-coding-agent/modes/workflow";
|
||||
|
||||
beforeAll(() => {
|
||||
// highlightWorkflow reads the global theme's color mode.
|
||||
|
||||
@@ -2916,7 +2916,8 @@ export class Editor implements Component, Focusable {
|
||||
// rewriting the user's `/tmp` to `/skill:…`.
|
||||
const lowerToken = token.slice(1).toLowerCase();
|
||||
if (scoreCommandTextMatch(lowerToken, item.value.toLowerCase()) > 0) return true;
|
||||
if (item.description && scoreCommandTextMatch(lowerToken, item.description.toLowerCase()) > 0) return true;
|
||||
if (item.description && scoreCommandTextMatch(lowerToken, item.description.toLowerCase()) > 0)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user