Skip to content
This repository was archived by the owner on Jul 3, 2026. It is now read-only.
This repository was archived by the owner on Jul 3, 2026. It is now read-only.

Type Safety: 429 any casts need tightening across packages #254

Description

@LaloLalo1999

Summary

The Codex GPT 5.4 multi-model audit (PR #253) found 429 any casts across the codebase. The most common pattern is in CLI Convex commands where ctx.runQuery(api.foo.bar, args) returns any due to untyped FunctionReference usage.

Pattern

// ❌ Current — returns `any`, silently drops type safety
const result = await ctx.runQuery(api.agents.list, { projectId });
// result is `any` — no autocomplete, no compile-time checks

// ✅ Goal — typed FunctionReference approach
import { FunctionReturnType } from 'convex/server';
type AgentList = FunctionReturnType<typeof api.agents.list>;
const result: AgentList = await ctx.runQuery(api.agents.list, { projectId });

Scope

Package Approximate any count
packages/cli/ ~280 (mostly Convex command wrappers)
packages/runtime/ ~90
packages/core/ ~59

How to Contribute

  1. Pick a package or file
  2. Replace any casts with proper types (use FunctionReturnType, explicit interfaces, or generics)
  3. Run pnpm typecheck to verify
  4. Submit a PR scoped to one package or module

Acceptance Criteria

  • any count reduced by at least 50% in targeted files
  • pnpm typecheck passes with 0 errors
  • No runtime behavior changes

Context

Found during the multi-model audit in PR #253 (Claude + Gemini 3 Pro + Codex GPT 5.4).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions