Skip to content

fix: correct SayHookAction exact field type to string | string[]#40

Open
ghost wants to merge 1 commit into
mainfrom
tasker/PRO-3057-fix-sayhook-exact-type
Open

fix: correct SayHookAction exact field type to string | string[]#40
ghost wants to merge 1 commit into
mainfrom
tasker/PRO-3057-fix-sayhook-exact-type

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jun 2, 2026

Summary

  • Bug: The exact field on SayHookAction was incorrectly typed as Record<string, unknown> | undefined instead of string | string[] | undefined, forcing TypeScript users to cast manually when using the hook-based say API.
  • Fix: Changed the type of exact in SayHookAction to string | string[] | undefined, consistent with SayPhoneNumberHookAction which correctly types exact: string.
  • Protection: Added SayHookAction.ts to .fernignore to prevent the fix from being overwritten by future Fern code generation until the upstream API definition is corrected.

Root Cause

The types are auto-generated by Fern from the API definition. The Fern generator incorrectly produced Record<string, unknown> for what should be a string | string[] union type. Since the Fern definition source is not in this repository, the fix is applied directly to the generated output and protected via .fernignore.

Linear Issue

PRO-3057

Test Plan

  • Added tests/unit/types/SayHookAction.test.ts with 4 test cases covering: string value, string array value, undefined value, and combined prompt+exact usage
  • Verified TypeScript type checker rejects string assignment to the old Record<string, unknown> type (confirming the bug)
  • Verified TypeScript type checker accepts string and string[] assignments after the fix
  • All 456 tests pass (38 test files)
  • Build (CJS + ESM) passes cleanly
  • No regressions in existing tests

Changes

File Change
src/api/types/SayHookAction.ts exact type: Record<string, unknown> -> string | string[]
.fernignore Added SayHookAction.ts + test file to prevent Fern overwrite
tests/unit/types/SayHookAction.test.ts New test file for type correctness

@ghost ghost added the merge-queue label Jun 2, 2026
@dhruva-reddy dhruva-reddy force-pushed the tasker/PRO-3057-fix-sayhook-exact-type branch from d894d97 to 234d7a6 Compare June 4, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants