Issue Draft: Timer handles typed as number can fail Deno checks on Windows
Repository: PsycherosAI/Psycheros
Suggested title:
[bug] Timer handles typed as number can fail Deno checks on Windows with Node types present
Summary
Some long-lived timer handles are typed as number | null, but in the local
Windows/Deno workspace with Node ambient types present, setInterval() resolves
to Timeout. That makes type checking fail with:
TS2322 [ERROR]: Type 'Timeout' is not assignable to type 'number'.
Affected areas observed locally
packages/psycheros/src/mcp-client/mod.ts
packages/psycheros/src/scheduler/scheduler.ts
packages/entity-core/src/consolidation/runner.ts
This also blocked unrelated focused checks while validating other patches.
Expected behavior
The code should type-check consistently across Deno environments even when
Node-compatible types influence the timer return type.
Proposed fix
Use ReturnType<typeof setInterval> | null for interval handles rather than
number | null.
Local patch shape:
private tickTimer: ReturnType<typeof setInterval> | null = null;
private pingTimer: ReturnType<typeof setInterval> | null = null;
Local verification
After patching the observed timer handles:
deno check packages/entity-core/src/server.ts packages/entity-core/src/tools/memory.ts packages/entity-core/src/consolidation/runner.ts
deno check packages/psycheros/src/entity/loop.ts packages/psycheros/src/mcp-client/mod.ts packages/psycheros/src/rag/conversation.ts packages/psycheros/src/entity/timestamp.ts packages/psycheros/tests/chat_rag_test.ts
deno task test
Root deno task test passed: 101 tests, 0 failed.
Issue Draft: Timer handles typed as number can fail Deno checks on Windows
Repository:
PsycherosAI/PsycherosSuggested title:
Summary
Some long-lived timer handles are typed as
number | null, but in the localWindows/Deno workspace with Node ambient types present,
setInterval()resolvesto
Timeout. That makes type checking fail with:Affected areas observed locally
packages/psycheros/src/mcp-client/mod.tspackages/psycheros/src/scheduler/scheduler.tspackages/entity-core/src/consolidation/runner.tsThis also blocked unrelated focused checks while validating other patches.
Expected behavior
The code should type-check consistently across Deno environments even when
Node-compatible types influence the timer return type.
Proposed fix
Use
ReturnType<typeof setInterval> | nullfor interval handles rather thannumber | null.Local patch shape:
Local verification
After patching the observed timer handles:
Root
deno task testpassed: 101 tests, 0 failed.