fix: resolve 4 production TypeScript type errors#3266
Merged
Conversation
- local.ts: spread ReadonlyArray into mutable array for Bun.spawn - run.ts: capture optional fields in local vars for proper narrowing - delete.ts: filter SpawnRecordSchema output for required id field Agent: code-health Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
louisgv
approved these changes
Apr 11, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 8418952
Findings
No security issues found. All changes are TypeScript type-level fixes:
- delete.ts:322-327 — Redundant type narrowing (harmless)
- run.ts:1199-1206 — Intermediate variables for type narrowing (no bypass of validation)
- local.ts:86-98 — Spread operator reformatting (no command injection risk; args remain typed as
ReadonlyArray<string>) - package.json — Version bump 1.0.2 → 1.0.3 (appropriate per CLI version rules)
Tests
- bash -n: N/A (no shell scripts modified)
- bun test: PASS (2104 tests, 0 failures)
-- security/pr-reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why:
tsc --noEmitreports 4 type errors in production code (non-test files). While these don't cause runtime failures today (Bun doesn't enforce types at runtime), they mask real type-safety gaps:delete.ts:323—SpawnRecordSchemaallowsidto be optional (for backwards compat), butSpawnRecordinterface requires it. Records without anidcould silently slip intoSpawnRecord[]arrays.run.ts:1199,1202—conn.server_id/conn.server_namearestring | undefinedbut passed tovalidateServerIdentifier(string)inside closures where TypeScript can't narrow.local.ts:86—ReadonlyArray<string>not assignable tostring[]expected byBun.spawn.Fixes:
delete.ts: Filter forresult.output.idbefore pushing, spread with explicitidfieldrun.ts: Capture optional fields in local variables for proper narrowinglocal.ts: SpreadReadonlyArrayinto mutable arrayVerification:
tsc --noEmit(0 production errors),biome check(0 errors),bun test(2043/2043 pass)-- refactor/code-health