Skip to content

feat: auto-refresh tool cache via background hash check - #10

Merged
nictuku merged 2 commits into
mainfrom
nictuku/review-tool-cache
Mar 29, 2026
Merged

nictuku merged 2 commits into
mainfrom
nictuku/review-tool-cache

Conversation

@nictuku

@nictuku nictuku commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a /api/tools-hash client that fetches a combined SHA-256 hash of all MCP tool definitions
  • Once per hour, the CLI spawns a detached background subprocess to check the hash and refresh the cache if tools have changed — zero impact on command latency
  • Stores hash and last_checked_at in the tools cache so repeat checks within the hour are skipped entirely
  • pipeboard refresh still works for manual use but is now documented as normally unnecessary

Test plan

  • Verified against local dev server (localhost:4000/api/tools-hash)
  • Fresh cache: ~7ms, no network call
  • Stale cache: ~8ms, background subprocess updates cache for next run
  • Hash mismatch triggers full refresh in background

nictuku added 2 commits March 28, 2026 23:50
Checks /api/tools-hash once per hour in a detached subprocess.
If the hash differs from the cached value, a full refresh runs
in the background. The current command is never blocked — updates
take effect on the next invocation.
The background auto-refresh child process would re-enter
maybeAutoRefresh during init and spawn another child before
updating the cache. Guard with PIPEBOARD_AUTO_REFRESH env var.
@nictuku
nictuku merged commit e089604 into main Mar 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant