Skip to content

fix: resolve two pre-existing TS errors blocking CI check job#31868

Closed
JoshuaLelon wants to merge 2 commits intoopenclaw:mainfrom
JoshuaLelon:fix/zalouser-chatid-declaration-order
Closed

fix: resolve two pre-existing TS errors blocking CI check job#31868
JoshuaLelon wants to merge 2 commits intoopenclaw:mainfrom
JoshuaLelon:fix/zalouser-chatid-declaration-order

Conversation

@JoshuaLelon
Copy link
Copy Markdown
Contributor

@JoshuaLelon JoshuaLelon commented Mar 2, 2026

Summary

  • Problem: Two pre-existing TypeScript errors on main cause the CI check job to fail for all open PRs
  • Why it matters: Blocks CI for every PR targeting main
  • What changed:
    1. extensions/zalouser/src/monitor.ts: moved const chatId = message.threadId above the senderId guard that references it (TS2448: variable used before declaration)
    2. src/cli/program/config-guard.test.ts: aligned the local type annotation for ensureConfigReady with the actual function signature (runtime: RuntimeEnv, commandPath?: string[]) — was runtime: unknown, commandPath: string[] (TS2322)
  • What did NOT change (scope boundary): No logic changes — declaration ordering fix and type annotation fix only

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Integrations
  • UI / DX

Linked Issue/PR

  • Related: zalouser error introduced by ee1b147 (fix(zalouser): harden inbound sender id handling)
  • Related: config-guard error introduced by 22c3eed36 (fix(cli): config guard test adjustments)

User-visible / Behavior Changes

None

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: any
  • Runtime/container: Node 22+

Steps

  1. pnpm tsgo on current main

Expected

  • Clean typecheck (ignoring optional-dep module-not-found errors)

Actual

  • TS2448 at extensions/zalouser/src/monitor.ts:141:57
  • TS2322 at src/cli/program/config-guard.test.ts:71:7

Evidence

  • Failing test/log before + passing after: pnpm tsgo shows both errors on main, neither after this fix
  • Tests pass: pnpm test extensions/zalouser/ (5/5 that run), pnpm test src/cli/program/config-guard.test.ts (8/8)

Human Verification (required)

  • Verified scenarios: pnpm tsgo clean after fix; both test suites pass
  • Edge cases checked: zalouser chatId value (message.threadId) doesn't depend on anything between old and new positions; config-guard test uses as never cast at call site so the type change is safe
  • What you did not verify: Runtime zalouser message flow (no zalouser account available)

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Revert the two commits
  • Known bad symptoms reviewers should watch for: None

Risks and Mitigations

None

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 2, 2026

Greptile Summary

Moved chatId declaration one line earlier to fix TS2448 error (variable used before declaration). The previous commit ee1b147 added a senderId guard that logs chatId, but chatId was still declared after the guard. This simple reordering fixes the TypeScript error without any logic changes - all variables are extracted from the same message object, so declaration order is safe to change.

  • Fixed TypeScript compilation error blocking CI on main
  • No functional changes - same variable, same value, just declared before first use
  • Unblocks all open PRs that were failing the check job

Confidence Score: 5/5

  • This PR is safe to merge - it's a trivial variable declaration reordering that fixes a TypeScript compilation error
  • Single-line change that moves a variable declaration before its first use. No logic changes, no runtime behavior changes, and fixes a blocking CI issue. The value (message.threadId) doesn't depend on anything between the old and new positions.
  • No files require special attention

Last reviewed commit: 9c445ec

@openclaw-barnacle openclaw-barnacle bot added the cli CLI command changes label Mar 2, 2026
@JoshuaLelon JoshuaLelon changed the title fix(zalouser): move chatId declaration before first use fix: resolve two pre-existing TS errors blocking CI check job Mar 2, 2026
@vincentkoc vincentkoc self-assigned this Mar 2, 2026
@vincentkoc
Copy link
Copy Markdown
Member

Thanks for jumping on CI failures. Closing this PR because the two pre-existing TypeScript issues this PR targeted are already resolved on main, so this branch is now stale/superseded.

If you still see a current failing check on main, please open a fresh PR against that current failure.

@vincentkoc vincentkoc closed this Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: zalouser Channel integration: zalouser cli CLI command changes size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants