chore(lint): fix no-shadow and no-nested-ternary in server

This commit is contained in:
Mohamed Boudra
2026-04-24 03:10:03 +07:00
parent 32255cef9a
commit 45a6e7545b
3 changed files with 19 additions and 14 deletions

View File

@@ -2630,12 +2630,7 @@ class CodexAppServerAgentSession implements AgentSession {
if (typeof skill?.name !== "string" || typeof skill?.path !== "string") continue;
skills.push({
name: skill.name,
description:
typeof skill.description === "string"
? skill.description
: typeof skill.shortDescription === "string"
? skill.shortDescription
: "Skill",
description: resolveSkillDescription(skill),
path: skill.path,
});
}
@@ -4458,6 +4453,16 @@ export class CodexAppServerAgentClient implements AgentClient {
}
}
function resolveSkillDescription(skill: Record<string, unknown>): string {
if (typeof skill.description === "string") {
return skill.description;
}
if (typeof skill.shortDescription === "string") {
return skill.shortDescription;
}
return "Skill";
}
export const __codexAppServerInternals = {
buildCodexAppServerEnv,
CodexAppServerClient,

View File

@@ -296,10 +296,10 @@ for (const targetProvider of [
});
const format = "audio/pcm;rate=24000;bits=16";
const chunkBytes = 4800; // 100ms @ 24kHz mono PCM16
for (let offset = 0; offset < inputPcm.length; offset += chunkBytes) {
const chunk = inputPcm.subarray(offset, Math.min(inputPcm.length, offset + chunkBytes));
const isLast = offset + chunkBytes >= inputPcm.length;
const CHUNK_SIZE = 4800; // 100ms @ 24kHz mono PCM16
for (let offset = 0; offset < inputPcm.length; offset += CHUNK_SIZE) {
const chunk = inputPcm.subarray(offset, Math.min(inputPcm.length, offset + CHUNK_SIZE));
const isLast = offset + CHUNK_SIZE >= inputPcm.length;
await withTimeout(
ctx.client.sendVoiceAudioChunk(chunk.toString("base64"), format, isLast),
5000,

View File

@@ -694,9 +694,9 @@ describe("runAsyncWorktreeBootstrap", () => {
terminalRecords: StubTerminalRecord[];
repoDir: string;
}): void {
const { createTerminalCalls, terminalRecords, repoDir } = params;
const { createTerminalCalls, terminalRecords, repoDir: testRepoDir } = params;
expect(createTerminalCalls).toHaveLength(1);
expect(createTerminalCalls[0]?.cwd).toBe(repoDir);
expect(createTerminalCalls[0]?.cwd).toBe(testRepoDir);
expect(createTerminalCalls[0]?.name).toBe("api");
expect(terminalRecords[0]?.sentInputs).toEqual(["npm run api\r"]);
expect(createTerminalCalls[0]?.env).not.toHaveProperty("PORT");
@@ -717,9 +717,9 @@ describe("runAsyncWorktreeBootstrap", () => {
createTerminalCalls: CreateTerminalCall[];
repoDir: string;
}): Promise<void> {
const { createTerminalCalls, repoDir } = params;
const { createTerminalCalls, repoDir: testRepoDir } = params;
const plannedPorts = await ensureWorkspaceServicePortPlan({
workspaceId: repoDir,
workspaceId: testRepoDir,
services: [{ scriptName: "api" }, { scriptName: "app-server" }],
allocatePort: async () => {
throw new Error("Peer env test should reuse the existing service port plan");