Fix type errors in server code

- Filter undefined values from env record for Codex SDK
- Add string type check for ParsedQs array element

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2025-12-23 23:11:48 +07:00
co-authored by Claude Opus 4.5
parent 993eed0628
commit 0526124fbd
2 changed files with 8 additions and 5 deletions
@@ -498,10 +498,12 @@ export class CodexAgentClient implements AgentClient {
mcpBearerToken, mcpBearerToken,
developerInstructions ?? "" developerInstructions ?? ""
); );
const env = { const env = Object.fromEntries(
...process.env, Object.entries({
...(this.baseOptions.env ?? {}), ...process.env,
}; ...(this.baseOptions.env ?? {}),
}).filter((entry): entry is [string, string] => entry[1] !== undefined)
);
return { return {
codex: new Codex({ codex: new Codex({
+2 -1
View File
@@ -215,7 +215,8 @@ async function main() {
const callerAgentId = const callerAgentId =
typeof callerAgentIdRaw === "string" typeof callerAgentIdRaw === "string"
? callerAgentIdRaw ? callerAgentIdRaw
: Array.isArray(callerAgentIdRaw) : Array.isArray(callerAgentIdRaw) &&
typeof callerAgentIdRaw[0] === "string"
? callerAgentIdRaw[0] ? callerAgentIdRaw[0]
: undefined; : undefined;
transport = await createAgentMcpTransport(callerAgentId); transport = await createAgentMcpTransport(callerAgentId);