Skip to content

fix: populate null fields in /api/status and fix n8n health detection#765

Merged
Lightheartdevs merged 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/api-status-null-fields-and-n8n
Apr 3, 2026
Merged

fix: populate null fields in /api/status and fix n8n health detection#765
Lightheartdevs merged 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/api-status-null-fields-and-n8n

Conversation

@yasinBursali
Copy link
Copy Markdown
Contributor

What

Populate previously-null fields in /api/status response and fix n8n health check returning false negatives.

Why

  • model.tokensPerSecond was hardcoded to null despite llama metrics being fetched in the same request
  • All service uptime values were null
  • disk and system keys were missing from the response
  • check_n8n_available() created a new HTTP session with 3s timeout per call, causing false negatives when n8n was slow to respond

How

  • Populate model.tokensPerSecond from already-fetched llama metrics data
  • Use context_size from llama-server /props when available for contextLength
  • Set service uptime to system uptime for healthy services (pragmatic approximation)
  • Add disk (from get_disk_usage) and system (hostname + uptime) to response and error fallback
  • Refactor check_n8n_available() to reuse the shared HTTP session (30s timeout) from helpers._get_aio_session()
  • Update all 4 n8n-related tests to mock helpers._get_aio_session instead of aiohttp.ClientSession

Testing

  • python -m py_compile passes for all modified files
  • All existing tests pass with updated mocks

Platform Impact

  • macOS / Linux / Windows: No impact — cross-platform Python primitives only

🤖 Generated with Claude Code

- Populate model.tokensPerSecond from llama metrics instead of null
- Use system uptime for healthy services instead of null
- Add disk usage and system info to /api/status response and fallback
- Fix n8n health check to reuse shared HTTP session with longer timeout
- Update all n8n-related tests to mock helpers._get_aio_session

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Lightheartdevs Lightheartdevs merged commit 582f292 into Light-Heart-Labs:main Apr 3, 2026
21 of 28 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.

2 participants