fix: unblock workspace build (bot session result typing + bots/signal tests) - #946
fix: unblock workspace build (bot session result typing + bots/signal tests)#946NecatiY wants to merge 1 commit into
Conversation
packages/bot/core and packages/bots/core both fail to compile with
TS2345: the finish() callback parameter was typed with a loose
{ type: string; ... } shape, which is not assignable to AIResult
(type must be the literal "result"). Type it as AIResult so the
workspace build (tsc -p tsconfig.json) passes in both trees.
Also fixes packages/bots/signal compile errors in the test file:
- IncomingMessage.groupId widened to string | null | undefined (the
implementation already falls back with ??, so undefined is valid)
- test literal now includes isGroup and drops the unused raw field
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
1 similar comment
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
Closing in favour of #942, which landed the same TS2345 build fix (bot/bots core) on 2026-08-09. My branch had also gone dirty and I don't want to浪费 a maintainer rebase on a now-redundant change. Instead I opened #948 — the Telegram integration was the only remaining |
Summary
The workspace build (
pnpm -r build→tsc -p tsconfig.json) fails on three packages. This PR fixes all of them — verified: 712 test files / 3522 tests pass, and every package in the workspace builds clean.Bugs fixed
1.
packages/bot/core+packages/bots/core— TS2345 build breakBoth trees (the duplicate in
bot/and the maintainedbots/) fail to compile:The
finish()callback parameter was typed as a loose object shape instead ofAIResult. Fixed by typing it(result: AIResult). This also resolves the exact failure mode described in #942/#943 — the stalebot/copy still breaks the build, and so doesbots/.2.
packages/bots/signal— test file does not compilesrc/index.test.tsfails typecheck:groupId: undefinedis not assignable tostring | null→ widened theIncomingMessage.groupIdfield tostring | null | undefined. The implementation already falls back viamsg.groupId ?? msg.source, soundefinedis a valid runtime input.rawfield (unused anywhere in the implementation) and omitted requiredisGroup→ cleaned up the literal.Verification
tsc -p tsconfig.jsonexit 0 on every package (top-level + nested) in the workspacevitest run: 712 files passed, 3522 tests passed, 1 skipped