Skip to content

fix: allow optional fields on AdapterInfo for inactive adapter payloads#337

Merged
privateip merged 1 commit intoitential:develfrom
fordjes:fix/issue-329-get-health-inactive-adapter-null-fields
Mar 18, 2026
Merged

fix: allow optional fields on AdapterInfo for inactive adapter payloads#337
privateip merged 1 commit intoitential:develfrom
fordjes:fix/issue-329-get-health-inactive-adapter-null-fields

Conversation

@fordjes
Copy link
Contributor

@fordjes fordjes commented Mar 10, 2026

Summary

  • IAP returns null for several fields on AdapterInfo objects when an adapter is inactive or not fully registered (e.g., package, version, description, log_level, log_file, log_max_file_size, log_max_files, pid)
  • The previous required str/int field declarations caused a Pydantic ValidationError on any get_health() call when such adapters exist in the platform response
  • Changed all affected fields to field_name: type | None = None and added 12 regression tests

Test plan

  • make ci passes on the branch
  • New tests in tests/test_models_health.py cover all null-field scenarios
  • get_health tool returns successfully on an IAP instance with inactive adapters

Fixes #329

🤖 Generated with Claude Code

…ds (itential#329)

The IAP platform returns a sparse payload for DEAD adapters — many fields
are absent or null. AdapterInfo, MemoryUsage, and LoggerConfig declared
these as required, causing get_health to fail with 13 ValidationErrors
whenever any adapter is inactive.

- MemoryUsage: mark heapTotal, heapUsed, external, arrayBuffers as Optional
- LoggerConfig: mark console, file, syslog as Optional
- AdapterInfo: mark package_id, description, route_prefix, connection,
  pid, memory_usage, cpu_usage, logger, timestamp, prev_uptime as Optional
- AdapterInfo.pid: broaden to int | str | None (platform sends empty string)

Closes itential#329
@fordjes fordjes requested a review from a team as a code owner March 10, 2026 21:03
@privateip privateip merged commit cf723a3 into itential:devel Mar 18, 2026
5 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.

fix: get_health fails with ValidationError on inactive adapter sparse payload

2 participants