Skip to content

fix: complete SubsystemLogger mock in directive-tags test#23479

Closed
YuzuruS wants to merge 1 commit intoopenclaw:mainfrom
YuzuruS:fix/directive-tags-test-type-error
Closed

fix: complete SubsystemLogger mock in directive-tags test#23479
YuzuruS wants to merge 1 commit intoopenclaw:mainfrom
YuzuruS:fix/directive-tags-test-type-error

Conversation

@YuzuruS
Copy link
Copy Markdown
Contributor

@YuzuruS YuzuruS commented Feb 22, 2026

Summary

  • Problem: chat.directive-tags.test.ts fails CI with TS2352 type error — logGateway mock only has warn and debug, but SubsystemLogger requires all log-level methods
  • Why it matters: Blocks CI check job (tsgo) on all open PRs
  • What changed: Completed the logGateway mock to include all SubsystemLogger members (subsystem, isEnabled, trace, info, error, fatal, raw, child)
  • What did NOT change (scope boundary): No production code changes; only test fixture updated

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

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.js

Steps

  1. Run pnpm check (specifically pnpm tsgo)

Expected

  • Type check passes

Actual

  • TS2352: Conversion of type { warn: Mock; debug: Mock } to type SubsystemLogger may be a mistake

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

CI results:

  • pnpm check (format + tsgo + lint) passes
  • chat.directive-tags.test.ts — 2/2 tests pass

Human Verification (required)

  • Verified scenarios: pnpm check passes, test file runs and passes
  • Edge cases checked: Mock aligns with SubsystemLogger type definition in src/logging/subsystem.ts
  • What you did not verify: N/A — single test file change

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 this commit
  • Files/config to restore: src/gateway/server-methods/chat.directive-tags.test.ts
  • Known bad symptoms reviewers should watch for: None expected

Risks and Mitigations

None

🤖 Generated with Claude Code

Greptile Summary

Completed logGateway mock in test fixture to match all required SubsystemLogger interface members, fixing TS2352 type conversion error that was blocking CI. The mock now includes all log-level methods (trace, info, error, fatal), utility methods (raw, child), and properties (subsystem, isEnabled).

Confidence Score: 5/5

  • Safe to merge - test-only change with no production code impact
  • Single test file fix that properly implements the complete SubsystemLogger interface. All added methods are correctly mocked with vi.fn() for vitest, isEnabled returns a boolean as expected, and subsystem is set to a test string. No production code changes and no risk of runtime issues.
  • No files require special attention

Last reviewed commit: 50ec1c9

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

The `logGateway` mock in `chat.directive-tags.test.ts` only provided
`warn` and `debug`, but `SubsystemLogger` requires all log-level methods
plus `subsystem`, `isEnabled`, `raw`, and `child`. This caused a TS2352
type error in CI.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@YuzuruS
Copy link
Copy Markdown
Contributor Author

YuzuruS commented Feb 22, 2026

Closing: the same issue was already fixed on main in 8e00965 (test: use real SubsystemLogger in directive-tags test), which uses createSubsystemLogger directly instead of a manual mock. No diff remains after rebasing.

@YuzuruS YuzuruS closed this Feb 22, 2026
@YuzuruS YuzuruS deleted the fix/directive-tags-test-type-error branch February 22, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant