style: tidy imports and formatting

This commit is contained in:
Peter Steinberger
2026-01-03 12:35:09 +00:00
parent 933bee220f
commit 72c0aa63fb
6 changed files with 15 additions and 9 deletions

View File

@@ -164,8 +164,7 @@ export function resolveThinkingDefault(params: {
const configured = params.cfg.agent?.thinkingDefault;
if (configured) return configured;
const candidate = params.catalog?.find(
(entry) =>
entry.provider === params.provider && entry.id === params.model,
(entry) => entry.provider === params.provider && entry.id === params.model,
);
if (candidate?.reasoning) return "low";
return "off";

View File

@@ -21,8 +21,8 @@ vi.mock("../agents/model-catalog.js", () => ({
loadModelCatalog: vi.fn(),
}));
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
import { loadModelCatalog } from "../agents/model-catalog.js";
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
import type { ClawdisConfig } from "../config/config.js";
import * as configModule from "../config/config.js";
import type { RuntimeEnv } from "../runtime.js";

View File

@@ -393,8 +393,9 @@ describe("Nix integration (U3, U5, U9)", () => {
describe("U6: gateway port resolution", () => {
it("uses default when env and config are unset", async () => {
await withEnvOverride({ CLAWDIS_GATEWAY_PORT: undefined }, async () => {
const { DEFAULT_GATEWAY_PORT, resolveGatewayPort } =
await import("./config.js");
const { DEFAULT_GATEWAY_PORT, resolveGatewayPort } = await import(
"./config.js"
);
expect(resolveGatewayPort({})).toBe(DEFAULT_GATEWAY_PORT);
});
});

View File

@@ -18,8 +18,8 @@ vi.mock("../agents/model-catalog.js", () => ({
loadModelCatalog: vi.fn(),
}));
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
import { loadModelCatalog } from "../agents/model-catalog.js";
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
import { runCronIsolatedAgentTurn } from "./isolated-agent.js";
async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {

View File

@@ -3,7 +3,7 @@ import { randomBytes } from "node:crypto";
import {
type ClawdisConfig,
DEFAULT_GATEWAY_PORT,
HooksGmailTailscaleMode,
type HooksGmailTailscaleMode,
resolveGatewayPort,
} from "../config/config.js";

View File

@@ -1,5 +1,8 @@
import { Box, Container, Markdown, Spacer, Text } from "@mariozechner/pi-tui";
import { formatToolDetail, resolveToolDisplay } from "../../agents/tool-display.js";
import {
formatToolDetail,
resolveToolDisplay,
} from "../../agents/tool-display.js";
import { markdownTheme, theme } from "../theme/theme.js";
type ToolResultContent = {
@@ -106,7 +109,10 @@ export class ToolExecutionComponent extends Container {
: theme.toolSuccessBg;
this.box.setBgFn((line) => bg(line));
const display = resolveToolDisplay({ name: this.toolName, args: this.args });
const display = resolveToolDisplay({
name: this.toolName,
args: this.args,
});
const title = `${display.emoji} ${display.label}${this.isPartial ? " (running)" : ""}`;
this.header.setText(theme.toolTitle(theme.bold(title)));