Use proper type for Config.McpLocal in MCP resolver #6844

Closed
opened 2026-02-16 18:05:25 -05:00 by yindo · 1 comment
Owner

Originally created by @adolago on GitHub (Jan 19, 2026).

Originally assigned to: @thdxr on GitHub.

Problem

resolveLocalCommand uses Config.McpLocal as a type in packages/agent-core/src/mcp/index.ts, but it is a value (zod schema). This fails typecheck.

Proposed fix

  • Export a type alias for McpLocal in packages/agent-core/src/config/config.ts (e.g., export type McpLocal = z.infer<typeof McpLocal>), or
  • Define a local type alias via z.infer<typeof Config.McpLocal> in mcp/index.ts and use that in resolveLocalCommand.

Acceptance criteria

  • TS2749 is resolved.
  • resolveLocalCommand still accepts the same shape as the config schema.

Test plan

  • bun run typecheck
Originally created by @adolago on GitHub (Jan 19, 2026). Originally assigned to: @thdxr on GitHub. ## Problem `resolveLocalCommand` uses `Config.McpLocal` as a type in `packages/agent-core/src/mcp/index.ts`, but it is a value (zod schema). This fails typecheck. ## Proposed fix - Export a type alias for McpLocal in `packages/agent-core/src/config/config.ts` (e.g., `export type McpLocal = z.infer<typeof McpLocal>`), or - Define a local type alias via `z.infer<typeof Config.McpLocal>` in `mcp/index.ts` and use that in `resolveLocalCommand`. ## Acceptance criteria - TS2749 is resolved. - `resolveLocalCommand` still accepts the same shape as the config schema. ## Test plan - `bun run typecheck`
yindo closed this issue 2026-02-16 18:05:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9481: Type mismatch in dialog-command test where keybind type is generic string instead of proper union
  • #9479: Similar pattern of type incompatibility with external SDK types in message parts
  • #9482: Optional parameter type mismatch in test vs production code
  • #9483: Implicit any type requiring explicit type annotations
  • #9480: TypeScript union type narrowing failure needing discriminant
  • #9477: Return type mismatch where string | undefined doesn't match specific union

All of these appear to be part of the same typecheck fix initiative targeting packages/agent-core/src/.

Feel free to ignore if this is addressing a unique aspect.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #9481: Type mismatch in dialog-command test where keybind type is generic string instead of proper union - #9479: Similar pattern of type incompatibility with external SDK types in message parts - #9482: Optional parameter type mismatch in test vs production code - #9483: Implicit any type requiring explicit type annotations - #9480: TypeScript union type narrowing failure needing discriminant - #9477: Return type mismatch where string | undefined doesn't match specific union All of these appear to be part of the same typecheck fix initiative targeting packages/agent-core/src/. Feel free to ignore if this is addressing a unique aspect.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6844