style: applied biome formatting to review follow-up changes
This commit is contained in:
@@ -1108,7 +1108,10 @@ export class MCPManager {
|
||||
listResourceTemplates(connection),
|
||||
]);
|
||||
if (templatesResult.status === "rejected") {
|
||||
logger.debug("Failed to list MCP resource templates", { path: `mcp:${name}`, error: templatesResult.reason });
|
||||
logger.debug("Failed to list MCP resource templates", {
|
||||
path: `mcp:${name}`,
|
||||
error: templatesResult.reason,
|
||||
});
|
||||
}
|
||||
if (resourcesResult.status === "rejected") throw resourcesResult.reason;
|
||||
const resources = resourcesResult.value;
|
||||
|
||||
@@ -148,7 +148,11 @@ export class ModelControls {
|
||||
this.#autoResolvedLevel = undefined;
|
||||
this.#thinkingLevel =
|
||||
level === AUTO_THINKING
|
||||
? clampThinkingLevelToCeiling(this.#model, resolveProvisionalAutoLevel(this.#model), this.#thinkingLevelCeiling)
|
||||
? clampThinkingLevelToCeiling(
|
||||
this.#model,
|
||||
resolveProvisionalAutoLevel(this.#model),
|
||||
this.#thinkingLevelCeiling,
|
||||
)
|
||||
: resolveThinkingLevelForModel(
|
||||
this.#model,
|
||||
clampThinkingLevelToCeiling(this.#model, level, this.#thinkingLevelCeiling),
|
||||
|
||||
@@ -28,7 +28,12 @@ import type { RecoveredRetryError } from "../extensibility/shared-events";
|
||||
import emptyStopRetryTemplate from "../prompts/system/empty-stop-retry.md" with { type: "text" };
|
||||
import thinkingLoopRedirectTemplate from "../prompts/system/thinking-loop-redirect.md" with { type: "text" };
|
||||
import unexpectedStopRetryTemplate from "../prompts/system/unexpected-stop-retry.md" with { type: "text" };
|
||||
import { AUTO_THINKING, clampThinkingLevelToCeiling, type ConfiguredThinkingLevel, modelSupportsEffortCeiling } from "../thinking";
|
||||
import {
|
||||
AUTO_THINKING,
|
||||
type ConfiguredThinkingLevel,
|
||||
clampThinkingLevelToCeiling,
|
||||
modelSupportsEffortCeiling,
|
||||
} from "../thinking";
|
||||
import type { AgentSessionEvent } from "./agent-session-events";
|
||||
import type { InitialRetryFallbackState } from "./agent-session-types";
|
||||
import { isEmptyErrorTurn } from "./messages";
|
||||
|
||||
@@ -327,12 +327,7 @@ export function clampThinkingLevelToCeiling(
|
||||
level: ThinkingLevel | undefined,
|
||||
ceiling: Effort | undefined,
|
||||
): ThinkingLevel | undefined {
|
||||
if (
|
||||
ceiling === undefined ||
|
||||
level === undefined ||
|
||||
level === ThinkingLevel.Off ||
|
||||
level === ThinkingLevel.Inherit
|
||||
) {
|
||||
if (ceiling === undefined || level === undefined || level === ThinkingLevel.Off || level === ThinkingLevel.Inherit) {
|
||||
return level;
|
||||
}
|
||||
const maxIndex = THINKING_EFFORTS.indexOf(ceiling);
|
||||
|
||||
@@ -270,8 +270,7 @@ describe("learned-lesson read-back", () => {
|
||||
// Save a new lesson — must not destroy the header or prose, and the
|
||||
// new lesson lands newest-first at the head of the bullet run.
|
||||
await saveLearnedLesson(agentDir, settings.getCwd(), { content: "new lesson" });
|
||||
const expected =
|
||||
"# Project Lessons\n\nRemember these conventions:\n\n- new lesson\n- existing 1\n- existing 2\n";
|
||||
const expected = "# Project Lessons\n\nRemember these conventions:\n\n- new lesson\n- existing 1\n- existing 2\n";
|
||||
expect(await Bun.file(path.join(root, "learned.md")).text()).toBe(expected);
|
||||
// Saving the same lesson again is byte-idempotent: no duplicate entry
|
||||
// and no blank-line growth from the trailing-newline split artifact.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it, vi } from "bun:test";
|
||||
import { logger } from "@oh-my-pi/pi-utils";
|
||||
import type { MCPReconnect } from "@oh-my-pi/pi-coding-agent/mcp/tool-bridge";
|
||||
import {
|
||||
DeferredMCPTool,
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
} from "@oh-my-pi/pi-coding-agent/mcp/tool-bridge";
|
||||
import type { MCPServerConnection, MCPToolCallResult, MCPTransport } from "@oh-my-pi/pi-coding-agent/mcp/types";
|
||||
import { ToolAbortError } from "@oh-my-pi/pi-coding-agent/tools/tool-errors";
|
||||
import { logger } from "@oh-my-pi/pi-utils";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Helpers
|
||||
|
||||
Reference in New Issue
Block a user