Skip to content

Type check: 75 TypeScript errors on main, classified into 5 fixable clusters #214

Closed

Description

@prefrontalsys

Summary

npm run check on main (currently @ 502b0f4) reports 75 TypeScript errors across 24 files. They're not blocking the build (vite build still succeeds via Svelte's loose-by-default mode), but they hide real type-drift between $lib/types and its consumers, plus a few missing dependencies. Cleaning them up gets the project to a green tsc --noEmit baseline so future drift is caught immediately.

I ran the classification while touching ModelConfigEditor for #213 — happy to send the fixes if useful. Wanted to surface the picture and check scope/priority before opening 5 PRs that might collide with work-in-progress.

Reproduction

git checkout main
npm install
npm run check 2>&1 | grep -c '^[0-9]\+ ERROR'
# → 75

Classification

I grouped errors by root cause. Each group is independently fixable; numbers are the count contributed to the 75 total.

Group Errors Files Root cause
A. SubAgent / ParsedSubAgent type drift 26 SubAgentForm.svelte (1) Component reads disallowedTools, maxTurns, memory, background, effort, isolation, hooks, mcpServers, initialPrompt — none declared on the SubAgent / ParsedSubAgent interfaces.
B. Containers feature 10 9 Missing DockerStatusType export, Container interface drift (isFavorite, dockerHostId etc. used at call sites but absent on type), missing @xterm/xterm and @xterm/addon-fit deps.
C. Auto-mode settings fields 9 AutoModeEditor.svelte, SettingsAutoModeTab.svelte ClaudeSettings missing disableAutoMode, autoModeEnvironment, autoModeAllow, autoModeSoftDeny.
D. Lucide icon Component<…> mismatch 7 ProjectCard, ProjectList, McpLibrary lucide-svelte types out of sync with current Svelte runes — RefreshCw, ExternalLink, Trash_2, Package, FolderOpen all flagged.
E. Keybindings test: "Input" context 6 keybindingsLibrary.test.ts KeybindingContext union doesn't include "Input" but tests assert it.
F. ModelOverrides setting field 3 ModelOverridesEditor.svelte ClaudeSettings.modelOverrides not declared on the interface.
G. Skill type (SkillType, skillType) 3 markdownParser.ts, skillLibrary.test.ts SkillType not exported; skillType field used in test fixture but absent on CreateSkillRequest.
H. Sessions store rename 2 routes/sessions/+page.svelte selectedSessionSummary + "sessionSummary" prop no longer exist on SessionStoreState / target component.
I. ProjectCard toast variant 1 ProjectCard.svelte "info" not in toast variant union.
J. Spinner verbs test fixture 1 spinnerverbs.test.ts Fixture passes sortOrder, missing from SpinnerVerb.
K. Tauri InvokeArgs mock 1 helpers/invokeMock.ts Tauri tightened InvokeArgs; helper still uses Record<string, unknown>.
L. Sandbox type missing 1 SandboxFilesystemEditor.svelte SandboxFiles* not exported from $lib/types.
M. Subagents selectedProject 1 AgentMemoryPanel.svelte ProjectsState.selectedProject missing — store restructured.

Proposed PR sequence

I'd batch these into ~5 PRs to keep review surface small and reverts cheap if any fix turns out to be wrong about intent:

PR Groups Errors fixed Risk Notes
PR 1 — quick wins C, F, G, I, J, L 18 Low All additive: add missing fields/exports to $lib/types. No behavior change.
PR 2 — SubAgent type drift A 26 Low Extend SubAgent / ParsedSubAgent to match what the form already reads. Largest payoff per PR.
PR 3 — Lucide icon types D 7 Low Bump lucide-svelte to a version aligned with Svelte runes. Smoke-test icon rendering.
PR 4 — test-fixture cleanup E, H, K, M 10 Low Touches test files + a couple of call sites. Aligns fixtures with current types.
PR 5 — containers feature B 10 Med Touches in-progress containers code. Needs more context on intent. Last in line.

Total recoverable: 65 / 75 in PRs 1–4 (low risk). PR 5 deferred until you confirm the containers feature direction.

Offer

Happy to open these one at a time against main, smallest first, each with its own test plan. Will hold off until I hear back — if any of these are already in flight on your end, just say which groups to skip. Also fine to close this if npm run check is intentionally not gating; in that case the only thing worth doing is updating package.json script to make that explicit.

