Skip to content

fix: clear jiti cache on SIGUSR1 restart#11143

Closed
Bentlybro wants to merge 1 commit intoopenclaw:mainfrom
Bentlybro:fix/clear-jiti-cache-on-restart
Closed

fix: clear jiti cache on SIGUSR1 restart#11143
Bentlybro wants to merge 1 commit intoopenclaw:mainfrom
Bentlybro:fix/clear-jiti-cache-on-restart

Conversation

@Bentlybro
Copy link
Copy Markdown

@Bentlybro Bentlybro commented Feb 7, 2026

Problem

TypeScript plugins compiled via jiti cache their output to disk. This cache persists across SIGUSR1 restarts, causing modified plugins to not take effect until the cache is manually cleared.

This is a footgun for anyone developing or modifying plugins — changes appear to not work, leading to confusion.

Solution

  1. Use an OpenClaw-specific cache directory (~/.openclaw/cache/jiti) instead of the shared /tmp/jiti
  2. Clear this cache before restarting the gateway on SIGUSR1

This ensures:

  • Plugin changes are always picked up on restart
  • We don't affect other processes that may share /tmp/jiti on the same system
  • Normal startup performance is unaffected (cache only cleared on restart, not first start)

Changes

  • src/plugins/loader.ts: Export OPENCLAW_JITI_CACHE_DIR constant and configure jiti to use it
  • src/cli/gateway-cli/run-loop.ts: Clear the OpenClaw-specific cache directory on SIGUSR1 restart

Testing

  • Build passes
  • Lint passes
  • Manual verification: modified plugin, restarted, changes took effect without manual cache clear

@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Feb 7, 2026
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread src/cli/gateway-cli/run-loop.ts
TypeScript plugins compiled via jiti cache their output to disk.
This cache persists across SIGUSR1 restarts, causing modified plugins
to not take effect until the cache is manually cleared.

Changes:
- Configure jiti to use ~/.openclaw/cache/jiti instead of /tmp/jiti
- Clear this OpenClaw-specific cache directory on SIGUSR1 restart
- Export OPENCLAW_JITI_CACHE_DIR constant for shared access

Using an OpenClaw-specific cache directory avoids affecting other
processes that may share /tmp/jiti on the same system.
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Feb 21, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Feb 24, 2026
@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Mar 8, 2026
@openclaw-barnacle
Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #pr-thunderdome-dangerzone on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant