fix(build): repair three type errors that break pnpm -r build - #942
Merged
ralyodio merged 1 commit intoAug 9, 2026
Merged
Conversation
`pnpm -r build` currently fails on master. Three distinct type errors, each
blocking the workspace build at a different package.
1. packages/bots/core and packages/bot/core - TS2345
Both packages contain a duplicated copy of the same SessionManager. In each,
the local `finish` callback re-declares its parameter as an inline structural
type using widened primitives:
type: string;
subtype: string;
but `AIResult` (declared a few lines above in the same file) requires the
string literals `"result"` and `"success" | "error"`. A widened `string` is
not assignable to a literal type, so `resolve(result)` is rejected.
Fixed by annotating the parameter with the existing `AIResult` interface
instead of restating its shape. This also removes a hand-duplicated type that
had already drifted from its source, which is what allowed the mismatch.
2. packages/bots/signal - TS2322
The object literal in the timestamp-fallback test does not satisfy
`IncomingMessage` in three ways: `groupId: undefined` where the interface
declares `string | null`, the required `isGroup` field is missing, and an
excess `raw` property is not part of the interface. Corrected all three
rather than only the error the compiler reported first. The test's intent
(out-of-range timestamp falls back to epoch) is unchanged.
Verification
- `tsc -p tsconfig.json --noEmit` exits 0 for each package, using the repo's
own pinned typescript@5.9.3 from the lockfile.
- `vitest run packages/bots/signal` -> 7 passed (7). Behaviour preserved.
- No runtime logic changed; net -22/+4 lines, entirely type-level.
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.
pnpm -r buildfails on master today. Three distinct type errors block theworkspace build at three different packages. This fixes all three.
1.
packages/bots/coreandpackages/bot/core— TS2345Both packages carry a duplicated copy of the same
SessionManager. In each, thelocal
finishcallback re-declares its parameter as an inline structural typewith widened primitives:
AIResultis declared a few lines above in the same file and requires stringliterals. A widened
stringis not assignable to a literal type, soresolve(result)is rejected.Fixed by annotating the parameter with the existing
AIResultinterface ratherthan restating its shape. That also deletes a hand-duplicated type which had
already drifted from its source — the drift is what allowed the mismatch, so
removing it prevents a recurrence.
2.
packages/bots/signal— TS2322The object literal in the timestamp-fallback test does not satisfy
IncomingMessagein three ways:groupId: undefinedwhere the interface declaresstring | nullisGroupmissingrawthat is not on the interfaceAll three corrected, not just the one the compiler reports first. The test's
intent — an out-of-range timestamp falls back to epoch — is unchanged.
Verification
tsc -p tsconfig.json --noEmitexits0for each affected package, using therepo's own pinned
typescript@5.9.3from the lockfile.vitest run packages/bots/signal→ 7 passed (7).pnpm -r buildnow completes green throughsites/sh1pt.com build: Done.No runtime logic changed; the diff is entirely type-level, net -22/+4.
Note on what I deliberately did not include
While investigating I also saw
TS2307 Cannot find modulefor@profullstack/sh1pt-policyand@profullstack/sh1pt-action-packsinpackages/cli. Those are not bugs — both are real workspace packagescorrectly declared
workspace:^; the errors only appear when typecheck runsbefore those packages are built. Building them first clears it. Excluded from
this PR.