(For context: I noticed this while sending #213. None of those 75 errors are caused by that PR.)

Activity

  1. tylergraydev commented on Apr 30, 2026

    @tylergraydev
    Owner

    Thanks for the careful classification — really helpful framing.

    Greenlight to send PRs 1–4 in order, smallest first:

    • PR 1 (quick wins, groups C/F/G/I/J/L) — go ahead. One thing to double-check on group C: disableAutoMode, autoModeEnvironment, autoModeAllow, autoModeSoftDeny are part of an in-flight Auto Mode settings tab. If those names match what the editor actually reads, just adding them to ClaudeSettings is fine.
    • PR 2 (SubAgent type drift, group A) — yes. Big payoff and the form is effectively the source of truth for the shape.
    • PR 3 (Lucide icon types, group D) — yes, but coordinate with Dependabot Bump lucide-svelte from 0.577.0 to 1.0.1 #180 which bumps lucide-svelte to 1.0.1. If the bump alone fixes the runes mismatch, your PR may collapse into a smoke-test confirming icons still render. Otherwise rebase on top of Bump lucide-svelte from 0.577.0 to 1.0.1 #180 once it lands.
    • PR 4 (test fixture cleanup, groups E/H/K/M) — yes.

    Hold on PR 5 (containers, group B). Containers + docker hosts are still scaffolded — they don't return real data yet. Errors there reflect type drift on a feature that's in flux, so fixing them now would just re-drift when the feature lands. Defer until that work has direction.

    If anything else surfaces while you're in there (ModelOverridesEditor / AttributionEditor have their own state_referenced_locally warnings I noticed during PR #213 testing), feel free to flag separately rather than expand scope.

    Thanks for offering — appreciate it.

  2. tylergraydev commented on May 16, 2026

    @tylergraydev
    Owner

    Status update — 64/75 errors fixed

    Working through the groups from your classification. Net: 75 → 11 errors on main. Every "type drift / missing field / fixture" group is now resolved. What remains is real work that doesn't belong in this issue's scope.

    Merged

    PR Group(s) Errors closed Approach
    #221 C, F, G, I, J, L 22 Additive type fields, plus fixed a spinnerverbs fixture typo (sortOrder → displayOrder) — declined to add a phantom field nothing else reads
    #226 A 26 Added 9 fields to SubAgent / CreateSubAgentRequest and 7 fields to ParsedSubAgent. All match the existing Rust struct and round-tripped data
    #227 H, K 3 Removed dead sessionSummary prop from the call site; widened invokeMock callback to Tauri's InvokeArgs
    #236 E 6 The keybindings tests already pass at runtime — they mock $lib/types to add an Input context. Added one localized Input cast alias in the test instead of adding a phantom value to the production KeybindingContext union
    #180 D 7 Bumped lucide-svelte 0.577 → 1.0.1. The lucide bump dropped the Github brand icon, so I added a small GithubIcon.svelte to replace it. Also loosened ActionMenuItem / EmptyState icon prop type — lucide 1.x still exports icons as the legacy SvelteComponentTyped shape, which never satisfies Svelte 5's strict Component<Props>

    Remaining (11 errors)

    These are not type drift — they're either guarded work or latent bugs:

    • Group B — 10 errors, all in containers/*. The containers feature is scaffolded but returns empty data (per project memory: "Containers, docker hosts, templates are scaffolded but return empty data"). These errors will resolve naturally when the feature is built out — fixing them now would require either mocking real shapes or papering over the unfinished code. Recommend leaving until the feature ships.

    • Group M — 1 error, AgentMemoryPanel.svelte: projectsStore.selectedProject doesn't exist. This isn't drift — ProjectsState has no project-selection concept at all. The panel's projectPath derives from projectsStore.selectedProject?.path ?? null, which currently always evaluates to null — the project-scoped agent memory silently never receives a path. This is a real runtime bug, not a missing field; the fix is a data-flow decision (prop pass-through vs route param) that belongs in its own focused PR.

    Decision

    If you want a green npm run check gate, the next step is to either decide on the AgentMemoryPanel data flow (closes M) and add a containers exclusion or progress that feature (closes B). Otherwise I'd consider this issue effectively resolved and close it — the remaining items are tracked by their natural homes (containers feature work, a focused AgentMemoryPanel fix).

    🤖 Generated with Claude Code

  3. added a commit that references this issue on May 25, 2026
    3432a10
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions