(janitor/test-prune): remove redundant expectTypeOf assertions in cloud-agent-next tests - #6878
Merged
kilo-code-bot[bot] merged 1 commit intoSep 29, 2026
Conversation
…ud-agent-next tests - Drop the `is assignable from the production control transport` case in sandbox-state/ports/reconcile.test.ts. `expectTypeOf(...).toMatchTypeOf(...)` is a compile-time-only assertion with no runtime behavior, and the exact assignability it states is already enforced by the production call site in persistence/SandboxControl.ts (`createReconcilePort(request => this.socketHandler.sendRequest(request))`), which fails typecheck if `sendRequest` ever becomes incompatible with `ReconcileSendRequest`. The four remaining cases in the file keep the runtime coverage of `createReconcilePort`. - Drop the three `expectTypeOf(...).toEqualTypeOf<...>()` lines in test/unit/wrapper/kilo-api.test.ts. Each compares a value whose declared type is already the generic argument (e.g. `result` from `sendPrompt`, which returns `Promise<SessionPromptResponse>`) against itself, i.e. `T` against `T`, so they can never fail. The surrounding `expect(...)` assertions already verify the actual runtime values (`result`/`prompt`/`command`). Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryTest-only cleanup removing four compile-time-only Files Reviewed (2 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
pandemicsyn
approved these changes
Sep 29, 2026
kilo-code-bot
Bot
deleted the
janitor/test-prune-cloud-agent-expect-typeof
branch
September 29, 2026 21:21
This was referenced Sep 30, 2026
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.
Summary
Removes four
expectTypeOfassertions across twoservices/cloud-agent-nexttest files.expectTypeOf(fromexpect-type, re-exported by Vitest) emits no runtime check — every matcher is() => true— so these assertions can never fail at test-execution time and are pure type-system noise.Why each removal cannot detect a regression
src/sandbox-state/ports/reconcile.test.tsit('is assignable from the production control transport')—expectTypeOf<SandboxControlSocketHandler['sendRequest']>().toMatchTypeOf<ReconcileSendRequest>().toMatchTypeOfis compile-time only. The same one-way assignability is already enforced authoritatively at the production call sitepersistence/SandboxControl.ts:756(createReconcilePort(request => this.socketHandler.sendRequest(request))). IfsendRequest's signature ever becomes incompatible withReconcileSendRequest,tsgofails there — independent of this test. The compile-timeexpectTypeOfadds no runtime coverage and no compile-time check the production code does not already perform.createReconcilePortruntime behavior (phase send with attempt identity/timeout, changed-ack rejection, retryable non-ack, readiness probing).test/unit/wrapper/kilo-api.test.tsexpectTypeOf(...).toEqualTypeOf<...>()lines (result,prompt,command).result = await client.sendPrompt(opts)is typedSessionPromptResponsebysendPrompt's return type, so the assertion isexpectTypeOf<SessionPromptResponse>().toEqualTypeOf<SessionPromptResponse>()—TvsT, which is trivially true and provides no compile-time or runtime signal.expect(result).toEqual(completion),expect(prompt.info.error).toEqual(failedCompletion.info.error),expect(command).toEqual(failedCompletion), etc.), which verify the actual values.Verification
pnpm exec vitest run src/sandbox-state/ports/reconcile.test.ts test/unit/wrapper/kilo-api.test.ts— 54 passing (was 55; the one removed test was theexpectTypeOf-only case).pnpm exec tsgo --noEmit(cloud-agent-next) — passes.pnpm -w exec oxlint --config .oxlintrc.json <two files>— 0 errors / 0 warnings.