Skip to content

fix: unblock workspace build (bot session result typing + bots/signal tests) - #946

Closed
NecatiY wants to merge 1 commit into
profullstack:masterfrom
NecatiY:fix/workspace-build-ts-errors
Closed

fix: unblock workspace build (bot session result typing + bots/signal tests)#946
NecatiY wants to merge 1 commit into
profullstack:masterfrom
NecatiY:fix/workspace-build-ts-errors

Conversation

@NecatiY

@NecatiY NecatiY commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

The workspace build (pnpm -r buildtsc -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 break

Both trees (the duplicate in bot/ and the maintained bots/) fail to compile:

src/index.ts(126,19): error TS2345: Argument of type '{ type: string; ... }' is not assignable
to parameter of type 'AIResult'. Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"result"'.

The finish() callback parameter was typed as a loose object shape instead of AIResult. Fixed by typing it (result: AIResult). This also resolves the exact failure mode described in #942/#943 — the stale bot/ copy still breaks the build, and so does bots/.

2. packages/bots/signal — test file does not compile

src/index.test.ts fails typecheck:

  • groupId: undefined is not assignable to string | null → widened the IncomingMessage.groupId field to string | null | undefined. The implementation already falls back via msg.groupId ?? msg.source, so undefined is a valid runtime input.
  • the test literal passed an undeclared raw field (unused anywhere in the implementation) and omitted required isGroup → cleaned up the literal.

Verification

  • tsc -p tsconfig.json exit 0 on every package (top-level + nested) in the workspace
  • vitest run: 712 files passed, 3522 tests passed, 1 skipped

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
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 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: git fetch upstream master && git rebase upstream/master.

1 similar comment
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 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: git fetch upstream master && git rebase upstream/master.

@NecatiY

NecatiY commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

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 packages/bots/* bot whose toBotEvent still used the unsafe new Date(msg.timestamp).toISOString(), so I applied the same guard discord (#933) and signal (#932) already have. 16 tests pass locally.

@NecatiY NecatiY closed this Aug 9, 2026
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