Skip to content

fix(types): close 26 svelte-check errors via SubAgent type drift (#214 PR2)#226

Merged
tylergraydev merged 1 commit into
mainfrom
fix/ts-errors-subagent-drift
May 16, 2026
Merged

fix(types): close 26 svelte-check errors via SubAgent type drift (#214 PR2)#226
tylergraydev merged 1 commit into
mainfrom
fix/ts-errors-subagent-drift

Conversation

@tylergraydev

Copy link
Copy Markdown
Owner

Second of the cleanups proposed in #214 (Group A). Purely additive field updates — no behavior changes. Brings npm run check from 53 → 27 errors (closes 26).

What was wrong

SubAgentForm.svelte reads and writes nine fields that the type contracts never exposed. The reads/writes are correct — the data round-trips through settings.json, the Rust subagents table (20 columns, all present in subagents.rs and subagent_writer.rs), and Tauri — but $lib/types and markdownParser had drifted, so the errors piled up silently.

Changes

File Why
subagent.ts Add disallowedTools, maxTurns, memory, background, effort, isolation, hooks, mcpServers, initialPrompt to both SubAgent (read via Partial<SubAgent> as the form's initialValues) and CreateSubAgentRequest (the object handleSubmit builds). Types match the Rust struct: string[] for disallowedTools, numeric maxTurns, boolean background, the rest strings.
markdownParser.ts Add the seven fields applyParsedSubAgent assigns to ParsedSubAgent. hooks/mcpServers excluded — the paste/import path doesn't touch them.

Maps to #214 groups

Closes group A (SubAgent / ParsedSubAgent type drift, 26 errors).

The remaining 27 errors fall into #214's groups B (containers, 10), D (lucide icon types, 7), E (keybindings "Input" context, 6), H (sessions store rename, 2), K (Tauri InvokeArgs mock, 1), M (subagents selectedProject, 1) — targets for follow-up PRs.

Test plan

🤖 Generated with Claude Code

…PR2)

Second of the cleanups proposed in #214 (Group A). Purely additive
field updates — no behavior changes. Brings `npm run check` from
53 -> 27 errors (closes 26).

## What was wrong

`SubAgentForm.svelte` reads and writes nine fields that the type
contracts never exposed. The reads/writes are correct — the data
round-trips through `settings.json`, the Rust `subagents` table (20
columns, all present in `subagents.rs` and `subagent_writer.rs`), and
Tauri — but `$lib/types` and `markdownParser` had drifted, so the
errors piled up silently.

## Changes

- `subagent.ts` — add `disallowedTools`, `maxTurns`, `memory`,
  `background`, `effort`, `isolation`, `hooks`, `mcpServers`,
  `initialPrompt` to both `SubAgent` (read via `Partial<SubAgent>` as
  the form's `initialValues`) and `CreateSubAgentRequest` (the object
  the form's `handleSubmit` builds). Types match the Rust struct:
  string arrays, a numeric `maxTurns`, a boolean `background`, the
  rest strings.
- `markdownParser.ts` — add the seven fields that `applyParsedSubAgent`
  assigns to `ParsedSubAgent` (`hooks`/`mcpServers` excluded — the
  paste/import path doesn't touch them).

## Maps to #214 groups

Closes group **A** (SubAgent / ParsedSubAgent type drift, 26 errors).

The remaining 27 errors fall into #214's groups B, D, E, H, K, M —
targets for follow-up PRs.

## Test plan

- [x] `npm run check` — 27 errors (down from 53 on `main`)
- [x] `npx vitest run` — 1565/1565 tests pass
- [x] Verified zero NEW errors (remaining 27 all pre-existing, map to
      #214's other groups)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tylergraydev tylergraydev merged commit 87846ef into main May 16, 2026
14 of 15 checks passed
tylergraydev added a commit that referenced this pull request May 16, 2026
Replaces all 5 `@stable` refs across build.yml, release.yml, and
rust-tests.yml with a SHA pin to 29eef336d9b2848a0b548edc03f92a220660cdb8
(`@stable` head as of 2026-03-27).

## Why

`@stable` is a floating ref — any regression dtolnay ships breaks
every PR in flight at once, and we have no signal until a build fails.
Pinning to SHA freezes our action surface so toolchain changes become
explicit lockfile-style updates we choose to take.

## What this does NOT fix

The recent macOS `cargo metadata` -> `rustup-init` flake hitting
several open PRs (#226, #228, #231, #232, #234) is runner-side, not
action-side: this SHA was already what `@stable` resolved to before
and during the flake window. Reruns of failed jobs are passing on the
same SHA, confirming it's transient runner state, not the action.

So this PR is hygiene, not the fix for the current symptom. If the
flake persists we'll need to either work around in the workflow
(retry on the rust-toolchain step) or switch to
`actions-rust-lang/setup-rust-toolchain`.

## Updating later

When we want a newer toolchain or action behavior, bump the SHA and
update the trailing comment. Dependabot can be configured to track
github-actions and propose the bumps.

Co-authored-by: Tyler Gray <tylerg@emergentsoftware.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tylergraydev added a commit that referenced this pull request May 16, 2026
Rebased onto current main. The original commit also included fixes
for preexisting type errors across usageStore/skill/invokeMock/etc.,
but main has since landed canonical fixes for all of them (#221, #226,
#227, #236), so those parts of the original commit are dropped.

Net change: WSL2-specific Rust code (utils/wsl.rs, services/wsl_config.rs)
plus the settings/config plumbing to expose WSL editors in the UI.

See PR #149 for full description.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant