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:09:01 +07:00
parent 993eed0628
commit 0526124fbd
2 changed files with 8 additions and 5 deletions

View File

@@ -498,10 +498,12 @@ export class CodexAgentClient implements AgentClient {
mcpBearerToken,
developerInstructions ?? ""
);
const env = {
...process.env,
...(this.baseOptions.env ?? {}),
};
const env = Object.fromEntries(
Object.entries({
...process.env,
...(this.baseOptions.env ?? {}),
}).filter((entry): entry is [string, string] => entry[1] !== undefined)
);
return {
codex: new Codex({

View File

@@ -215,7 +215,8 @@ async function main() {
const callerAgentId =
typeof callerAgentIdRaw === "string"
? callerAgentIdRaw
: Array.isArray(callerAgentIdRaw)
: Array.isArray(callerAgentIdRaw) &&
typeof callerAgentIdRaw[0] === "string"
? callerAgentIdRaw[0]
: undefined;
transport = await createAgentMcpTransport(callerAgentId);