• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 27764848604
67%

Build:
DEFAULT BRANCH: main
Ran 18 Jun 2026 02:06PM UTC
Jobs 1
Files 763
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Jun 2026 02:00PM UTC coverage: 67.086% (-0.06%) from 67.146%
27764848604

push

github

web-flow
Sync LLM token refresh window with helper TTL (#5557)

When ToolHive configures Claude Code, it writes an apiKeyHelper
(thv llm token) that Claude Code re-invokes on a fixed cadence. The
token source only refreshed 30s before expiry, far shorter than that
cadence, so a helper call near the token boundary could be handed an
about-to-expire token and in-flight requests would 401 before the next
re-invoke recovered. The 401 retry self-heals, but the blip is visible
(and amplified under parallel agent traffic).

Fix it belt-and-suspenders: pin the helper TTL and widen the token
source's preemptive window so the window always exceeds the TTL. Every
helper call in the final window then forces a refresh, so Claude Code
never holds an expired token.

- Add ClaudeCodeHelperTTL (5m) and LLMTokenRefreshWindow (2x TTL) to
  pkg/llmgateway as the single source of truth, kept in sync by a guard
  test asserting window > TTL.
- Add an optional per-source Options.PreemptiveRefreshWindow to the
  token source (0 = default 30s, negative panics). Only the LLM gateway
  path widens it; registry auth keeps the 30s default.
- Write CLAUDE_CODE_API_KEY_HELPER_TTL_MS into ~/.claude/settings.json
  via a new ValueField; RevertLLMGateway removes it on teardown.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

21 of 21 new or added lines in 2 files covered. (100.0%)

75 existing lines in 5 files now uncovered.

69349 of 103373 relevant lines covered (67.09%)

65.13 hits per line

Coverage Regressions

Lines Coverage ∆ File
59
56.63
-4.86% pkg/workloads/manager.go
6
71.7
-1.93% pkg/runner/config.go
5
0.0
-100.0% pkg/workloads/sysproc_unix.go
3
80.42
-0.71% pkg/transport/proxy/httpsse/http_proxy.go
2
96.47
0.0% pkg/authserver/storage/memory.go
Jobs
ID Job ID Ran Files Coverage
1 27764848604.1 18 Jun 2026 02:06PM UTC 763
67.09
GitHub Action Run
Source Files on build 27764848604
  • Tree
  • List 763
  • Changed 11
  • Source Changed 5
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27764848604
  • 94058905 on github
  • Prev Build on main (#27723400482)
  • Next Build on main (#27767797400)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc